/* ============================================================
   base.css —— reset + 排版 + 通用组件（不要按产品改这里）
   组件：容器 / 卡片 / chip / 按钮 / 输入 / 空态 / 骨架屏 / 弹窗遮罩
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-display);
    color: var(--text-main);
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---- 双语显隐：全站唯一规则，别在页面里再写一遍 ---- */
html[data-lang="zh"] .zh-inline { display: inline; }
html[data-lang="zh"] .en-inline, html[data-lang="zh"] .en-text { display: none; }
html[data-lang="en"] .en-inline { display: inline; }
html[data-lang="en"] .zh-inline, html[data-lang="en"] .zh-text { display: none; }

/* ---- 容器 ---- */
.wrap { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 820px; }

/* ---- 区块标题 ---- */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 16px; }
.section-head h2 { font-size: 1.15rem; font-weight: 800; }
.section-head .more { margin-left: auto; font-size: .85rem; color: var(--primary); cursor: pointer; }

/* ---- 卡片 ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    -webkit-backdrop-filter: blur(var(--blur-card));
    backdrop-filter: blur(var(--blur-card));
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.card__body { padding: 18px; }

/* ---- chip ---- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-pill);
    border: 1px solid var(--card-border); background: var(--card-bg);
    color: var(--text-main); font-size: .84rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--primary); color: var(--text-inverse); border-color: var(--primary); }

/* ---- 按钮 ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-pill); border: 0;
    background: var(--primary); color: var(--text-inverse);
    font-weight: 700; font-size: .88rem; cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--text-main); border: 1px solid var(--card-border); }
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary); }

/* ---- 输入 ---- */
.input {
    width: 100%; padding: 10px 14px; border-radius: var(--radius-pill);
    border: 1px solid var(--card-border); background: var(--card-bg);
    outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---- 空态 / 骨架 ---- */
.empty {
    padding: 54px 20px; text-align: center; color: var(--text-muted); font-size: .9rem;
}
.skeleton { background: linear-gradient(90deg, rgba(148,163,184,.12) 25%, rgba(148,163,184,.22) 37%, rgba(148,163,184,.12) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 12px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- 弹窗遮罩：约定带 6px 弱高斯模糊，别再写纯灰 ---- */
.modal-mask, [data-overlay-blur] {
    position: fixed; inset: 0; z-index: 9990;
    background: rgba(15, 23, 42, .45);
    -webkit-backdrop-filter: blur(6px) saturate(1.05);
    backdrop-filter: blur(6px) saturate(1.05);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box { width: min(560px, 100%); background: var(--modal-bg); border-radius: var(--radius-card); padding: 20px; }

/* ---- 页脚 ---- */
.common-footer {
    margin-top: 56px; padding: 26px 20px 34px; text-align: center;
    font-size: .78rem; color: var(--text-muted);
    border-top: 1px solid var(--card-border);
}
.common-footer a { margin: 0 6px; }
.common-footer a:hover { color: var(--primary); }

/* ---- 无障碍 / 降噪 ---- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
