/* ==========================================================================
   雨墨工具箱 - 个人博客网站 全局样式
   深色主题 + 蓝紫渐变（与客户端风格一致）
   ========================================================================== */
:root {
    --bg: #0d1020;
    --bg-soft: #141831;
    --card: #1a1f3a;
    --card-hover: #222a4d;
    --border: rgba(120, 130, 255, 0.16);
    --primary: #5f7bff;
    --primary-2: #8b6eff;
    --accent: #3fb950;
    --warn: #f0883e;
    --danger: #f85149;
    --text: #e6edf3;
    --text-dim: #8b94b8;
    --text-muted: #5b6485;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(95, 123, 255, 0.15), transparent 60%),
        radial-gradient(900px 500px at 95% 0%, rgba(139, 110, 255, 0.12), transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
}

a { color: #9db3ff; text-decoration: none; }
a:hover { color: #c4d2ff; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 10px;
    padding: 14px 32px;
    background: rgba(13, 16, 32, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: 0.5px; }
.brand .logo { font-size: 26px; }
.brand small { font-weight: 400; color: var(--text-dim); font-size: 12px; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 28px; flex-wrap: wrap; }
.nav a {
    color: var(--text-dim); padding: 8px 14px; border-radius: 8px;
    font-size: 14px; transition: all .2s;
}
.nav a:hover { color: var(--text); background: rgba(95, 123, 255, 0.12); }
.nav a.active { color: var(--text); background: linear-gradient(135deg, var(--primary), var(--primary-2)); font-weight: 600; }

.topbar-actions { margin-left: auto; display: flex; gap: 10px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px; border-radius: 9px; font-size: 14px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; transition: all .2s;
    white-space: nowrap;
}
a.btn { text-decoration: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; box-shadow: 0 4px 16px rgba(95, 123, 255, 0.35);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 6px 22px rgba(95,123,255,0.5); }
.btn-ghost { background: rgba(255,255,255,0.05); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-success { background: linear-gradient(135deg, #2ea043, #3fb950); color: #fff; box-shadow: 0 4px 14px rgba(63,185,80,.3); }
.btn-success:hover { filter: brightness(1.1); }
.btn-warn { background: linear-gradient(135deg, #d97b2e, #f0883e); color: #fff; }

/* ---------- 主体 ---------- */
.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 28px 60px; }

.page-title { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.page-sub { color: var(--text-dim); font-size: 15px; margin-bottom: 30px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
    transition: transform .2s, border-color .2s;
}
.card:hover { border-color: rgba(140, 155, 255, 0.35); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .nav { margin-left: 0; width: 100%; justify-content: flex-start; }
    .topbar { flex-wrap: wrap; padding: 12px 16px; }
}

/* ---------- 特性卡片（首页） ---------- */
.feature-card { cursor: default; }
.feature-icon { font-size: 34px; margin-bottom: 10px; display: block; }
.feature-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feature-desc { color: var(--text-dim); font-size: 13.5px; }

/* ---------- Hero（首页） ---------- */
.hero { text-align: center; padding: 46px 20px 38px; }
.hero h1 { font-size: 42px; font-weight: 900; letter-spacing: 1px;
    background: linear-gradient(135deg, #fff, #b8c6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { margin-top: 14px; color: var(--text-dim); font-size: 17px; max-width: 640px; margin-inline: auto; }
.hero .badges { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.badge { background: rgba(95,123,255,0.15); border: 1px solid rgba(95,123,255,0.4); color: #aebdff;
    padding: 5px 14px; border-radius: 20px; font-size: 12.5px; }

/* ---------- 公告条（首页） ---------- */
.announce { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; }
.announce .tag { flex-shrink: 0; font-size: 12px; color: #ffcf8e; background: rgba(240,136,62,.15);
    border: 1px solid rgba(240,136,62,.4); padding: 2px 10px; border-radius: 14px; }
.announce .txt { font-size: 14px; color: var(--text-dim); }

/* ---------- 区块标题 ---------- */
.section-title { font-size: 22px; font-weight: 800; margin: 40px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title span { font-size: 20px; }

/* ---------- 区块（首页内容） ---------- */
.feat-block { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.feat-block .img-box { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
    min-height: 220px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, rgba(95,123,255,.12), rgba(139,110,255,.06));
    color: #9db3ff; font-size: 60px; }
@media (max-width: 800px) { .feat-block { grid-template-columns: 1fr; } }

/* ---------- 文档页 ---------- */
.doc h3 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; padding-left: 12px; border-left: 3px solid var(--primary); }
.doc h4 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.doc p { color: var(--text-dim); margin-bottom: 10px; }
.doc ul, .doc ol { margin: 8px 0 14px 22px; color: var(--text-dim); }
.doc li { margin-bottom: 6px; }
.doc code {
    background: rgba(95,123,255,.12); color: #c9d4ff; padding: 2px 7px;
    border-radius: 5px; font-size: 13px; font-family: Consolas, "Courier New", monospace;
}
.doc pre { background: #12162c; border: 1px solid var(--border); border-radius: 10px;
    padding: 16px; margin: 10px 0 16px; overflow-x: auto; }
.doc pre code { background: none; padding: 0; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13.5px; }
.tbl th { background: rgba(95,123,255,.14); text-align: left; padding: 10px 12px; font-weight: 600; }
.tbl td { border-bottom: 1px solid var(--border); padding: 10px 12px; color: var(--text-dim); }
.tbl tr:hover td { background: rgba(95,123,255,0.06); }

/* ---------- 下载中心 ---------- */
.dl-card { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.dl-card .ver { font-size: 28px; font-weight: 900; }
.dl-card .meta { color: var(--text-muted); font-size: 12.5px; }
.dl-card .actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.latest-flag { position: absolute; top: 16px; right: 16px; background: linear-gradient(135deg,#2ea043,#3fb950);
    color:#fff; font-size: 11.5px; padding: 3px 12px; border-radius: 14px; font-weight: 700; }

/* ---------- 时间线（更新日志） ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px;
    background: linear-gradient(180deg, var(--primary), transparent); }
.tl-item { position: relative; margin-bottom: 22px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); box-shadow: 0 0 0 4px rgba(95,123,255,.2); }
.tl-date { font-size: 12.5px; color: var(--text-muted); }
.tl-title { font-size: 16px; font-weight: 700; margin-top: 2px; }
.tl-body { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }
.tl-body li { margin-bottom: 3px; }

/* ---------- 博客卡片 ---------- */
.post-card { display: block; text-decoration: none; color: inherit; }
.post-card:hover { color: inherit; }
.post-card .tag-row { display: flex; gap: 8px; margin-bottom: 8px; }
.pill { font-size: 11.5px; padding: 2px 10px; border-radius: 12px; background: rgba(95,123,255,.16);
    color: #9db3ff; border: 1px solid rgba(95,123,255,.3); }
.pill.orange { background: rgba(240,136,62,.14); color: #ffcf8e; border-color: rgba(240,136,62,.35); }
.pill.green { background: rgba(63,185,80,.14); color: #8ee6a4; border-color: rgba(63,185,80,.35); }
.post-card h4 { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.post-card p { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }
.post-card .date { color: var(--text-muted); font-size: 12px; }

/* ---------- 文章正文 ---------- */
.post-body { font-size: 15px; }
.post-body h2 { font-size: 20px; margin: 30px 0 12px; }
.post-body h3 { font-size: 17px; margin: 24px 0 10px; }
.post-body p { margin-bottom: 14px; color: var(--text-dim); }
.post-body ul, .post-body ol { margin: 0 0 16px 24px; color: var(--text-dim); }
.post-body blockquote { border-left: 3px solid var(--primary); padding: 10px 16px; margin: 14px 0;
    background: rgba(95,123,255,.08); border-radius: 0 8px 8px 0; color: var(--text-dim); }
.post-body img { max-width: 100%; border-radius: 10px; }

/* ---------- FAQ ---------- */
.faq-item { margin-bottom: 14px; }
.faq-q { font-weight: 700; font-size: 15px; padding: 14px 16px; background: rgba(95,123,255,.08);
    border-radius: 10px; cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.faq-q .arrow { transition: transform .25s; color: var(--text-muted); font-size: 13px; }
.faq-item.open .faq-q .arrow { transform: rotate(90deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; color: var(--text-dim); font-size: 14px; }
.faq-item.open .faq-a { max-height: 600px; padding: 12px 16px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 32px 34px; text-align: center; color: var(--text-muted); font-size: 13px; }
.footer .links { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.footer .icp { margin-top: 10px; font-size: 12.5px; }
.footer .icp a { color: #409eff; text-decoration: none; }
.footer .icp a:hover { text-decoration: underline; }

/* ---------- 顶栏登录 ---------- */
.auth-user {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    padding: 5px 12px 5px 6px; border-radius: 22px; font-size: 13.5px; cursor: default;
    color: var(--text);
}
.auth-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.auth-logout { color: var(--text-muted); font-size: 12px; padding: 2px 6px; cursor: pointer; border-radius: 6px; }
.auth-logout:hover { color: #ff9c96; background: rgba(248,81,73,.12); }

/* ---------- 登录弹窗 ---------- */
.login-mask {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(8, 10, 22, 0.72); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
}
.login-box {
    width: 360px; max-width: 92vw; background: var(--card);
    border: 1px solid var(--border); border-radius: 16px; padding: 28px 26px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.login-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.login-input {
    width: 100%; margin-top: 12px; padding: 11px 14px; font-size: 14px;
    background: rgba(255,255,255,0.06); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px; outline: none;
    transition: border-color .2s;
}
.login-input:focus { border-color: var(--primary); }
.login-err { color: #ff9c96; font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- 通知条（接口加载状态） ---------- */
.notice-bar { display: none; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px;
    font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.notice-bar.show { display: flex; }
.notice-bar.ok { background: rgba(63,185,80,.1); border-color: rgba(63,185,80,.4); color: #8ee6a4; }
.notice-bar.err { background: rgba(248,81,73,.1); border-color: rgba(248,81,73,.4); color: #ff9c96; }
.notice-bar.loading { background: rgba(95,123,255,.1); border-color: rgba(95,123,255,.4); color: #aebdff; }

/* ---------- 工具 ---------- */
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }

/* 高亮（对接文档等） */
.hl { color: #8ee6a4; font-weight: 700; }