/* 卖家管理站样式（2026-10-27 售卖化）—— 卡片式后台，风格与产品后台一致 */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #1f2937;
    font-size: 14px;
}
a { color: #2563eb; text-decoration: none; }

/* 顶部栏 */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .logo { font-weight: 700; font-size: 15px; white-space: nowrap; }
.topbar .logo span { color: #2563eb; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tab-btn {
    border: 0;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
    white-space: nowrap;
}
.tab-btn:hover { background: #f3f4f6; }
.tab-btn.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.topbar .user { color: #6b7280; font-size: 13px; white-space: nowrap; }

/* 布局 */
.wrap { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.panel { display: none; }
.panel.active { display: block; }

/* 卡片 */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .desc { margin: 0 0 14px; color: #6b7280; font-size: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
}
.stat .num { font-size: 24px; font-weight: 700; }
.stat .label { color: #6b7280; font-size: 12px; margin-top: 2px; }

/* 表单 */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.form-row label { font-size: 13px; color: #4b5563; white-space: nowrap; }
input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
input.wide { flex: 1; min-width: 220px; }
textarea { width: 100%; }
.btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover:not(:disabled) { background: #f9fafb; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-green { background: #059669; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #6b7280; font-weight: 500; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
tr:hover td { background: #fafbfc; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.break-all { word-break: break-all; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.badge-unused { background: #f3f4f6; color: #4b5563; }
.badge-activated { background: #dcfce7; color: #166534; }
.badge-disabled { background: #fee2e2; color: #991b1b; }
.badge-current { background: #eff6ff; color: #2563eb; }

/* 提示条 */
.msg { min-height: 20px; font-size: 13px; margin: 6px 0; }
.msg.ok { color: #059669; }
.msg.err { color: #dc2626; }

/* toast */
#toast {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast-item {
    background: #1f2937;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    max-width: 360px;
}
.toast-item.err { background: #991b1b; }
.toast-item.ok { background: #065f46; }

/* 登录页 */
.login-box {
    max-width: 380px;
    margin: 12vh auto 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
}
.login-box h1 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.login-box .sub { text-align: center; color: #6b7280; font-size: 13px; margin-bottom: 20px; }
.login-box input { width: 100%; margin-bottom: 12px; }
.login-box .btn { width: 100%; padding: 10px; }

/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    width: 90%;
    max-width: 420px;
}
.modal h3 { margin: 0 0 12px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.hidden { display: none !important; }

/* 2026-10-28 审计修复：概览趋势图 */
.trend { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding: 8px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.trend-bar { background: #2563eb; border-radius: 4px 4px 0 0; min-height: 3px; }
.trend-n { font-size: 11px; color: #6b7280; text-align: center; }
.trend-d { font-size: 10px; color: #9ca3af; text-align: center; white-space: nowrap; }
