/* 壶小养后台管理 - 新中式国潮风 */
:root {
    --primary: #D4A853;
    --primary-dark: #B8923A;
    --primary-light: #F0D98C;
    --bg: #FFF8F0;
    --card-bg: rgba(255,255,255,0.85);
    --text: #3D2B1F;
    --text-light: #8B7355;
    --border: rgba(212,168,83,0.2);
    --green: #7CB342;
    --red: #E57373;
    --blue: #64B5F6;
    --shadow: 0 2px 12px rgba(212,168,83,0.12);
}

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

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== 登录页 ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #FFF8F0 0%, #F5E6D0 100%);
}

.login-box {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px 40px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(212,168,83,0.15);
    border: 1px solid var(--border);
    text-align: center;
}

.login-logo { font-size: 56px; margin-bottom: 8px; }
.login-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }

.login-box input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: rgba(255,255,255,0.6);
    outline: none;
    transition: border-color .2s;
    margin-bottom: 14px;
}
.login-box input:focus { border-color: var(--primary); }

.login-box .btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.login-box .btn:hover { opacity: 0.9; }
.login-err { color: var(--red); font-size: 13px; margin-top: 10px; display: none; }

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

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    background: linear-gradient(180deg, #3D2B1F 0%, #2C1E14 100%);
    color: #fff;
    padding: 24px 0;
    z-index: 100;
}

.sidebar-logo { text-align: center; padding: 0 16px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo .icon { font-size: 36px; }
.sidebar-logo .name { font-size: 16px; font-weight: 700; margin-top: 4px; }
.sidebar-logo .sub { font-size: 11px; opacity: 0.6; }

.sidebar-nav { padding: 16px 0; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav a.active {
    background: rgba(212,168,83,0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.main-area {
    margin-left: 220px;
    padding: 24px 32px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.page-title { font-size: 22px; font-weight: 700; }
.page-title small { font-size: 13px; font-weight: 400; color: var(--text-light); margin-left: 8px; }

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}
.user-badge .logout {
    color: var(--red);
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.stat-card .num { font-size: 32px; font-weight: 700; }
.stat-card .num.green { color: var(--green); }
.stat-card .num.blue { color: var(--blue); }
.stat-card .num.gold { color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.chart-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.chart-card h3 { font-size: 15px; margin-bottom: 12px; }

/* ===== 表格 ===== */
.section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-group input, .filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    outline: none;
}
.filter-group button {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.table-wrap {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow-x: auto;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table th {
    background: rgba(212,168,83,0.08);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(212,168,83,0.08);
    vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover { background: rgba(212,168,83,0.04); }

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
}
.pagination button {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}
.pagination button:hover { background: var(--primary-light); }
.pagination .info { color: var(--text-light); }

/* ===== 编辑弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 640px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.modal h3 { font-size: 18px; margin-bottom: 16px; }

.modal .form-group {
    margin-bottom: 12px;
}
.modal .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.modal .form-group textarea { min-height: 60px; resize: vertical; }

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

.modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.modal .modal-actions .btn-primary {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.modal .modal-actions .btn-cancel {
    padding: 10px 24px;
    background: #eee;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* ===== 报告详情弹窗 ===== */
.report-detail .rd-item {
    margin-bottom: 14px;
}
.report-detail .rd-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 2px;
}
.report-detail .rd-value {
    font-size: 14px;
    line-height: 1.6;
}
.report-detail .rd-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

/* ===== 系统设置表单 ===== */
.settings-form { max-width: 500px; }
.settings-form .form-group { margin-bottom: 16px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo .name, .sidebar-logo .sub, .sidebar-nav a span { display: none; }
    .sidebar-nav a { padding: 12px; justify-content: center; font-size: 20px; }
    .main-area { margin-left: 60px; padding: 16px; }
    .chart-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .modal .form-row { grid-template-columns: 1fr; }
}

/* ===== Loading ===== */
.loading { text-align: center; padding: 40px; color: var(--text-light); }
.loading .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
