/* =====================================================
 * 共享布局样式（顶部条 / 主头部 / 页脚 / 通用组件）
 * 适用于 d:\510.com 下所有 7 大模块页面
 * 各页面只保留页面专属 CSS（form-row、表格、组件等）
 * ===================================================== */

:root {
    --wrap-max: 1200px;
    --header-h: 60px;
    --topbar-h: 36px;
    --body-pt: calc(var(--topbar-h) + var(--header-h) + 16px);
}

/* 全局重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    background: linear-gradient(160deg, #eef2f7 0%, #e6ecf5 45%, #f0f3f8 100%);
    padding: var(--body-pt) 16px 32px;
    color: #1e293b;
}

.wrap { max-width: var(--wrap-max); margin: 0 auto; }

/* ============ 顶部状态条 ============ */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    font-size: 12px; color: #64748b;
}
.topbar .tb-left { display: flex; gap: 14px; align-items: center; }
.topbar .tb-right { display: flex; gap: 8px; align-items: center; }
.topbar a { color: #475569; text-decoration: none; transition: color .15s; }
.topbar a:hover { color: #1e293b; }
.tb-only-mobile { display: none; }

.tb-pill {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 10px; padding: 4px 10px;
    background: linear-gradient(135deg, #5b6cf0, #7e5bef);
    color: #fff; font-size: 12px; font-weight: 500;
    text-decoration: none; transition: transform .15s, opacity .15s;
}
.tb-pill:hover { transform: translateY(-1px); opacity: .95; }
.tb-pill.disabled {
    background: #f1f5f9; color: #94a3b8; cursor: not-allowed; font-weight: 400;
}
.tb-pill.disabled:hover { transform: none; opacity: 1; }

/* ============ 主头部 ============ */
.site-header {
    position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 99;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(238, 242, 247, 0.8);
    display: flex; align-items: center;
    padding: 0 24px;
    transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: 0 6px 28px rgba(30, 41, 59, 0.10); }
.sh-wrap {
    width: 100%; max-width: 1280px; margin: 0 auto;
    display: grid; grid-template-columns: 200px 1fr auto; gap: 24px; align-items: center;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-icon {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, #5b6cf0 0%, #7e5bef 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 16px;
    box-shadow: 0 4px 14px rgba(91, 108, 240, 0.32);
    flex-shrink: 0;
}
.logo-info { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text { font-size: 15px; font-weight: 500; color: #1e293b; }
.logo-slogan { font-size: 11px; color: #94a3b8; margin-top: 3px; }

/* 主导航 */
.site-nav { display: flex; gap: 2px; flex-wrap: nowrap; align-items: center; overflow: hidden; }
.site-nav a {
    text-decoration: none; font-size: 13px; color: #475569;
    background: transparent; border: 1px solid transparent;
    border-radius: 18px; padding: 6px 13px; transition: all .2s;
    white-space: nowrap;
}
.site-nav a.cur {
    background: linear-gradient(135deg, #5b6cf0, #7e5bef);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(91, 108, 240, 0.28);
}
.site-nav a:hover:not(.cur):not(.placeholder) { background: #f1f5f9; color: #1e293b; }
.site-nav a.placeholder {
    background: #fafbfc; border: 1px dashed #cbd5e1;
    color: #94a3b8; cursor: not-allowed;
}
.site-nav a.placeholder::before { content: '✦ '; }
.site-nav a.placeholder:hover { background: #fafbfc; color: #94a3b8; }

/* 用户操作区 */
.user-zone { display: flex; gap: 8px; align-items: center; }
.uz-badge {
    border-radius: 14px; padding: 5px 12px; font-size: 12px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    color: #475569; text-decoration: none; transition: all .2s;
    display: inline-flex; align-items: center; gap: 4px;
    white-space: nowrap;
}
.uz-badge:hover { border-color: #5b6cf0; color: #5b6cf0; }
.uz-badge.placeholder {
    background: #fafbfc; border: 1px dashed #cbd5e1;
    color: #94a3b8; cursor: not-allowed;
}
.uz-badge.placeholder:hover { border-color: #cbd5e1; color: #94a3b8; }
.uz-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #5b6cf0, #7e5bef);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 500;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 2px 8px rgba(91, 108, 240, 0.28);
    transition: transform .15s;
}
.uz-avatar:hover { transform: scale(1.06); }

/* 移动端汉堡菜单按钮 */
.nav-toggle {
    display: none;
    width: 40px; height: 40px; padding: 9px;
    background: transparent; border: none; cursor: pointer;
    flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span {
    display: block; width: 100%; height: 2px;
    background: #475569; border-radius: 2px;
    transition: transform .22s, opacity .22s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端下拉菜单 */
.mobile-menu {
    display: none;
    position: fixed;
    top: calc(var(--topbar-h) + var(--header-h));
    left: 0; right: 0;
    z-index: 98;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 14px 30px rgba(30, 41, 59, 0.14);
}
.mobile-menu.open { display: block; }
.mm-inner { padding: 10px 16px 16px; }
.mm-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.mm-group a {
    display: block; padding: 12px 14px; border-radius: 10px;
    font-size: 14px; color: #475569; text-decoration: none;
    transition: background .15s;
}
.mm-group a:hover { background: #f1f5f9; }
.mm-group a.cur { background: linear-gradient(135deg, #5b6cf0, #7e5bef); color: #fff; }

/* 快速填入提示芯片 */
.qfc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 2px; }
.qfc-chip {
    border: 1px solid #e2e8f0; background: #f8fafc; color: #475569;
    border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.qfc-chip:hover { border-color: #5b6cf0; color: #5b6cf0; background: #eef2ff; }

/* ============ 卡片 / 表单 / 按钮 / 提示 ============ */
.card {
    background: #ffffff; border-radius: 14px;
    box-shadow: 0 8px 28px rgba(30, 41, 59, 0.10);
    padding: 26px 28px 30px; margin-bottom: 20px;
}
h1 { font-size: 21px; font-weight: 500; color: #1e293b; margin-bottom: 6px; }
.sub { font-size: 13px; color: #64748b; margin-bottom: 18px; }
label { display: block; font-size: 14px; color: #475569; margin-bottom: 8px; }
input, select, textarea {
    width: 100%; font-size: 14px; font-family: inherit; color: #1e293b;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 12px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
    border-color: #1890ff; box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15); background: #fff;
}

.btn {
    display: inline-block; border: none; border-radius: 10px; padding: 11px 26px;
    font-size: 15px; font-weight: 500; color: #ffffff;
    background: linear-gradient(135deg, #5b6cf0 0%, #7e5bef 100%);
    cursor: pointer; box-shadow: 0 6px 18px rgba(91, 108, 240, 0.28);
    transition: transform .15s, opacity .15s;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); opacity: .95; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost {
    background: #ffffff; color: #5b6cf0; border: 1px solid #d6ddfb;
    box-shadow: none; padding: 8px 18px; font-size: 14px;
}
.btn-ghost:hover { background: #f8fafc; }
.btn-danger {
    background: #ffffff; color: #dc2626; border: 1px solid #fecaca;
    box-shadow: none; padding: 6px 12px; font-size: 12px;
}
.btn-danger:hover { background: #fef2f2; }

.flash {
    color: #16a34a; background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 8px; padding: 12px 16px; font-size: 14px; margin-bottom: 20px;
}
.error {
    color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 8px; padding: 12px 16px; font-size: 14px; margin-bottom: 20px;
}
.empty {
    text-align: center; color: #94a3b8; padding: 28px 0; font-size: 14px;
}
.loading { color: #5b6cf0; font-size: 14px; padding: 12px 0; }

/* 通用表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
th { background: #f1f5f9; color: #1e293b; font-weight: 500; }
tr:nth-child(even) td { background: #fafbfc; }
tr:hover td { background: #f0f6ff; }
.up { color: #dc2626; }
.down { color: #16a34a; }

/* ============ 页脚 ============ */
.site-footer {
    margin-top: 28px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    color: #475569;
    font-size: 13px;
}
.sf-wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px 20px; }
.sf-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: 32px;
}
.sf-col h4 {
    font-size: 14px; font-weight: 500; color: #1e293b;
    margin-bottom: 14px;
}
.sf-col ul { list-style: none; }
.sf-col li { margin-bottom: 8px; line-height: 1.5; }
.sf-col a {
    color: #64748b; text-decoration: none;
    transition: color .15s;
}
.sf-col a:hover { color: #5b6cf0; }

/* 页脚扩展区（会员权益/算力预留位） */
.sf-ext {
    background: linear-gradient(135deg, #fafbfc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
}
.sf-ext h4 { color: #1e293b; font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.sf-ext-tag {
    display: inline-block; padding: 2px 8px; border-radius: 8px;
    background: #fef3c7; color: #b45309; font-size: 11px; font-weight: 500;
}
.sf-ext-desc { font-size: 12px; color: #64748b; line-height: 1.6; margin-bottom: 12px; }
.sf-ext-cta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sf-ext-pill {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 10px; padding: 7px 14px; font-size: 12px;
    text-decoration: none; transition: all .2s;
    background: #fff; border: 1px solid #e2e8f0; color: #475569;
}
.sf-ext-pill.primary {
    background: linear-gradient(135deg, #5b6cf0, #7e5bef);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(91, 108, 240, 0.28);
}
.sf-ext-pill.primary:hover { transform: translateY(-1px); opacity: .95; }
.sf-ext-pill.disabled {
    background: #fafbfc; border: 1px dashed #cbd5e1;
    color: #94a3b8; cursor: not-allowed;
}
.sf-ext-pill.disabled:hover { transform: none; opacity: 1; }

.sf-ext-qr {
    display: flex; gap: 12px; align-items: center;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}
.sf-ext-qr .qr-box {
    width: 48px; height: 48px; border-radius: 8px;
    background: #ffffff; border: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 11px;
    flex-shrink: 0;
}
.sf-ext-qr .qr-info { font-size: 11px; color: #64748b; line-height: 1.6; }
.sf-ext-qr .qr-info b { color: #475569; font-size: 12px; }

.sf-copyright {
    margin-top: 24px; padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    font-size: 12px; color: #94a3b8;
}
.sf-copyright a { color: #94a3b8; text-decoration: none; }
.sf-copyright a:hover { color: #5b6cf0; }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
    .sf-cols { grid-template-columns: 1fr 1fr; }
    .site-header .sh-wrap { display: flex; align-items: center; gap: 12px; }
    .logo { margin-right: auto; }
    .site-nav { display: none; }
    .nav-toggle { display: flex; order: 3; }
    .user-zone { order: 2; }
}
@media (max-width: 860px) {
    .site-header .sh-wrap { grid-template-columns: 160px 1fr auto; gap: 12px; }
    .logo-slogan { display: none; }
}
@media (max-width: 720px) {
    body { padding-top: calc(var(--topbar-h) + var(--header-h) + 8px); }
    .topbar .tb-left .tb-only-wide { display: none; }
    .topbar .tb-left .tb-only-mobile { display: inline; }
    .site-header { padding: 0 12px; }
    .site-header .sh-wrap { grid-template-columns: 40px 1fr auto; gap: 8px; }
    .logo { gap: 8px; }
    .logo-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
    .logo-text { font-size: 14px; }
    .site-nav a { padding: 5px 10px; font-size: 12px; }
    .uz-badge { padding: 4px 8px; font-size: 11px; }
    .sf-cols { grid-template-columns: 1fr; }
    .sf-wrap { padding: 24px 16px 16px; }
}
@media (max-width: 560px) {
    .card { padding: 20px 16px 24px; }
    h1 { font-size: 18px; }
    .sf-copyright { flex-direction: column; align-items: flex-start; }
}

/* 头部滚动时阴影加深（JS 控制 .scrolled 类） */