/* ============================================================
   素心坊 · 门店经营后台
   ============================================================ */

:root {
    --brand: #0a8f4d;
    --brand-dark: #07703d;
    --brand-light: #e6f6ec;
    --ink: #17231c;
    --ink-2: #3f4d45;
    --ink-3: #6b7a72;
    --ink-4: #9aa7a0;
    --line: #e6ebe8;
    --line-strong: #d3ddd8;
    --bg: #f4f6f5;
    --white: #ffffff;
    --danger: #d9453f;
    --warn: #c68a14;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 2px 10px rgba(23, 35, 28, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/*
 * hidden 属性的强制规则
 * ---------------------------------------------------------------
 * HTML 的 hidden 属性靠浏览器默认样式 display:none 生效，
 * 但作者样式表里任何 display 声明优先级都更高——
 * .modal/.app/.view 都设了 display:flex，
 * 会让 hidden 完全失效（弹窗从加载起就可见、标题是 HTML 里的默认值）。
 * 这里统一兜底，保证 hidden 永远有效。
 */
[hidden] {
    display: none !important;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* ===== 按钮 ===== */
.btn {
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-outline {
    border-color: var(--brand);
    background: #fff;
    color: var(--brand);
}

.btn-outline:hover {
    background: var(--brand-light);
}

.btn-ghost {
    border-color: var(--line);
    background: #fff;
    color: var(--ink-2);
}

.btn-ghost:hover {
    border-color: var(--ink-4);
}

.btn-lg {
    width: 100%;
    padding: 13px 18px;
    font-size: 15px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 登录页 ===== */
.login-body {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d3d22 0%, #12512f 45%, #1a6b3f 100%);
}

.login-wrap {
    width: 100%;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 36px 28px;
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.login-brand {
    margin-bottom: 28px;
    text-align: center;
}

.login-logo {
    display: flex;
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

.login-logo.sm {
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 10px;
    font-size: 19px;
}

.login-title {
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.login-sub {
    margin-top: 6px;
    color: var(--ink-3);
    font-size: 14px;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form {
    margin-bottom: 4px;
}

.login-form .field {
    margin-bottom: 14px;
}

.login-form .btn {
    margin-top: 4px;
}

.login-divider {
    display: flex;
    margin: 22px 0 16px;
    align-items: center;
    color: var(--ink-4);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    flex: 1;
    height: 1px;
    background: var(--line);
    content: '';
}

.login-divider span {
    padding: 0 12px;
}

.login-error {
    margin-bottom: 18px;
    padding: 11px 14px;
    border: 1px solid #f5d3d3;
    border-radius: 8px;
    background: #fdf3f3;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

.login-note {
    margin-top: 22px;
    color: var(--ink-4);
    font-size: 12px;
    line-height: 1.65;
}

.login-foot {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--ink-4);
    font-size: 12px;
    text-align: center;
}

.login-foot .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--brand);
    vertical-align: middle;
}

/* ===== 布局 ===== */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    width: 224px;
    flex-shrink: 0;
    flex-direction: column;
    padding: 20px 16px;
    background: #10241a;
    color: #fff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 6px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
}

.sidebar-sub {
    margin-top: 2px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    padding: 10px 12px;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-size: 14px;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: var(--brand);
    color: #fff;
}

.nav-icon {
    width: 18px;
    font-size: 15px;
    text-align: center;
}

.sidebar-foot {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.store-select {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
}

.store-select option {
    color: var(--ink);
}

.sidebar-foot .btn-ghost {
    border-color: rgba(255, 255, 255, 0.18);
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
}

.sidebar-foot .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== 主区 ===== */
.main {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.topbar {
    display: flex;
    padding: 18px 28px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.topbar-title {
    font-size: 19px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-range {
    color: var(--ink-3);
    font-size: 13px;
}

.content {
    flex: 1;
    padding: 24px 28px 40px;
}

.view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ===== 指标卡 ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--ink-3);
    font-size: 13px;
}

.stat-value {
    margin-top: 8px;
    color: var(--ink);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.6px;
}

.stat-value .unit {
    margin-right: 2px;
    font-size: 15px;
    font-weight: 600;
}

.stat-hint {
    margin-top: 6px;
    color: var(--ink-4);
    font-size: 12px;
}

.stat-accent .stat-value {
    color: var(--brand);
}

.stat-warn .stat-value {
    color: var(--warn);
}

/* ===== 面板 ===== */
.panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.panel-row {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 16px;
}

.panel-head {
    display: flex;
    margin-bottom: 16px;
    align-items: baseline;
    justify-content: space-between;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
}

.panel-sub {
    color: var(--ink-4);
    font-size: 12px;
}

/* ===== 图表 ===== */
.chart-box {
    height: 240px;
}

.chart-empty {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--ink-4);
    font-size: 13px;
}

/* ===== 列表 ===== */
.list-box {
    max-height: 300px;
    overflow-y: auto;
}

.list-row {
    display: flex;
    padding: 11px 0;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f2f5f3;
}

.list-row:last-child {
    border-bottom: none;
}

.list-left {
    min-width: 0;
}

.list-title {
    overflow: hidden;
    color: var(--ink-2);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-sub {
    margin-top: 3px;
    color: var(--ink-4);
    font-size: 12px;
}

.list-right {
    margin-left: 16px;
    flex-shrink: 0;
    text-align: right;
}

.list-value {
    color: var(--brand);
    font-size: 15px;
    font-weight: 600;
}

.list-rank {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    border-radius: 5px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

/* ===== 表格 ===== */
.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f3f1;
    text-align: left;
    white-space: nowrap;
}

.table th {
    background: #fafbfa;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
}

.table td {
    color: var(--ink-2);
    font-size: 13px;
}

.table tbody tr:hover {
    background: #fafcfb;
}

.table .num {
    font-variant-numeric: tabular-nums;
}

.table .actions {
    display: flex;
    gap: 8px;
}

.table-empty {
    padding: 40px;
    color: var(--ink-4);
    font-size: 13px;
    text-align: center;
}

/* ===== 标签 ===== */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

.badge-gray {
    background: #f0f2f1;
    color: var(--ink-3);
}

.badge-gold {
    background: rgba(198, 138, 20, 0.12);
    color: var(--warn);
}

.badge-danger {
    background: #fdf0f0;
    color: var(--danger);
}

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 36, 26, 0.5);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-head {
    display: flex;
    padding: 18px 22px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--ink-4);
    font-size: 16px;
}

.modal-body {
    padding: 22px;
}

.modal-foot {
    display: flex;
    padding: 14px 22px;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
}

/* ===== 图片上传 ===== */
.upload-box {
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: #fafbfa;
    padding: 14px;
}

.upload-picker {
    display: flex;
    padding: 20px 12px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    border: 1px dashed #d5ddd9;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.upload-picker:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.upload-icon {
    color: var(--brand);
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
}

.upload-text {
    margin-top: 10px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
}

.upload-hint {
    margin-top: 5px;
    color: var(--ink-4);
    font-size: 12px;
}

.upload-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f3f1;
}

.upload-preview img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
}

.upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(23, 35, 28, 0.62);
    color: #fff;
    font-size: 13px;
    line-height: 26px;
    text-align: center;
}

.upload-remove:hover {
    background: var(--danger);
}

.upload-status {
    min-height: 18px;
    margin-top: 9px;
    color: var(--brand);
    font-size: 12px;
}

.upload-status.error {
    color: var(--danger);
}

/* ===== 内置素材 ===== */
.sample-row {
    display: flex;
    margin-top: 12px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sample-label {
    color: var(--ink-4);
    font-size: 12px;
}

.sample-item {
    width: 62px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 5px;
    cursor: pointer;
    object-fit: cover;
    transition: border-color 0.15s, transform 0.15s;
}

.sample-item:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}

/* ===== 表格缩略图 ===== */
.thumb {
    display: block;
    width: 84px;
    height: 46px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f3f1;
}

.thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-4);
    font-size: 12px;
}

/* ===== 样式选择器 ===== */
.style-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.style-option {
    cursor: pointer;
}

.style-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.style-card {
    display: flex;
    padding: 10px 8px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.style-option:hover .style-card {
    border-color: #b9ccc2;
}

.style-option.active .style-card {
    border-color: var(--brand);
    background: var(--brand-light);
    box-shadow: 0 0 0 2px rgba(10, 143, 77, 0.12);
}

.style-thumb {
    display: block;
    width: 100%;
    height: 46px;
    border-radius: 6px;
    background: #eef2f0;
}

/* 纯图片：整幅铺满 */
.style-thumb-image {
    background: linear-gradient(135deg, #6a9c7f 0%, #3d7a5c 100%);
}

/* 图文叠加：图片 + 左下角文字块 */
.style-thumb-overlay {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 65%),
        linear-gradient(135deg, #7fae8f 0%, #4a8a68 100%);
    position: relative;
}

.style-thumb-overlay::after {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 34px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
    content: '';
}

/* 纯文字：纯色背景 */
.style-thumb-text {
    background: #2e6b4f;
}

.style-name {
    margin-top: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
}

.style-option.active .style-name {
    color: var(--brand);
}

.style-desc {
    margin-top: 3px;
    color: var(--ink-4);
    font-size: 11px;
    text-align: center;
}

/* ===== 档期 ===== */
.period-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-xs {
    padding: 5px 12px;
    font-size: 12px;
}

.period {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
}

.period-text {
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.5;
}

/* ===== 列表里的档期显示 ===== */
.period {
    flex-direction: column;
}

.badge-warn {
    background: #fdf1dc;
    color: #a86a12;
}

/* ===== 表单 ===== */
.form-item {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-3);
    font-size: 13px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbfa;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--brand);
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    margin-top: 5px;
    color: var(--ink-4);
    font-size: 12px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    z-index: 200;
    bottom: 32px;
    left: 50%;
    padding: 11px 22px;
    transform: translateX(-50%);
    border-radius: 8px;
    background: rgba(23, 35, 28, 0.92);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.2);
}

.toast.error {
    background: rgba(217, 69, 63, 0.95);
}

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
    .panel-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        overflow-x: auto;
    }

    .sidebar-brand {
        padding: 0 12px 0 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.09);
    }

    .nav {
        flex-direction: row;
        padding: 0;
    }

    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .sidebar-foot {
        display: flex;
        align-items: center;
        gap: 8px;
        padding-top: 0;
        border-top: none;
    }

    .store-select {
        width: 140px;
        margin-bottom: 0;
    }

    .content {
        padding: 16px;
    }
}

/* ===== 核销台 ===== */
.counter-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
}

.counter-card {
    padding: 28px;
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.counter-title {
    color: var(--ink);
    font-size: 20px;
    font-weight: 600;
}

.counter-desc {
    margin: 8px 0 18px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.6;
}

.counter-input-row {
    display: flex;
    gap: 10px;
}

/* .btn-lg 默认 width:100%，在横向排列里会把输入框挤没，这里改为自适应 */
.counter-input-row .btn-lg {
    width: auto;
    flex-shrink: 0;
    min-width: 120px;
}

.counter-input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 20px;
    letter-spacing: 2px;
    outline: none;
}

.counter-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(10, 143, 77, 0.12);
}

.counter-store-row {
    display: flex;
    margin-top: 16px;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.counter-store-label {
    color: var(--ink-3);
    font-size: 13px;
}

.counter-store {
    width: auto;
    min-width: 180px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.counter-price-hint {
    color: var(--ink-4);
    font-size: 12px;
}

.counter-tip {
    display: flex;
    margin-top: 16px;
    padding: 12px 14px;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 13px;
}

.counter-tip-title {
    color: var(--ink-3);
    font-size: 12px;
}

.counter-tip-note {
    color: var(--ink-4);
    font-size: 12px;
}

/* 核销结果 */
.counter-result {
    padding: 24px 28px;
    border-radius: var(--radius-lg);
}

.counter-result-ok {
    border: 1px solid rgba(10, 143, 77, 0.35);
    background: #f0faf4;
}

.counter-result-fail {
    border: 1px solid rgba(200, 60, 60, 0.35);
    background: #fdf3f3;
}

.cr-head {
    font-size: 18px;
    font-weight: 600;
}

.counter-result-ok .cr-head {
    color: var(--brand);
}

.counter-result-fail .cr-head {
    color: #c0392b;
}

.cr-msg {
    margin-top: 10px;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.6;
}

.cr-grid {
    display: grid;
    margin-top: 18px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.cr-cell {
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
}

.cr-label {
    color: var(--ink-4);
    font-size: 12px;
}

.cr-value {
    margin-top: 4px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
}

.cr-money {
    color: var(--brand);
}

.cr-order {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    color: var(--ink-3);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex;
    margin-bottom: 14px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-input {
    height: 34px;
    min-width: 180px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    outline: none;
}

.filter-input:focus {
    border-color: var(--brand);
}

.filter-date {
    min-width: 140px;
}

.filter-select {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
}

.filter-sep {
    color: var(--ink-4);
    font-size: 12px;
}

/* ===== 分段选择器 ===== */
.seg-group {
    display: flex;
    gap: 8px;
}

.seg {
    cursor: pointer;
}

.seg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seg span {
    display: block;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 13px;
    transition: all 0.15s;
}

.seg input:checked + span {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 500;
}

/* ===== 表格辅助 ===== */
.cell-main {
    color: var(--ink);
    font-weight: 500;
}

.cell-sub {
    margin-top: 2px;
    color: var(--ink-4);
    font-size: 12px;
}

.cell-notice {
    margin-top: 4px;
    color: var(--brand);
    font-size: 12px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.muted {
    color: var(--ink-4);
}

/* ===== 手动充值 ===== */
.warn-box {
    padding: 12px 14px;
    border: 1px solid rgba(198, 138, 20, 0.3);
    border-radius: 8px;
    background: #fdf6e7;
    color: #8a5f0e;
    font-size: 13px;
    line-height: 1.6;
}

/* ===== 充值凭证 ===== */
.voucher {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.voucher-head {
    padding: 16px 20px;
    background: var(--brand-light);
    text-align: center;
}

.voucher-title {
    color: var(--brand);
    font-size: 16px;
    font-weight: 600;
}

.voucher-no {
    margin-top: 4px;
    color: var(--ink-3);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.voucher-rows {
    padding: 8px 20px;
}

.voucher-row {
    display: flex;
    padding: 9px 0;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
}

.voucher-row:last-child {
    border-bottom: none;
}

.voucher-row span {
    color: var(--ink-3);
}

.voucher-row b {
    color: var(--ink);
    font-weight: 500;
}

.voucher-row-total {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.voucher-row-total b {
    color: var(--brand);
    font-size: 16px;
}

.voucher-foot {
    margin: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    background: #fafbfa;
    color: var(--ink-4);
    font-size: 12px;
    line-height: 1.6;
}

/* 打印时只输出凭证 */
@media print {
    body * {
        visibility: hidden;
    }

    #modal,
    #modal * {
        visibility: visible;
    }

    #modal {
        position: static;
        display: block;
    }

    .modal-mask,
    .modal-head,
    .modal-foot {
        display: none !important;
    }

    .modal-card {
        border: none;
        box-shadow: none;
        max-width: 100%;
    }

    .modal-body {
        padding: 0;
        overflow: visible;
    }
}

/* ===== 支付配置 ===== */
.panel-body {
    padding: 20px 24px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-state {
    color: var(--ink-4);
    font-size: 12px;
}

/* ===== 紧凑表格（弹窗内） ===== */
.table-compact {
    font-size: 12px;
}

.table-compact th,
.table-compact td {
    padding: 8px 10px;
}

/* ===== 修改密码入口 ===== */
.sidebar-pwd-btn {
    margin: 0 0 14px;
    align-self: flex-start;
}

/* ===== 忘记密码 ===== */
.login-forgot {
    display: block;
    margin: 16px auto 0;
    padding: 0;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.login-forgot:hover {
    color: #ffffff;
}

.link-btn {
    display: block;
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--brand);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* ===== 重置码展示 ===== */
.recovery-box {
    text-align: center;
    padding: 8px 0;
}

.recovery-code {
    padding: 18px 12px;
    border: 1px dashed var(--brand);
    border-radius: 10px;
    background: var(--brand-light);
    color: var(--brand);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 26px;
    font-weight: 500;
    letter-spacing: 3px;
}

.recovery-meta {
    margin-top: 12px;
    color: var(--ink-3);
    font-size: 13px;
}

.recovery-tip {
    margin: 14px 0 0;
    color: var(--ink-4);
    font-size: 12px;
    line-height: 1.7;
    text-align: left;
}

/* ===== 商品缩略图上传 ===== */
.cover-upload .upload-preview {
    width: 200rpx;
    height: 200rpx;
}

.cover-upload .upload-preview img {
    width: 100%;
    height: 100%;
    border-radius: 14rpx;
    object-fit: cover;
}

.cover-upload .upload-picker {
    width: 200rpx;
    height: 200rpx;
    flex-direction: column;
    gap: 4rpx;
}

/* ===== 商品缩略图（列表） ===== */
.thumb-product {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
}
