/* =====================================================================
   全局样式表：数据看板（新项目）
   设计规则：
     - 全部列：左对齐
     - Tailwind CDN（index.html 引入） + 本地补充样式
     - KPI卡、表格、Modal、趋势浮层

   浏览器兼容性：
     - .filter-btn-toggle:has(input:checked) 需要 Chrome 105+ / Safari 15.4+ / Firefox 121+
     - backdrop-filter 已在所有位置添加 -webkit- 前缀兼容 Safari
     - clamp() / CSS Grid / Flexbox 为现代浏览器通用特性
===================================================================== */

/* ── 页面基础 ─────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    background-color: #f8fafc;
    font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: clamp(12px, 2vw, 20px) clamp(12px, 2.5vw, 40px);
    color: #1e293b;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── 筛选行（第一行）────────────────────────────────────────────────── */
.filter-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.filter-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: clamp(12px, 1.2vw, 14px);
    font-weight: 500;
    color: #334155;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    min-width: clamp(120px, 13vw, 160px);
}

.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-btn-query {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn-query:hover { background-color: #2563eb; }
.filter-btn-query:active { transform: scale(0.98); }

/* 专辑搜索：与旧版数据看板一致（输入 + 搜索 + 清除） */
.filter-item-search {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 420px;
}

.filter-search-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #334155;
    background: #fff;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

.filter-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-search-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-btn-search {
    background: #fff;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.filter-btn-search:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.filter-btn-search.filter-btn-active {
    border-color: #3b82f6;
    color: #1d4ed8;
    background: #eff6ff;
}

.filter-btn-clear {
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.filter-btn-clear:hover {
    background: #fef2f2;
}

.filter-btn-clear.filter-btn-active {
    border-color: #ef4444;
    background: #fef2f2;
}

/* 搜索命中行高亮（对齐旧版 Vue 数据看板） */
.search-match {
    background-color: #fff3cd !important;
    font-weight: 700;
    color: #856404 !important;
    box-shadow: inset 0 0 0 2px #ffeaa7;
}

.search-match td {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

@keyframes search-match-pulse {
    0%, 100% { box-shadow: inset 0 0 0 2px #ffeaa7; }
    50% { box-shadow: inset 0 0 0 2px #f59e0b; }
}

.search-match.search-match-pulse {
    animation: search-match-pulse 0.8s ease-in-out 2;
}

/* 良品行：绿色背景标注（isGoodAlbum=true） */
/* 搜索命中的良品行：保持黄色，忽略绿色背景 */
.search-match.is-good-album,
.search-match.is-good-album td {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

.is-good-album {
    background-color: #f0fdf4 !important;
}
.is-good-album td {
    background-color: #f0fdf4 !important;
    color: #15803d !important;
}
.is-good-album:hover td {
    background-color: #dcfce7 !important;
}

/* 下架专辑：勾选「包含下架」时名字灰掉处理 */
.offline-name {
    color: #94a3b8 !important;
}

/* 良品 Top10 🔥标识 */
.fire-icon {
    margin-right: 4px;
    cursor: help;
}

/* 良品 🏆标识 — 固定宽度版本 */
.trophy-icon-fixed {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    vertical-align: middle;
    cursor: help;
    margin-right: 4px;
}

/* 良品 🏆标识 — 旧版（保留兼容） */
.trophy-icon {
    margin-right: 4px;
    cursor: help;
    display: inline-block;
    vertical-align: middle;
}

/* 专辑名称单元格：左对齐（不含内边距，以便与带🏆的列对齐） */
.name-cell {
    text-align: left;
    padding-left: 0;
    min-width: 200px;
}

/* 统一筛选切换按钮样式（两个复选框共用） */
.filter-item-offline,
.filter-item-clips {
    flex-shrink: 0;
    align-self: flex-end;
}

.filter-btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 38px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn-toggle:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.filter-btn-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 复选框图标：未选中显示空框，已选中显示 ✅ 字符 */
.filter-checkbox-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    background: white;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* 用伪元素显示 ✅，刚好填满方框 */
.filter-checkbox-icon::before {
    content: '✅';
    font-size: 12px;
    line-height: 1;
    color: transparent;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: color 0.15s;
}

/* 选中时显示 ✅ */
.filter-btn-offline:has(input:checked) .filter-checkbox-icon::before,
.filter-btn-clips:has(input:checked) .filter-checkbox-icon::before {
    color: #15803d;
}

/* 旧样式兼容（保留旧 class 名） */
.filter-btn-offline,
.filter-btn-clips {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 38px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn-offline:hover,
.filter-btn-clips:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.filter-btn-offline input[type="checkbox"],
.filter-btn-clips input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ── Tab 切换栏 ─────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    padding: 0 20px;
}

.tab-btn {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #334155;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ── 专辑管理工具栏 ──────────────────────────────────────────────── */
.album-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 0 20px 16px;
}

.album-search-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.album-action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-new {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-new:hover {
    background: #1d4ed8;
}

.btn-import {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-import:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-import-select {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-import-select:hover {
    background: #dbeafe;
}

.import-channel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.import-channel-row:last-of-type {
    border-bottom: none;
}
.import-channel-label {
    width: 52px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    flex-shrink: 0;
}
.import-file-names {
    flex: 1;
    font-size: 12px;
    color: #94a3b8;
    min-height: 20px;
    word-break: break-all;
    line-height: 1.5;
}

.btn-back {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-back:hover {
    background: #e2e8f0;
}

/* ── 专辑列表 ────────────────────────────────────────────────────── */
.album-table th:first-child { text-align: left; }
.album-table th:last-child  { width: 120px; text-align: center; }
.album-table td:last-child  { text-align: center; }
/* 序号列样式 */
.album-table td:first-child { text-align: center; color: #94a3b8; font-weight: 600; font-size: 12px; width: 60px; }
/* 专辑名称列（第二列）恢复宽度 */
.album-table td:nth-child(2) { max-width: clamp(140px, 18vw, 240px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-edit {
    padding: 4px 10px;
    font-size: 13px;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 4px;
    transition: background 0.15s;
}

.btn-edit:hover { background: #dcfce7; }

.btn-delete {
    padding: 4px 10px;
    font-size: 13px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-delete:hover { background: #fee2e2; }

/* ── 分页 ────────────────────────────────────────────────────────── */
.album-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    padding: 16px 20px;
}

.page-btn {
    padding: 6px 16px;
    font-size: 14px;
    color: #475569;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
}

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

.page-btn:not(:disabled):hover {
    background: #f1f5f9;
}

/* ── 专辑表单弹窗 ────────────────────────────────────────────────── */
.album-modal-box {
    max-width: min(580px, 92vw);
}

.album-modal-box .modal-body {
    padding: clamp(12px, 2vw, 24px);
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.form-label {
    flex: 0 0 clamp(80px, 10vw, 100px);
    font-size: clamp(12px, 1.1vw, 14px);
    font-weight: 600;
    color: #374151;
    text-align: right;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-input,
.form-select {
    flex: 1;
    max-width: 360px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.btn-primary {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-cancel {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
}

.btn-cancel:hover { background: #e2e8f0; }

.btn-danger {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #dc2626;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-danger:hover { background: #b91c1c; }

/* ── KPI 四卡（第二行）──────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #cbd5e1;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.kpi-card.blue   { border-left-color: #3b82f6; }
.kpi-card.indigo { border-left-color: #6366f1; }
.kpi-card.purple { border-left-color: #8b5cf6; }
.kpi-card.dark   { background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%); color: white; border-left-color: #60a5fa; }

.kpi-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.kpi-card.dark .kpi-title { color: #bfdbfe; }

.kpi-value {
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}

.kpi-card.dark .kpi-value { color: white; }

/* KPI3 良品率：右侧追加达标标签 */
.kpi-rate-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.tag-pass {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.tag-fail {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

/* KPI4 说明文字 */
.kpi-desc {
    font-size: 10px;
    line-height: 1.45;
    color: #cbd5e1;
}

.kpi-card.dark .kpi-desc { color: #bfdbfe; }

/* 良品表现分析视角的"合格标准说明"标签 */
.kpi-desc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #93c5fd;
    margin-bottom: 6px;
}

/* ── 表格区（第三行）────────────────────────────────────────────────── */
.table-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

/* 表格横向滚动（支持小屏和宽表格） */
.table-container {
    display: flex;
    flex-direction: column;
}

.table-container > .data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.table-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.table-btn-detail {
    background: white;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.table-btn-detail:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

/* 通用数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;       /* 自动均分列宽（配合 min-width 小屏横向滚动） */
    min-width: 600px;           /* 小屏时强制出现横向滚动 */
}

/* 各列宽度（让浏览器自动均分，min-width 保小屏滚动） */
.data-table colgroup col.rank    { width: 8%;  }
.data-table colgroup col.name    { min-width: 20%; }
.data-table colgroup col.heat    { min-width: 12%; }
.data-table colgroup col.misc    { min-width: 10%; }
.data-table colgroup col.ch      { min-width: 12%; }
.data-table colgroup col.trend   { min-width: 12%; }

.data-table thead {
    background: #f1f5f9;
}

.data-table th {
    padding: 10px 16px;
    text-align: left;          /* 全部左对齐 */
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 10px 16px;
    text-align: left;          /* 全部左对齐 */
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    overflow: hidden;           /* 溢出隐藏 */
    text-overflow: ellipsis;    /* 文字截断（仅在内容超出时生效） */
    white-space: nowrap;        /* 不换行 */
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 排名列：数字左对齐，灰色小字 */
.rank-cell {
    color: #94a3b8;
    font-weight: 600;
    font-size: 12px;
}

/* 产品名称：加粗深色 */
.name-cell {
    font-weight: 700;
    color: #1e293b;
}

/* 趋势图按钮 */
.trend-btn {
    color: #3b82f6;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.trend-btn:hover {
    background-color: #eff6ff;
}

/* 暂无数据 */
.empty-cell {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
    font-size: 13px;
}

/* ── Modal 全量排名弹窗 ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal-overlay.open { display: flex; }

.modal-box {
    background: white;
    border-radius: 16px;
    width: 90vw;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.modal-btn-close {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-btn-close:hover { background: #f1f5f9; color: #1e293b; }

.modal-body {
    overflow-y: auto;
    flex: 1;
    overflow-x: auto;          /* 横向滚动 */
    -webkit-overflow-scrolling: touch;
}

/* ── 详情全部排名表格滚动容器 & 表头固定 ───────────────────────────── */
.modal-table-wrapper {
    overflow-y: auto;
    max-height: calc(85vh - 80px); /* 减去 modal-header 高度 */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-table-wrapper table.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ── 趋势图浮层 ────────────────────────────────────────────────────── */
.chart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.chart-overlay.open { display: flex; }

/* 趋势弹窗：约等于 KPI 三卡宽度、大半屏高度（与用户标注红框区域一致） */
.chart-box {
    background: white;
    border-radius: 16px;
    padding: 18px 22px 22px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(1320px, 78vw);
    height: 68vh;
    max-height: 68vh;
    min-height: 480px;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.chart-close {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.chart-close:hover { background: #e2e8f0; color: #1e293b; }

#trendChart {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0; /* 占满 .chart-box 除标题外的剩余高度 */
}

/* 小屏仍保证图表可读 */
@media (max-width: 768px) {
    .chart-box {
        width: 94vw;
        height: min(70vh, 620px);
        max-height: 70vh;
    }
}

/* ── 加载状态 ──────────────────────────────────────────────────────── */
.loading-row td {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
    font-size: 13px;
}

/* ── 响应式：中屏（笔记本 1200px / 1024px） ───────────────────── */
@media (max-width: 1200px) {
    .kpi-grid { gap: 12px; }
    .filter-box { gap: 12px; padding: clamp(12px, 1.5vw, 20px); }
    .filter-label { font-size: clamp(10px, 0.9vw, 11px); }
    .album-table td:first-child { text-align: center; color: #94a3b8; font-weight: 600; font-size: 12px; width: 60px; }
    .album-table td:nth-child(2) { max-width: clamp(120px, 16vw, 200px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── 响应式：小屏（平板 768px） ───────────────────────────────── */
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-box { flex-direction: column; align-items: stretch; gap: 10px; }
    .filter-select { min-width: unset; width: 100%; }
    .form-row { flex-wrap: wrap; }
    .form-label { flex: 0 0 80px; }
    .form-input, .form-select { max-width: 100%; width: 100%; }
    .album-modal-box .modal-body { padding: 12px; }
    .chart-box {
        width: 94vw;
        height: min(70vh, 620px);
        max-height: 70vh;
    }
}

/* ── 响应式：超小屏（手机 480px） ─────────────────────────────── */
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-value { font-size: clamp(20px, 5vw, 28px); }
    .album-table td:first-child { text-align: center; color: #94a3b8; font-weight: 600; font-size: 12px; width: 60px; }
}

/* ── 右上角用户头像区域 ───────────────────────────────────────────── */
.user-avatar-wrapper {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #E85A24);
    border: 2px solid rgba(255,255,255,0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255,107,53,0.35);
}

.user-avatar-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(255,107,53,0.45);
}

.user-avatar-btn svg { width: 18px; height: 18px; }

/* ── 头像下拉菜单 ────────────────────────────────────────────── */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14);
    border: 1px solid #f1f5f9;
    min-width: 200px;
    display: none;
    z-index: 9999;
    overflow: hidden;
    animation: fadeInDown 0.18s ease-out;
}

.user-dropdown.open { display: block; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 14px 20px;
    background: #fff8f5;
}

.dropdown-username {
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
}

.dropdown-divider {
    height: 1px;
    background: #f1f5f9;
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    transition: all 0.15s;
    text-align: left;
}

.dropdown-item:hover {
    background: #fff8f5;
    color: #E85A24;
}

/* ── 账号管理弹窗内部样式 ─────────────────────────────────────── */
.manage-users-toolbar {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 10px;
    align-items: center;
}

.manage-users-search {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.manage-users-search:focus {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.manage-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.manage-users-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.manage-users-table th:nth-child(1) { min-width: 100px; }
.manage-users-table th:nth-child(2) { min-width: 80px; text-align: center; }
.manage-users-table th:nth-child(3) { min-width: 140px; }
.manage-users-table th:nth-child(4) { min-width: 160px; }
.manage-users-table th:nth-child(5) { min-width: 70px; text-align: center; }

.manage-users-table td {
    padding: 10px 16px;
    color: #334155;
    border-bottom: 1px solid #f8fafc;
    word-break: keep-all;
    white-space: nowrap;
}

.manage-users-table td:nth-child(1) { min-width: 100px; }
.manage-users-table td:nth-child(2) { min-width: 80px; text-align: center; }
.manage-users-table td:nth-child(3) { min-width: 140px; }
.manage-users-table td:nth-child(4) { min-width: 160px; }
.manage-users-table td:nth-child(5) { min-width: 70px; text-align: center; }

.manage-users-table tbody tr:hover td {
    background: #fff8f5;
}

.manage-users-empty {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
    font-size: 14px;
}

.add-user-row {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: block;
}

.add-user-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.add-user-fields .form-input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
    min-width: 0;
}

.add-user-fields .form-input:focus {
    border-color: #FF6B35;
}

.add-user-remark-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.add-user-actions {
    display: flex;
    gap: 8px;
}

.add-user-row .form-input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
}

.add-user-row .form-input:focus {
    border-color: #FF6B35;
}

/* 账号表格单元格 */
.user-name-cell {
    font-weight: 600;
    color: #1e293b;
}

.remark-cell {
    cursor: pointer;
}

.remark-cell .remark-placeholder {
    color: #94a3b8;
}

.remark-cell .remark-fixed {
    color: #94a3b8;
}

/* 备注编辑输入框 */
.remark-edit-input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #6366f1;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

/* 角色标签 */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.role-badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-badge-editor {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge-viewer {
    background: #f1f5f9;
    color: #64748b;
}

/* 角色下拉选择器 */
.role-select {
    padding: 3px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    color: #334155;
    outline: none;
    transition: border-color 0.2s;
}

.role-select:focus {
    border-color: #FF6B35;
}

/* 删除按钮 */
.btn-delete-user {
    padding: 4px 10px;
    background: #fff;
    color: #ef4444;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-delete-user:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* ── 搜索建议下拉框（白色主题）─────────────────────────────────── */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #374151;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #3b82f6;
    color: #ffffff;
}

/* ── 1s未找到弹窗（白色小弹窗）────────────────────────────────── */
.search-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    color: #374151;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-toast.show {
    opacity: 1;
}

    padding: 4px 10px;
    background: #fff;
    color: #ef4444;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-delete-user:hover {
    background: #fef2f2;
    border-color: #ef4444;
}
