/* ============================================================
 * Pan4 Ultimate · 前台样式（重建版）
 * 结构：Base / Pan4 Ultimate v2 redesign / 首页无跳转搜索（classic 默认模板） / Responsive
 * 主题：紫色渐变 hero + 内联搜索结果 + 资源卡片 + 弹窗 + 响应式 + 暗色模式
 * ============================================================ */

/* ============ 变量 / 主题 ============ */
:root {
    --brand: #6d5efc;
    --brand-2: #8b5cf6;
    --brand-3: #a855f7;
    --brand-deep: #5b21b6;
    --hero-grad: linear-gradient(135deg, #6d5efc 0%, #9333ea 55%, #c026d3 100%);
    --bg: #f6f5fb;
    --bg-soft: #ffffff;
    --text: #1f1b3a;
    --text-soft: #6b6685;
    --border: #e7e3f3;
    --card: #ffffff;
    --shadow: 0 8px 28px rgba(76, 60, 160, .10);
    --shadow-lg: 0 20px 60px rgba(20, 15, 40, .30);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --maxw: 1200px;
    --header-h: 60px;
}

[data-theme="dark"] {
    --bg: #15131f;
    --bg-soft: #1e1b2e;
    --text: #ece9f7;
    --text-soft: #a39ec4;
    --border: #2e2a42;
    --card: #1e1b2e;
    --shadow: 0 8px 28px rgba(0, 0, 0, .4);
    --hero-grad: linear-gradient(135deg, #4c1d95 0%, #6d28d9 55%, #9333ea 100%);
}

/* ============ 基础重置 ============ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
mark { background: rgba(109, 94, 252, .25); color: inherit; padding: 0 2px; border-radius: 3px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.main-layout { display: flex; gap: 24px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 300px; flex-shrink: 0; }

/* ============ 头部 / 导航 ============ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .site-header { background: rgba(30, 27, 46, .85); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo-mark { font-size: 22px; }
.logo-img { width: 32px; height: 32px; object-fit: contain; border-radius: var(--radius-sm); display: block; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav > a, .nav-drop-btn {
    color: var(--text-soft); padding: 8px 12px; border-radius: 8px;
    font-size: 14px; background: none; border: none; cursor: pointer; line-height: 1;
}
.main-nav > a:hover, .main-nav > a.active, .nav-drop-btn:hover, .nav-drop-btn.active {
    color: var(--brand); background: rgba(109, 94, 252, .08);
}
.nav-drop { position: relative; }
.nav-drop-menu {
    position: absolute; top: 100%; left: 0; min-width: 180px;
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow); padding: 6px; display: none; flex-direction: column;
}
.nav-drop:hover .nav-drop-menu,
.nav-drop-btn[aria-expanded="true"] + .nav-drop-menu { display: flex; }
.nav-drop-menu a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px;
}
.nav-drop-menu a:hover, .nav-drop-menu a.active { background: rgba(109, 94, 252, .1); color: var(--brand); }
.nav-drop-menu .drop-empty { padding: 8px 10px; color: var(--text-soft); font-size: 13px; }
.nav-cta-group { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-cta { padding: 8px 14px; border-radius: var(--radius-pill); color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.nav-cta-img { height: 18px; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
.header-search {
    margin-left: auto; display: flex; align-items: center; flex: 1; max-width: 320px;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 4px 4px 14px;
}
.header-search input { flex: 1; border: none; background: none; outline: none; font-size: 14px; color: var(--text); }
.header-search button { border: none; background: var(--brand); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: 16px; color: var(--text); }
.icon-btn:hover { border-color: var(--brand); }
.menu-btn { display: none; }

/* 公告栏 */
.announce-bar { background: var(--brand); color: #fff; font-size: 13px; overflow: hidden; }
.announce-inner { display: flex; align-items: center; gap: 10px; padding: 6px 16px; }
.announce-tag { font-weight: 600; flex-shrink: 0; }
.announce-track { display: flex; gap: 24px; overflow: hidden; white-space: nowrap; }
.announce-item { opacity: .95; }

/* ============ Pan4 Ultimate v2 redesign · Hero（紫色渐变） ============ */
.hero {
    background: var(--hero-grad);
    padding: 56px 16px 48px;
    position: relative;
    overflow: hidden;
    color: #fff;
}
.hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, .18), transparent 60%);
    pointer-events: none;
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; text-align: center; }
.hero-title { font-size: 36px; font-weight: 800; margin: 0 0 10px; color: #fff; line-height: 1.2; }
.hero-sub { font-size: 16px; color: rgba(255, 255, 255, .9); margin: 0 0 26px; }

/* 搜索表单（hero 上白色卡片） */
.search-form {
    display: flex; background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18); max-width: 640px; margin: 0 auto;
}
.search-pan {
    appearance: none; -webkit-appearance: none;
    background: #f4f2fb; border: none; border-right: 1px solid var(--border);
    padding: 0 30px 0 16px; font-size: 14px; color: var(--text); cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.search-input { flex: 1; border: none; padding: 14px 16px; font-size: 15px; outline: none; color: var(--text); min-width: 0; }
.search-input::placeholder { color: #aaa; }
.search-submit { border: none; background: var(--brand); color: #fff; padding: 0 28px; font-size: 15px; font-weight: 600; cursor: pointer; transition: filter .2s; }
.search-submit:hover { filter: brightness(.94); }
.hero .search-form { max-width: 640px; }
.hero .search-pan { background-color: #f4f2fb; }
.search-form.inline { max-width: none; margin: 0; box-shadow: 0 4px 16px rgba(76, 60, 160, .08); }

/* 热门标签 */
.hot-tags { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; align-items: center; }
.hot-tags-label { color: #fff; opacity: .9; font-size: 14px; }
.hot-tags .chip, .hot-tags a.chip {
    color: #fff; background: rgba(255, 255, 255, .18); text-decoration: none;
    padding: 6px 14px; border-radius: 16px; font-size: 13px; transition: .2s;
}
.hot-tags .chip:hover { background: rgba(255, 255, 255, .32); }

/* 信息条 */
.hero-info-bar {
    margin: 22px auto 0; display: inline-flex; flex-wrap: wrap; justify-content: center;
    gap: 16px 26px; background: rgba(255, 255, 255, .14); padding: 10px 24px;
    border-radius: 24px; font-size: 13px; color: #fff; opacity: .95;
}

/* ============ 首页无跳转搜索（classic 默认模板） ============ */
.search-results-wrap { margin-top: 28px; }
.search-results-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sr-head-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.section-title { font-size: 18px; margin: 0 0 14px; color: var(--text); }
.pan-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.result-stats { font-size: 14px; color: var(--text-soft); margin: 14px 0; }
.result-stats strong { color: var(--text); }
.src-tag { color: var(--brand); font-weight: 600; }
.src-tip { color: var(--text-soft); font-size: 13px; }

.search-result-list { display: block; }
.search-loading { text-align: center; padding: 20px; color: var(--text-soft); font-size: 14px; }
.loading-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 8px; animation: srPulse 1s infinite; }
@keyframes srPulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* 单条内联结果卡片 */
.sr-item { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; transition: .2s; }
.sr-item:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.sr-main { flex: 1; min-width: 0; }
.sr-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.sr-pan { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-soft); }
.sr-pan-icon { font-size: 14px; }
.sr-tag { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.sr-local { background: rgba(34, 197, 94, .12); color: #16a34a; }
.sr-api { background: rgba(109, 94, 252, .12); color: var(--brand); }
.sr-valid { background: rgba(34, 197, 94, .12); color: #16a34a; }
.sr-checking { background: rgba(250, 204, 21, .16); color: #ca8a04; }
.sr-invalid { background: rgba(239, 68, 68, .12); color: #dc2626; }
.sr-check-err { background: rgba(148, 163, 184, .16); color: #64748b; }
.sr-title { font-size: 16px; margin: 2px 0 4px; color: var(--text); line-height: 1.4; }
.sr-desc { font-size: 13px; color: var(--text-soft); margin: 0; line-height: 1.5; }
.sr-action-wrap { flex-shrink: 0; }
.sr-action { white-space: nowrap; }

/* ============ 资源卡片（搜索/分类/热门/详情相关推荐） ============ */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
/* 详情页「相关推荐」固定列数，与后台设置的 --related-per-row 对齐，避免最后一行缺位 */
.related-box .resource-grid { grid-template-columns: repeat(var(--related-per-row, 4), minmax(0, 1fr)); }
.rcard { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: .2s; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.rcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--brand); }
.rcard-rank { position: absolute; top: -8px; left: -8px; width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.rcard-rank.rank-1 { background: #f59e0b; }
.rcard-rank.rank-2 { background: #a855f7; }
.rcard-rank.rank-3 { background: #06b6d4; }
.rcard-rank.rank-n { background: var(--text-soft); }
.rcard-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rcard-title {
    font-size: 15px;
    margin: 0 0 6px;
    line-height: 1.4;
    max-width: 100%;
    height: 1.4em;
    display: block;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.rcard-title * { white-space: nowrap !important; }
.rcard-title a {
    color: var(--text);
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.rcard-title a:hover { color: var(--brand); }
.rcard-title-plain {
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.rcard-title a mark, .rcard-title-plain mark { white-space: nowrap !important; }
.rcard-desc { font-size: 13px; color: var(--text-soft); line-height: 1.5; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em; }
.rcard-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-soft); margin-bottom: 10px; }
.rcard-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.rcard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* 网盘徽章（按类型着色） */
.pan-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; border-radius: var(--radius-pill); background: rgba(109, 94, 252, .12); color: var(--brand); font-weight: 600; }
.pan-badge.pan-baidu { background: rgba(59, 130, 246, .12); color: #2563eb; }
.pan-badge.pan-quark { background: rgba(168, 85, 247, .12); color: #9333ea; }
.pan-badge.pan-uc { background: rgba(16, 185, 129, .12); color: #059669; }
.pan-badge.pan-xunlei { background: rgba(245, 158, 11, .12); color: #d97706; }
.pan-badge.pan-aliyun { background: rgba(239, 68, 68, .12); color: #dc2626; }
.pan-badge.pan-123pan { background: rgba(14, 165, 2338, .12); color: #0284c7; }
.pan-badge.pan-tianyi { background: rgba(99, 102, 241, .12); color: #4f46e5; }

/* 通用 chip */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, .05); color: var(--text-soft); }
[data-theme="dark"] .chip { background: rgba(255, 255, 255, .08); }
.chip-top { background: rgba(245, 158, 11, .15); color: #d97706; }
.chip-api { background: rgba(109, 94, 252, .12); color: var(--brand); }
.chip-pay { background: rgba(220, 38, 38, .14); color: #dc2626; font-weight: 700; border: 1px solid rgba(220, 38, 38, .3); }

/* 修复 #396：付费资源卡片醒目提醒 */
.rcard-pay { border-color: rgba(220, 38, 38, .35); background: linear-gradient(180deg, rgba(220, 38, 38, .05), var(--card) 60%); }
[data-theme="dark"] .rcard-pay { background: linear-gradient(180deg, rgba(220, 38, 38, .12), var(--card) 60%); }
.pay-lock-banner { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; padding: 6px 10px; border-radius: var(--radius); background: rgba(220, 38, 38, .1); border: 1px solid rgba(220, 38, 38, .28); color: #dc2626; font-size: 13px; font-weight: 600; }
[data-theme="dark"] .pay-lock-banner { background: rgba(220, 38, 38, .18); color: #fca5a5; }
.pay-lock-banner .pay-price { margin-left: auto; padding: 1px 8px; border-radius: var(--radius-pill); background: #dc2626; color: #fff; font-weight: 700; }
.detail-pay-lock { margin: 14px 0 0; padding: 12px 14px; background: rgba(220, 38, 38, .06); border: 1px solid rgba(220, 38, 38, .2); border-radius: var(--radius-md); font-size: 13px; color: #b91c1c; }
.chip-cat { background: rgba(109, 94, 252, .08); color: var(--brand); }
.chip-link { color: var(--brand); background: rgba(109, 94, 252, .1); padding: 5px 12px; border-radius: var(--radius-pill); font-size: 13px; }
.chip-link:hover { background: var(--brand); color: #fff; }
.fav-btn { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-soft); line-height: 1; }
.fav-btn.active { color: #f59e0b; }

/* ============ 按钮 ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: .2s; line-height: 1; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(.94); }
.btn-outline { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-outline:hover { background: rgba(109, 94, 252, .08); }
.btn-ghost { background: rgba(109, 94, 252, .08); color: var(--brand); }
.btn-ghost:hover { background: rgba(109, 94, 252, .16); }
.btn-disabled, .btn:disabled { background: #e5e2ef; color: #9b96b5; cursor: not-allowed; }
[data-theme="dark"] .btn-disabled, [data-theme="dark"] .btn:disabled { background: #2e2a42; color: #6b6685; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ============ 搜索页 / 侧栏 ============ */
.search-header { margin-bottom: 18px; }
.pan-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pf-item { font-size: 13px; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--card); border: 1px solid var(--border); color: var(--text-soft); text-decoration: none; transition: .2s; }
.pf-item:hover { border-color: var(--brand); color: var(--brand); }
.pf-item.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.side-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--text); }
.hot-rank { list-style: none; margin: 0; padding: 0; }
.hot-rank li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.hot-rank li:last-child { border-bottom: none; }
.rank-num { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: rgba(109, 94, 252, .12); color: var(--brand); flex-shrink: 0; }
.hot-rank .rank-num.rank-1 { background: #f59e0b; color: #fff; }
.hot-rank .rank-num.rank-2 { background: #a855f7; color: #fff; }
.hot-rank .rank-num.rank-3 { background: #06b6d4; color: #fff; }
.rank-word { flex: 1; color: var(--text); text-decoration: none; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.rank-word:hover { color: var(--brand); }
.rank-count { font-size: 12px; color: var(--text-soft); flex-shrink: 0; }
.cat-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { font-size: 13px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border); color: var(--text-soft); text-decoration: none; transition: .2s; }
.cat-chip:hover, .cat-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tips { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-soft); line-height: 1.9; }
.empty { font-size: 13px; color: var(--text-soft); }

/* ============ 详情页 ============ */
.detail-wrap { padding: 24px 0; }
.detail-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.detail-title { font-size: 22px; margin: 0 0 12px; color: var(--text); line-height: 1.3; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-desc { font-size: 14px; line-height: 1.7; color: var(--text-soft); margin-bottom: 14px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-soft); margin-bottom: 16px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-qr-inline { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-soft); }
.detail-qr-inline img { border-radius: 10px; margin: 8px auto 0; }
.related-box { margin-top: 24px; }

/* ============ 页面标题 / 面包屑 / 空态 / 提示 ============ */
.page-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.page-title h2 { font-size: 20px; margin: 0; color: var(--text); }
.page-title .count { font-size: 13px; color: var(--text-soft); }
.breadcrumb { font-size: 13px; color: var(--text-soft); margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .current { color: var(--text); }
.breadcrumb .sep { opacity: .5; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-soft); }
.empty-icon { font-size: 48px; margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 8px; color: var(--text); }
.empty-hot { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.alert { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(239, 68, 68, .1); color: #dc2626; }
.alert-info { background: rgba(109, 94, 252, .1); color: var(--brand); }
.alert-icon { flex-shrink: 0; }
.alert-detail { font-size: 12px; opacity: .85; margin-top: 4px; }
.alert-success { background: rgba(34, 197, 94, .1); color: #16a34a; }
.alert-warning { background: rgba(245, 158, 11, .1); color: #d97706; }

/* ============ 通用页面卡片 / 表单 ============ */
.page-section { padding: 24px 0 40px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; color: var(--text); }
.card-body { padding: 20px; }
.settings-form .form-group { margin-bottom: 16px; }
.settings-form .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.settings-form label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.settings-form input, .settings-form select, .settings-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-soft); color: var(--text); font-size: 14px; outline: none; font-family: inherit;
}
.settings-form input:focus, .settings-form select:focus, .settings-form textarea:focus { border-color: var(--brand); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); padding: 10px 18px; border-radius: 10px; text-decoration: none; font-size: 14px; cursor: pointer; }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* ============ 分页 ============ */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 20px; }
.pg { font-size: 13px; padding: 7px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); color: var(--text-soft); text-decoration: none; }
.pg:hover { border-color: var(--brand); color: var(--brand); }
.pg.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pg.disabled { opacity: .5; cursor: not-allowed; }
.pg.dots { border: none; background: none; }
.pg-info { margin-left: 8px; font-size: 12px; color: var(--text-soft); }

/* ============ 搜索建议 / 历史 ============ */
.suggest-form { position: relative; }
.suggest-box { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); display: none; overflow: hidden; z-index: 50; }
.suggest-box.show { display: block; }
.suggest-item { padding: 10px 14px; font-size: 14px; color: var(--text); cursor: pointer; }
.suggest-item:hover { background: rgba(109, 94, 252, .08); color: var(--brand); }
.history-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(109, 94, 252, .1); color: var(--brand); padding: 4px 10px; border-radius: var(--radius-pill); font-size: 13px; cursor: pointer; }
.history-chip .del { cursor: pointer; opacity: .6; }
.history-chip .del:hover { opacity: 1; }

/* Tabs（预留） */
.tab { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--text-soft); border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 15, 40, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-sm { max-width: 380px; }
.modal-transfer { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--text); }
.modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--text-soft); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.modal-res { font-weight: 600; margin: 0 0 12px; color: var(--text); }
.modal-tip { font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.form-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--text-soft); }
.form-row input, .form-row select, .form-row textarea {
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 14px; background: var(--bg-soft); color: var(--text); outline: none; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--brand); }
.qr-body { text-align: center; }
.qr-body img { border-radius: 10px; margin: 0 auto; }
.qr-link { font-size: 13px; color: var(--text-soft); word-break: break-all; margin-top: 10px; }
.popup-body { font-size: 14px; line-height: 1.7; color: var(--text); }
.popup-never { font-size: 13px; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.transfer-body { color: var(--text); }
.transfer-subtitle { color: var(--text-soft); font-size: 13px; margin: 0 0 14px; }
.transfer-success { display: flex; gap: 12px; align-items: center; background: rgba(34, 197, 94, .1); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.ts-icon { width: 36px; height: 36px; border-radius: 50%; background: #22c55e; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.transfer-success strong { color: var(--text); }
.trs-code { font-weight: 700; color: var(--text); }
.transfer-qr { text-align: center; background: var(--bg); border-radius: 12px; padding: 16px; }
.transfer-qr img { border-radius: 10px; margin: 0 auto; }
.qr-hint { display: block; font-size: 12px; color: var(--text-soft); margin-top: 8px; }
.transfer-tip { font-size: 12px; color: var(--text-soft); text-align: center; margin-top: 12px; }

/* ============ 回到顶部 / 调试面板 ============ */
.back-top { position: fixed; right: 20px; bottom: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; border: none; font-size: 20px; cursor: pointer; opacity: 0; pointer-events: none; transition: .3s; z-index: 200; box-shadow: 0 8px 20px rgba(109, 94, 252, .4); }
.back-top.show { opacity: 1; pointer-events: auto; }
.debug-panel { position: fixed; right: 12px; bottom: 12px; max-width: 90vw; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 12px; z-index: 999; max-height: 50vh; overflow: auto; box-shadow: var(--shadow); }
.debug-panel table { border-collapse: collapse; width: 100%; }
.debug-panel th, .debug-panel td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.debug-panel tr.bad td { color: #dc2626; }

/* 调试面板（首页搜索调试） */
.search-debug { margin: 14px 0 20px; padding: 14px 16px; background: #fff7ed; border: 1px solid #ffddb0; border-radius: 10px; color: #7c2d12; font-size: 13px; line-height: 1.6; text-align: left; }
.search-debug .debug-title { font-weight: 700; margin-bottom: 8px; color: #9a3412; }
.search-debug .debug-row { margin-bottom: 6px; }
.search-debug code { background: rgba(0, 0, 0, .05); padding: 2px 6px; border-radius: 4px; font-family: monospace; word-break: break-all; }
.search-debug .debug-pre { margin-top: 8px; background: rgba(0, 0, 0, .04); padding: 10px; border-radius: 6px; max-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: monospace; font-size: 12px; }
[data-theme="dark"] .search-debug { background: rgba(124, 45, 18, .25); border-color: #7c2d12; color: #fdba74; }

.search-pending-tip { margin: 6px 0 16px; padding: 10px 14px; background: rgba(99, 102, 241, .08); border: 1px solid rgba(99, 102, 241, .25); border-radius: 10px; color: var(--text-soft, #555); font-size: 13px; line-height: 1.6; }

/* ============ 友情链接 / 页脚 ============ */
.friend-links { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 20px 0; }
.friend-links h4 { font-size: 14px; margin: 0 0 12px; color: var(--text-soft); }
.fl-list { display: flex; flex-wrap: wrap; gap: 12px; }
.fl-list a { font-size: 13px; color: var(--text-soft); }
.fl-list a:hover { color: var(--brand); }
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 36px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 24px; }
.footer-col h5 { font-size: 14px; margin: 0 0 12px; color: var(--text); }
.footer-col a { display: block; font-size: 13px; color: var(--text-soft); padding: 3px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-brand p { font-size: 13px; color: var(--text-soft); line-height: 1.6; margin: 10px 0 0; }
.footer-contact .contact-img { width: 100px; border-radius: 8px; margin: 0; }
.footer-contact .contact-desc { font-size: 12px; color: var(--text-soft); margin: 0 0 10px; }
.footer-contact .contact-name { display: block; font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.footer-contact .contact-email { font-size: 13px; margin: 8px 0 0; }
.footer-contact .contact-email a { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; text-align: center; }
.disclaimer { font-size: 12px; color: var(--text-soft); margin: 0 0 6px; }
.copyright { font-size: 12px; color: var(--text-soft); margin: 6px 0 0; }
.copyright a { color: var(--text-soft); }
.copyright a:hover { color: var(--brand); }

/* ============ 广告位 ============ */
.ad-slot { margin: 16px 0; text-align: center; position: relative; }
.ad-flag { display: inline-block; font-size: 10px; color: var(--text-soft); background: var(--border); padding: 1px 6px; border-radius: 4px; margin-bottom: 4px; }

/* ============ 极简首页补充（classic） ============ */
.hero-simple { padding: 48px 16px 40px; }
.hero-simple .hero-title { font-size: 32px; margin-bottom: 8px; }
.hero-simple .hero-sub { font-size: 15px; opacity: .85; margin-bottom: 26px; }

.search-form-home {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.search-form-home .search-pan {
    appearance: none; -webkit-appearance: none;
    background: #f7f7f9;
    border: none;
    border-right: 1px solid #e8e8ec;
    padding: 0 28px 0 14px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.search-form-home .search-input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 15px;
    outline: none;
    color: #333;
}
.search-form-home .search-input::placeholder { color: #aaa; }
.search-form-home .search-submit {
    border: none;
    background: #4e8cff;
    color: #fff;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.search-form-home .search-submit:hover { background: #3a7aee; }

.hero-simple .hot-tags { margin-top: 18px; }
.hero-simple .hot-tags-label { color: #fff; opacity: .9; }
.hero-simple .hot-tags a {
    color: #fff;
    background: rgba(255,255,255,.18);
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 13px;
    transition: .2s;
}
.hero-simple .hot-tags a:hover { background: rgba(255,255,255,.3); }

.hero-simple .hero-info-bar {
    margin-top: 22px;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 26px;
    background: rgba(255,255,255,.12);
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 13px;
    color: #fff;
    opacity: .92;
}

@media (max-width: 640px) {
    .hero-simple { padding: 32px 12px 28px; }
    .hero-simple .hero-title { font-size: 24px; }
    .hero-simple .hero-sub { font-size: 13px; }
    .search-form-home { border-radius: 10px; }
    .search-form-home .search-pan {
        padding: 0 22px 0 10px;
        font-size: 13px;
        background-position: right 6px center;
    }
    .search-form-home .search-input { padding: 12px 12px; font-size: 14px; }
    .search-form-home .search-submit { padding: 0 18px; font-size: 14px; }
    .hero-simple .hero-info-bar { font-size: 12px; gap: 10px 16px; padding: 8px 16px; }
}

/* ============ 响应式 ============ */
@media (max-width: 980px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .main-layout { flex-direction: column; }
    .side-col { width: 100%; }
}

@media (max-width: 640px) {
    .hero { padding: 40px 14px 34px; }
    .hero-title { font-size: 26px; }
    .hero-sub { font-size: 14px; }
    .main-nav { display: none; }
    .menu-btn { display: block; }
    .nav-open .main-nav {
        display: flex; position: absolute; top: var(--header-h); left: 0; right: 0;
        background: var(--card); flex-direction: column; padding: 10px 16px;
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow); gap: 4px;
    }
    .nav-open .main-nav .nav-drop-menu { position: static; display: none; box-shadow: none; border: none; padding-left: 12px; }
    .header-search { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .resource-grid { grid-template-columns: 1fr; }
    .related-box .resource-grid { grid-template-columns: 1fr; }
    .search-form { flex-wrap: wrap; }
    .search-form .search-pan { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .search-results-header { flex-direction: column; align-items: flex-start; }
    .sr-item { flex-direction: column; align-items: stretch; }
    .sr-action-wrap { margin-top: 10px; }
    .sr-action { width: 100%; }
    .detail-card { padding: 16px; }
    .modal-foot { flex-direction: column; }
    .modal-foot .btn { width: 100%; }
    .rcard-actions .btn { flex: 1; }
}

/* 首页搜索结果翻页 */
.pagination-bar { margin: 24px 0 8px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination .pg-item,
.pagination .pg-prev,
.pagination .pg-next {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--card); color: var(--text); font-size: 14px;
    text-decoration: none; cursor: pointer; transition: .15s;
}
.pagination .pg-item:hover,
.pagination .pg-prev:hover,
.pagination .pg-next:hover { border-color: var(--brand); color: var(--brand); }
.pagination .pg-item.active,
.pagination .pg-item.active:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .pg-prev.disabled,
.pagination .pg-next.disabled { opacity: .45; cursor: not-allowed; }

/* ===================== 用户中心 / 认证 ===================== */
.alert-danger { background: rgba(239, 68, 68, .1); color: #dc2626; }
.btn-block { width: 100%; }

/* 登录 / 注册页：全屏渐变 + 毛玻璃卡片 */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--hero-grad); position: relative; overflow-x: hidden; }
.auth-page::before {
    content: '';
    position: fixed; inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.18) 0%, transparent 35%),
                radial-gradient(circle at 80% 70%, rgba(255,255,255,.12) 0%, transparent 30%);
    pointer-events: none;
}
.auth-wrap {
    position: relative; z-index: 1;
    width: 100%; max-width: 460px; margin: auto;
    padding: 20px;
}
.auth-glow {
    position: absolute; top: 50%; left: 50%;
    width: 600px; height: 600px; transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,.22) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
}
.auth-card {
    position: relative; z-index: 2;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 26px;
    padding: 38px 34px 34px;
    box-shadow: 0 28px 70px rgba(20, 10, 60, .35), inset 0 1px 0 rgba(255,255,255,.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
[data-theme="dark"] .auth-card {
    background: rgba(30, 27, 46, .92);
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 28px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .auth-logo {
    width: 66px; height: 66px; margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--hero-grad);
    color: #fff; font-size: 30px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(109, 94, 252, .35);
}
.auth-brand h1 { margin: 0; font-size: 22px; color: var(--text); }
.auth-brand p { margin: 6px 0 0; font-size: 14px; color: var(--text-soft); }
.auth-error {
    background: rgba(239, 68, 68, .1); color: #dc2626;
    border: 1px solid rgba(239, 68, 68, .18);
    border-radius: 12px; padding: 11px 14px;
    font-size: 13px; margin-bottom: 18px;
}
.auth-form .auth-field {
    position: relative; margin-bottom: 16px;
}
.auth-form .auth-field .auth-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: var(--text-soft); opacity: .75;
    pointer-events: none;
}
.auth-form .auth-field input {
    width: 100%; height: 50px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-soft);
    color: var(--text); font-size: 14px;
    transition: all .2s;
}
.auth-form .auth-field input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(109, 94, 252, .12);
    background: var(--card);
}
.auth-form .auth-field input::placeholder { color: var(--text-soft); opacity: .6; }
.auth-submit {
    width: 100%; height: 50px; margin-top: 6px;
    border: none; border-radius: 14px;
    background: var(--hero-grad);
    color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(109, 94, 252, .35);
    transition: transform .15s, box-shadow .15s;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(109, 94, 252, .45); }
.auth-submit:active { transform: translateY(0); }
.auth-links {
    margin-top: 22px; text-align: center;
    font-size: 13px; color: var(--text-soft);
}
.auth-links a { color: var(--brand); font-weight: 500; margin-left: 4px; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .auth-sep { color: var(--text-soft); margin: 0 6px; opacity: .6; }
/* 邮箱验证码行：输入框 + 获取按钮 横排 */
.auth-form .auth-code-field {
    display: flex; align-items: center; gap: 10px;
    padding: 0; border: none; background: transparent; margin-bottom: 16px;
}
.auth-form .auth-code-field .auth-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: var(--text-soft); opacity: .75; pointer-events: none;
}
.auth-form .auth-code-field input {
    flex: 1; width: auto; height: 50px;
    padding: 0 14px 0 42px; min-width: 0;
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--bg-soft); color: var(--text); font-size: 14px;
    transition: all .2s;
}
.auth-form .auth-code-field input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(109, 94, 252, .12); background: var(--card);
}
.auth-code-btn {
    flex: 0 0 auto; height: 50px; padding: 0 16px;
    border: 1px solid var(--brand); border-radius: 14px;
    background: transparent; color: var(--brand);
    font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: all .18s;
}
.auth-code-btn:hover:not(:disabled) { background: var(--brand); color: #fff; }
.auth-code-btn:disabled { opacity: .5; cursor: not-allowed; }
/* 登录图形验证码：输入框 + 图片 横排 */
.auth-form .auth-captcha-field { position: relative; }
.auth-form .auth-captcha-field .auth-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: var(--text-soft); opacity: .75; pointer-events: none;
}
.auth-form .auth-captcha-field input {
    flex: 1; width: auto; height: 50px;
    padding: 0 14px 0 42px; min-width: 0;
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--bg-soft); color: var(--text); font-size: 14px;
    transition: all .2s;
}
.auth-form .auth-captcha-field input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(109, 94, 252, .12); background: var(--card);
}
.auth-captcha-img {
    flex: 0 0 auto; height: 50px; width: 120px;
    border-radius: 14px; border: 1px solid var(--border);
    background: #f5f7fa; cursor: pointer; object-fit: cover;
}
.auth-home {
    position: absolute; top: 18px; left: 18px; z-index: 3;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    background: rgba(255,255,255,.2); color: #fff;
    font-size: 13px; backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.25);
}
.auth-home:hover { background: rgba(255,255,255,.3); }
@media (max-width: 480px) {
    .auth-card { padding: 30px 22px 26px; border-radius: 22px; }
    .auth-brand h1 { font-size: 20px; }
}

/* 头部用户入口 */
.icon-btn.user-center-link { width: auto; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; }
.icon-btn.user-center-link .u-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-tools .icon-btn { text-decoration: none; line-height: 1; }

/* ===================== 用户中心 ===================== */
.muted { color: var(--text-soft); }
.d-flex { display: flex; }
.user-hero { display: flex; align-items: center; gap: 18px; padding: 22px; flex-wrap: wrap; }
.user-hero-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; flex-shrink: 0; }
.user-hero-meta { flex: 1; min-width: 180px; }
.user-hero-meta h2 { margin: 0 0 4px; font-size: 20px; }
.user-hero-meta p { margin: 0; font-size: 13px; }
.user-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 13px; color: var(--text-soft); }
.stat-value { font-size: 22px; font-weight: 700; margin: 6px 0 4px; }
.stat-sub { font-size: 12px; color: var(--text-soft); }
.stat-sub a { color: var(--brand); }
.stat-invite { display: block; text-decoration: none; color: inherit; }

.invite-row { display: flex; gap: 10px; margin-top: 10px; }
.invite-input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 13px; }
.invite-stats { display: flex; gap: 22px; margin-top: 14px; font-size: 13px; color: var(--text-soft); flex-wrap: wrap; }
.invite-stats b { color: var(--text); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--text-soft); font-weight: 600; background: var(--bg); }
.data-table tbody tr:hover { background: var(--bg); }
.data-table code { font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.empty-cell { text-align: center; color: var(--text-soft); padding: 28px 0; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.tag-on { background: rgba(34, 197, 94, .12); color: #16a34a; }
.tag-off { background: rgba(148, 163, 184, .16); color: #64748b; }
.tag-normal { background: rgba(59, 130, 246, .12); color: #2563eb; }
.tag-api { background: rgba(168, 85, 247, .14); color: #9333ea; }
.tag-vip { background: rgba(245, 158, 11, .14); color: #d97706; }
.tag-admin { background: rgba(239, 68, 68, .12); color: #dc2626; }

/* 用户中心类型标记（#407） */
.user-type-tag { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.user-type-tag.tag-normal { background: rgba(59, 130, 246, .12); color: #2563eb; }
.user-type-tag.tag-api { background: rgba(168, 85, 247, .14); color: #9333ea; }

.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; display: inline-block; font-size: 14px; }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: #ef4444; color: #fff; border: none; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.btn-danger:hover { filter: brightness(.94); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===================== 套餐 / 收银台 ===================== */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.pkg-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--card); display: flex; flex-direction: column; }
.pkg-type { display: inline-block; align-self: flex-start; font-size: 12px; color: var(--brand); background: rgba(109, 94, 252, .1); padding: 2px 10px; border-radius: 20px; margin-bottom: 10px; }
.pkg-name { font-size: 17px; font-weight: 700; }
.pkg-price { font-size: 26px; font-weight: 800; color: var(--brand); margin: 8px 0 12px; }
.pkg-meta { list-style: none; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--text-soft); }
.pkg-meta li { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.pkg-desc { font-size: 12px; color: var(--text-soft); margin-bottom: 14px; }
.pkg-card .btn-primary { margin-top: auto; text-align: center; }

.checkout-summary { background: var(--bg); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; }
.co-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.co-row .co-price { color: var(--brand); font-size: 18px; font-weight: 700; }
.checkout-tip { background: rgba(109,94,252,.08); border: 1px solid rgba(109,94,252,.25); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.checkout-tip a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.co-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.co-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; font-size: 14px; }
.co-opt:hover { border-color: var(--brand); }
.co-opt input { flex: 0 0 auto; }
.co-opt-title { font-weight: 600; margin: 4px 0 -2px; color: var(--text); }
.co-opt .co-price { color: var(--brand); font-weight: 700; }
.channel-list { display: flex; flex-direction: column; gap: 10px; }
.channel-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; }
.channel-item:hover { border-color: var(--brand); }

/* 登录 / 注册弹窗（未登录点击付费购买弹出） */
.modal-login { max-width: 380px; }
.login-tabs { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; }
.login-tab { flex: 1; padding: 10px 0; border: 0; background: var(--bg); color: var(--text-soft); font-weight: 600; cursor: pointer; }
.login-tab.active { background: var(--brand); color: #fff; }
.login-tab-pane .form-row { margin-bottom: 12px; }
.login-tab-pane label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-soft); }
.login-tab-pane input[type=text], .login-tab-pane input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.login-tab-pane input:focus { border-color: var(--brand); outline: none; }
.btn-api { background: linear-gradient(135deg,#f59e0b,#ef4444); border-color: transparent; }
.login-err { color: #e74c3c; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.login-foot { font-size: 13px; text-align: center; margin-top: 12px; color: var(--text-soft); }
.login-foot a { color: var(--brand); font-weight: 600; }
.login-tip { font-size: 12px; color: var(--text-soft); text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.icon-api { background: linear-gradient(135deg,#f59e0b,#ef4444); color:#fff !important; border-radius: 6px; padding: 4px 10px; font-weight: 600; }
.icon-api:hover { opacity: .9; }
.detail-claim { margin: 12px 0; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.detail-claim.alert-success { background: rgba(46,204,113,.12); color: #27ae60; }
.detail-claim.alert-warning { background: rgba(241,196,15,.12); color: #b7950b; }

/* 普通用户 / API 用户 后台风格区分（#420 独立后台观感） */
.user-hero.hero-normal { border-left: 4px solid var(--brand, #6d5efc); }
.user-hero.hero-api { border-left: 4px solid #f59e0b; background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(239,68,68,.05)); }
.user-hero.hero-api .user-hero-meta h2 { color: #f59e0b; }

.detail-claim a { color: var(--brand); font-weight: 600; }

.pay-result { text-align: center; }
.pay-qr-wrap { margin: 16px 0; }
.pay-qr { display: inline-block; padding: 12px; background: #fff; border-radius: 8px; }
.pay-qr img, .pay-qr canvas { display: block; }
.pay-status { margin-top: 14px; font-size: 14px; color: var(--text-soft); }
.pay-status.ok { color: #16a34a; font-weight: 600; }
.pay-redirect p { margin: 8px 0; }
.withdraw-balance { font-size: 15px; margin-bottom: 16px; }

/* ===================== 用户后台左右布局（user_layout.php） ===================== */
.user-backend { display: flex; align-items: stretch; margin: 18px 0 30px; gap: 18px; }
.ub-side { width: 248px; flex: 0 0 248px; align-self: flex-start; position: sticky; top: 84px; background: var(--card-bg, #fff); border: 1px solid var(--border, #eee); border-radius: 14px; padding: 16px 14px; box-shadow: 0 4px 18px rgba(20,16,50,.05); max-height: calc(100vh - 110px); overflow-y: auto; }
.ub-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ub-brand { display: flex; align-items: center; gap: 10px; }
.ub-brand-txt strong { font-size: 14px; color: var(--text, #222); }
.ub-brand-txt span { font-size: 11px; color: var(--text-soft, #888); }
.ub-side-close { display: none; background: none; border: none; font-size: 18px; color: var(--text-soft, #888); cursor: pointer; }
.ub-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; background: var(--bg-soft, #f6f7fb); border-radius: 10px; margin-bottom: 14px; }
.ub-user-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,#6d5efc,#9b7bff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.ub-user-meta strong { font-size: 14px; color: var(--text, #222); }
.ub-user-meta span { font-size: 11px; color: var(--text-soft, #888); }
.ub-nav { display: flex; flex-direction: column; gap: 4px; }
.ub-nav-group { margin-bottom: 12px; }
.ub-nav-gtitle { font-size: 11px; color: var(--text-soft, #999); letter-spacing: .5px; margin: 6px 8px; text-transform: uppercase; }
.ub-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--text, #333); text-decoration: none; font-size: 14px; transition: background .15s, color .15s; }
.ub-nav-item:hover { background: var(--bg-soft, #f0f1f7); }
.ub-nav-item.active { background: linear-gradient(135deg,#6d5efc,#9b7bff); color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(109,94,252,.3); }
.ub-nav-ico { font-size: 15px; width: 18px; text-align: center; }
.ub-side-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border, #eee); }
.ub-foot-link { display: block; text-align: center; padding: 9px; border-radius: 9px; color: #e5484d; text-decoration: none; font-size: 13px; background: rgba(229,72,77,.08); }
.ub-foot-link:hover { background: rgba(229,72,77,.16); }
.ub-overlay { display: none; }
.ub-main { flex: 1 1 auto; min-width: 0; }
.ub-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ub-menu-btn { display: none; background: var(--card-bg,#fff); border: 1px solid var(--border,#eee); border-radius: 9px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; color: var(--text,#333); }
.ub-title { font-size: 19px; margin: 0; color: var(--text,#222); }
.ub-back-home { margin-left: auto; font-size: 13px; color: var(--text-soft,#888); text-decoration: none; }
.ub-back-home:hover { color: #6d5efc; }
.ub-content { display: block; }
.ub-hero { display: flex; align-items: center; gap: 16px; padding: 22px; margin-bottom: 18px; }
.ub-hero.hero-normal { background: linear-gradient(135deg,#eef0ff,#f7f4ff); }
.ub-hero.hero-api { background: linear-gradient(135deg,#e7f6ff,#eef3ff); }
.ub-hero-avatar { width: 54px; height: 54px; border-radius: 14px; background: linear-gradient(135deg,#6d5efc,#9b7bff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.ub-hero-meta h2 { margin: 0 0 4px; font-size: 18px; color: var(--text,#222); }
.ub-hero-meta .muted { margin: 0; font-size: 12px; color: var(--text-soft,#888); }
.ub-badge { font-size: 12px; padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.ub-badge-on { background: #e6f7ee; color: #16a34a; }
.ub-badge-off { background: #fdeaea; color: #e5484d; }
.ub-badge-free { background: #eef0ff; color: #6d5efc; }
.ub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ub-card { background: var(--card-bg,#fff); border: 1px solid var(--border,#eee); border-radius: 14px; padding: 16px 18px; box-shadow: 0 4px 18px rgba(20,16,50,.04); display: flex; flex-direction: column; }
.ub-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ub-card-head h3 { margin: 0; font-size: 15px; color: var(--text,#222); }
.ub-card-badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft,#f0f1f7); color: var(--text-soft,#777); }
.ub-card-body { flex: 1; }
.ub-kv { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border,#f0f0f0); font-size: 13px; }
.ub-kv:last-of-type { border-bottom: none; }
.ub-kv span { color: var(--text-soft,#888); }
.ub-kv b { color: var(--text,#222); font-weight: 600; }
.txt-on { color: #16a34a !important; }
.txt-off { color: #e5484d !important; }
.ub-progress { margin-top: 10px; }
.ub-progress label { font-size: 12px; color: var(--text-soft,#888); }
.ub-bar { height: 8px; border-radius: 999px; background: var(--bg-soft,#eee); overflow: hidden; margin-top: 4px; }
.ub-bar i { display: block; height: 100%; background: linear-gradient(90deg,#6d5efc,#9b7bff); }
.ub-bar-2 i { background: linear-gradient(90deg,#22c55e,#4ade80); }
.ub-bignum { text-align: center; padding: 14px 0; }
.ub-num { font-size: 32px; font-weight: 800; color: #6d5efc; line-height: 1.1; }
.ub-num-sub { font-size: 12px; color: var(--text-soft,#888); margin-top: 6px; }
.ub-card-foot { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ub-card-foot .btn-primary, .ub-card-foot .btn-outline { flex: 1; text-align: center; padding: 8px 10px; font-size: 13px; border-radius: 9px; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg,#6d5efc,#9b7bff); color: #fff; border: none; }
.btn-primary:hover { opacity: .92; }
.btn-outline { background: var(--card-bg,#fff); color: #6d5efc; border: 1px solid #c9c2ff; }
.btn-outline:hover { background: #f1eeff; }
.ub-empty-tip { margin-top: 18px; padding: 16px 18px; background: #fff8ec; border: 1px solid #ffe2b8; border-radius: 12px; font-size: 13px; color: #8a6d3b; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ub-empty-tip .btn-primary { margin-left: auto; padding: 7px 16px; border-radius: 8px; text-decoration: none; }
@media (max-width: 860px) {
    .user-backend { flex-direction: column; gap: 0; }
    .ub-side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 1200; width: 80%; max-width: 300px; border-radius: 0; max-height: none; transform: translateX(-100%); transition: transform .25s ease; }
    .ub-side.open { transform: translateX(0); }
    .ub-side-close { display: block; }
    .ub-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1100; }
    .ub-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .ub-grid { grid-template-columns: 1fr; }
}
