/* ============================================================
   盛趣账号管理器 - 商业化扁平设计（Flat Design）
   统一配色 / 间距 / 字体层级 / 组件风格
   ============================================================ */
:root {
    /* 品牌主色 */
    --primary: #2f6bff;
    --primary-dark: #1f54e0;
    --primary-soft: #eaf0ff;

    /* 中性色 */
    --ink: #1a1d24;          /* 主文字 */
    --ink-2: #4a5160;        /* 次级文字 */
    --ink-3: #8a90a0;        /* 辅助文字 */
    --line: #e8eaef;         /* 边框 */
    --line-2: #f0f2f6;       /* 浅分隔 */
    --bg: #f4f5f7;           /* 页面背景 */
    --surface: #ffffff;      /* 卡片/面板 */
    --sidebar: #161a23;      /* 侧栏底色 */
    --sidebar-2: #1f2530;

    /* 状态色 */
    --green: #16a34a;  --green-soft: #e7f6ed;
    --red:   #e5484d;  --red-soft:   #fdeced;
    --orange:#e08a00;  --orange-soft:#fdf2e0;

    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.04);
    --shadow-md: 0 4px 16px rgba(16,24,40,.06);
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 600; color: var(--ink); }
.muted { color: var(--ink-3); }

/* ---------------- 后台布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px; flex-shrink: 0;
    background: var(--sidebar);
    color: #c8cdd8;
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
}
.sidebar .brand {
    padding: 22px 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand .b-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .3px;
}
.sidebar .brand .b-dot {
    width: 26px; height: 26px; border-radius: 7px;
    background: var(--primary); color: #fff;
    display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.sidebar .brand small { display: block; font-size: 11px; color: #7d8696; margin-top: 8px; letter-spacing: .4px; }

.sidebar nav { padding: 14px 12px; flex: 1; }
.sidebar nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; margin-bottom: 4px;
    color: #c8cdd8; font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.sidebar nav a .ico { width: 18px; text-align: center; opacity: .85; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar nav a.active .ico { opacity: 1; }

.sidebar .side-foot {
    padding: 14px 22px; border-top: 1px solid rgba(255,255,255,.06);
    font-size: 12px; color: #7d8696; line-height: 1.7;
}
.sidebar .side-foot a { color: #9db8ff; }

.main { margin-left: 232px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 58px; background: var(--surface); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); }
.content { padding: 26px; }

/* ---------------- 卡片 ---------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.card-head h2, .card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------------- 统计看板 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.stat-card .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.stat-card.s-wait .accent { background: var(--green); }
.stat-card.s-sold .accent { background: var(--red); }
.stat-card.s-book .accent { background: var(--orange); }
.stat-card .label { color: var(--ink-2); font-size: 13px; }
.stat-card .num { font-size: 30px; font-weight: 700; margin-top: 8px; letter-spacing: .5px; }
.stat-card.s-wait .num { color: var(--green); }
.stat-card.s-sold .num { color: var(--red); }
.stat-card.s-book .num { color: var(--orange); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
    text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2);
    white-space: nowrap;
}
table.data th { background: #fafbfc; font-weight: 600; color: var(--ink-2); font-size: 13px; }
table.data tbody tr:nth-child(even) { background: #fcfcfd; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--primary-soft); }

/* ---------------- 标签 / 徽章 ---------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; line-height: 20px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-gray   { background: #eef0f3; color: #6b7280; }

.redeem-code {
    font-family: var(--mono); background: #f1f3f7; border: 1px solid var(--line);
    border-radius: 5px; padding: 2px 8px; font-size: 13px; color: var(--ink); letter-spacing: 1px;
}

/* ---------------- 表单 / 输入 ---------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
input[type=text], input[type=password], input[type=search], select, textarea {
    font-family: inherit; font-size: 14px; color: var(--ink);
    border: 1px solid #d4d8e0; border-radius: var(--radius-sm);
    padding: 9px 12px; background: #fff; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #b3b8c4; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,.14);
}
textarea { resize: vertical; min-height: 72px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; max-width: 760px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 9px 18px; line-height: 1.2; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: #d4d8e0; }
.btn-outline:hover { background: #f6f7f9; border-color: #c0c5cf; }
.btn-danger { background: #fff; color: var(--red); border-color: #f3b5b7; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 6px 8px; font-size: 13px; }
.btn-link.danger { color: var(--red); }

/* ---------------- 提示 ---------------- */
.alert { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); color: #157a42; border-color: #c4ead2; }
.alert-error   { background: var(--red-soft);   color: #b42326; border-color: #f3c2c4; }
.alert-info    { background: var(--primary-soft); color: #1f54e0; border-color: #cdddff; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--ink-3); font-size: 13px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   认证 / 公共提交 —— 统一双栏（左侧品牌视觉 + 右侧表单）
   ============================================================ */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-aside {
    flex: 1; background: linear-gradient(160deg, #1f2530 0%, #161a23 100%);
    color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-aside::after {
    content: ""; position: absolute; right: -120px; bottom: -120px;
    width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, rgba(47,107,255,.35), transparent 70%);
}
.auth-aside .a-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; position: relative; z-index: 1; }
.auth-aside .a-dot { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.auth-aside .a-hero { position: relative; z-index: 1; }
.auth-aside .a-hero h1 { color: #fff; font-size: 30px; line-height: 1.35; font-weight: 700; }
.auth-aside .a-hero p { color: #b3bccf; font-size: 14px; margin-top: 14px; max-width: 360px; line-height: 1.8; }
.auth-aside .a-feat { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; position: relative; z-index: 1; }
.auth-aside .a-feat div { display: flex; align-items: center; gap: 12px; color: #d7dce8; font-size: 14px; }
.auth-aside .a-feat .fi { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: var(--primary); font-weight: 700; }
.auth-aside .a-foot { position: relative; z-index: 1; font-size: 12px; color: #7d8696; }

.auth-main { width: 480px; flex-shrink: 0; background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-panel { width: 100%; max-width: 360px; }
.auth-panel .p-title { font-size: 22px; font-weight: 700; }
.auth-panel .p-sub { color: var(--ink-3); font-size: 13px; margin-top: 6px; margin-bottom: 28px; }
.auth-panel .form-field { margin-bottom: 18px; }
.auth-panel label { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 7px; }
.auth-panel .btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }
.auth-panel .p-note { margin-top: 22px; font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.7; }
.auth-panel .p-note a { color: var(--primary); }

/* 兑换码结果 */
.code-box {
    text-align: center; background: #f8fafc; border: 1px dashed #c3cee0; border-radius: 10px;
    padding: 24px 16px; margin: 22px 0 10px;
}
.code-box .cl { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }
.code-box .cv {
    font-family: var(--mono); font-size: 26px; font-weight: 700;
    letter-spacing: 3px; color: var(--primary); word-break: break-all;
}
.code-tip { font-size: 12px; color: var(--ink-3); text-align: center; margin-bottom: 20px; line-height: 1.7; }

/* ---------------- 弹窗 Modal（扁平风格） ---------------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(22,26,35,.5);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 60px 16px; z-index: 100; overflow-y: auto;
}
.modal-mask[hidden] { display: none; }
.modal {
    width: 100%; max-width: 560px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); animation: modalIn .16s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; }
.modal-close { border: none; background: none; font-size: 24px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }

/* ---------------- 工具类 ---------------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .auth-aside { display: none; }
    .auth-main { width: 100%; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 18px; }
}
