/* manual.css - v1.4 响应式宽度与 main.css 保持一致 */

/* ===== 基础变量定义（与 main.css 完全一致，并添加容器变量）===== */
:root {
    --bg: #0b1020;
    --card: #141a33;
    --text: #e8ebff;
    --muted: #9aa3ff;
    --accent: #6cf2c2;
    --accent2: #7aa2ff;
    --accent3: #90c9f3;
    --border: rgba(122,162,255,.15);
    --container-width: 1400px; /* 与 main.css 一致的最大宽度 */
    --container-padding: clamp(16px, 5vw, 40px); /* 响应式内边距 */
}

    /* ===== 亮色主题覆盖（与 main.css 完全一致）===== */
    :root[data-theme="light"] {
        --bg: #fdf6e3;
        --card: #ffffff;
        --text: #1b1b1b;
        --muted: #555555;
        --accent: #0000ff;
        --accent2: #c4f8f4;
        --accent3: #90c9f3;
        --border: rgba(0,0,0,.1);
    }

/* ===== body 样式（与 main.css 一致，添加 flex 布局确保 footer 置底）===== */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    transition: background 0.4s, color 0.4s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 主题切换按钮样式 - 与 main.css 100% 一致 ===== */
#theme-toggle {
    top: 8px;
    right: 10px;
    padding: 8px 20px;
    border: none;
    background: rgba(11,16,32,.9);
    color: var(--text);
    font-size: clamp(12px, 2vw, 14px); /* 响应式字体 */
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    margin-left: auto;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(122,162,255,.15);
    transition: background 0.3s, color 0.3s;
    border-radius: 6px; /* 增加圆角，与 main.css 统一 */
}

/* 亮色主题下的顶部按钮样式（与 main.css 完全一致） */
:root[data-theme="light"] #theme-toggle {
    background: rgba(255,255,255,.9);
}

/* 悬停效果（与 main.css 完全一致） */
#theme-toggle:hover {
    background: var(--accent2);
    color: #0b1020;
}

/* ===== 页面容器 ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto; /* 居中，上下间距由内边距控制 */
    padding: clamp(20px, 4vh, 40px) var(--container-padding); /* 响应式内边距 */
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%; /* 确保占满可用宽度 */
    box-sizing: border-box; /* 防止内边距撑开宽度 */
}

.subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== 标题样式 ===== */
h1, h2, h3 {
    color: var(--accent);
    transition: color 0.4s;
}

h1 {
    text-align: center;
    margin-bottom: 16px;
    font-size: clamp(28px, 5vw, 40px); /* 响应式标题大小 */
}

h2 {
    margin-top: 24px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent2);
    padding-left: 12px;
    font-size: clamp(22px, 4vw, 30px);
}

h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: clamp(18px, 3vw, 24px);
}

/* ===== 文本与列表 ===== */
p {
    margin-bottom: 12px;
    font-size: clamp(15px, 2.2vw, 17px); /* 响应式正文 */
}

ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

li {
    margin-bottom: 6px;
    font-size: clamp(14px, 2vw, 16px);
}

/* ===== 链接样式 ===== */
a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
        opacity: 0.9;
    }

.download-links a {
    display: inline-block;
    margin: 8px 8px 8px 0;
    padding: 8px 16px; /* 稍微增大点击区域 */
    border-radius: 30px; /* 圆角与 main.css 的 btn 统一 */
    background: linear-gradient(90deg, var(--accent2), var(--accent3));
    color: #0b1020;
    font-weight: 600;
    text-decoration: none;
    font-size: clamp(13px, 2vw, 15px);
    transition: opacity 0.3s, transform 0.2s;
}

    .download-links a:hover {
        opacity: 0.9;
        transform: translateY(-2px);
    }

    .download-links a:active {
        transform: translateY(0);
    }

/* ===== 分隔线 ===== */
hr {
    border: 0;
    border-top: 1px solid var(--accent2);
    margin: 24px 0;
}

/* ===== 代码块 ===== */
code {
    background-color: rgba(122, 162, 255, .1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent2);
    font-size: 0.9em; /* 相对大小 */
}

/* ===== 辅助功能 ===== */
a:focus,
button:focus {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

/* =================================
   Footer 基础样式（与 main.css 统一）
================================= */
footer {
    text-align: center;
    padding: clamp(24px, 5vh, 40px) var(--container-padding);
    color: var(--muted);
    border-top: 1px solid rgba(122,162,255,.15);
    background: rgba(11,16,32,.6);
    margin-top: auto; /* 确保 footer 始终在底部 */
    width: 100%;
    box-sizing: border-box;
}

:root[data-theme="light"] footer {
    background: rgba(255,255,255,.8);
}

/* =================================
   Footer 链接样式优化（与 main.css 一致）
================================= */

/* 普通链接（备案链接） */
footer a {
    color: var(--accent2);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.3s, text-decoration 0.3s;
}

/* 亮色主题：使用更深、更清晰的蓝色 */
:root[data-theme="light"] footer a {
    color: #0056b3;
}

/* 悬停状态：主题色 + 移除下划线 */
footer a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* 已访问链接：降低饱和度但仍保持清晰 */
footer a:visited {
    color: var(--muted);
    opacity: 0.85;
}

:root[data-theme="light"] footer a:visited {
    color: #6c757d;
}

/* =================================
   强调型链接（公众号、邮箱）
================================= */
footer a.footer-highlight {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

    footer a.footer-highlight:hover {
        text-decoration: underline;
    }

/* 亮色主题：使用更深、更稳的绿色 */
:root[data-theme="light"] footer a.footer-highlight {
    color: #007a3d;
}

/* ===== 打印样式 ===== */
@media print {
    #theme-toggle {
        display: none;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .container {
        box-shadow: none;
        border: 1px solid #ccc;
        margin-top: 20px;
        background: white !important;
    }

    footer {
        display: none; /* 打印时隐藏 footer */
    }

    a {
        color: black !important;
        text-decoration: underline;
    }
}

/* ===== 超小屏幕优化（≤480px）===== */
@media (max-width: 480px) {
    .download-links a {
        display: block; /* 小屏幕下载链接块级显示 */
        margin: 8px 0;
        text-align: center;
    }
}

/* ===== 超大屏幕优化（≥2560px）===== */
@media (min-width: 2560px) {
    :root {
        --container-width: 1800px; /* 超大屏幕可适当增加宽度 */
    }

    body {
        font-size: 18px;
    }
}
