/* =========================================
   1. 核心变量 (黑金·星辰版)
   ========================================= */
:root {
    --bg-color: #050505;
    --surface-color: #141414;
    --gold-primary: #d4af37;
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f6e27a 40%, #c69c2e 80%, #d4af37 100%);
    --gold-text-gradient: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    --radius-lg: 16px;
    --shadow-card: 0 10px 30px -10px rgba(0,0,0,0.8);
    --safe-area-top: env(safe-area-inset-top);
}

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Didot", serif;
    margin: 0; padding: 0;
}

/* 星辰背景 */
#star-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: -1;
}
.star {
    position: absolute; background: #fff; border-radius: 50%; opacity: 0;
    box-shadow: 0 0 4px var(--gold-primary);
    animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* =========================================
   展示页专用样式
   ========================================= */
.hero-section {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    background: radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.08) 0%, rgba(5,5,5,0) 60%);
    text-align: center; padding: 40px 20px;
    min-height: 30vh; /* 稍微改矮 */
}

.brand-title {
    font-size: 12vw; font-weight: 900; margin: 0;
    text-transform: uppercase; letter-spacing: -2px;
    background: var(--gold-text-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite; position: relative;
}
@media (min-width: 768px) { .brand-title { font-size: 80px; } }

.brand-subtitle {
    margin-top: 20px; font-size: 14px; color: #888; letter-spacing: 2px;
}

/* 搜索框美化 */
.sc-search-container {
    position: sticky; top: 0; z-index: 100;
    background: rgba(5,5,5,0.8); backdrop-filter: blur(10px);
    padding: 15px 20px;
}
.sc-search-input {
    width: 100%; padding: 12px 20px; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05);
    color: #fff; font-size: 14px; outline: none; box-sizing: border-box;
    transition: all 0.3s;
}
.sc-search-input:focus {
    border-color: var(--gold-primary); background: #000;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

/* 展示卡片 */
.showcase-grid {
    padding: 20px; max-width: 800px; margin: 0 auto;
    /* 确保Grid能自适应 */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 瀑布流卡片 - 允许高度自由撑开 */
.sc-card {
    background: var(--surface-color); 
    border-radius: var(--radius-lg);
    overflow: hidden; 
    margin-bottom: 20px; /* 瀑布流需要垂直间距 */
    box-shadow: var(--shadow-card); 
    border: 1px solid rgba(255,255,255,0.05);
    break-inside: avoid; /* 关键：防止卡片在两列之间断开 */
    display: block; 
}
.sc-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent); opacity: 0.6;
    z-index: 2;
}

/* ★★★★★ 核心修改：图片展示框 (解决压缩问题) ★★★★★ */
.sc-img-box {
    width: 100%; 
    aspect-ratio: auto; /* 关键：取消固定比例 */
    height: auto;
    background: #000;
    display: block; 
}
.sc-img-box img {
    width: 100%; height: auto; display: block;
}
.sc-card:hover .sc-img-box img { transform: scale(1.05); }

.sc-info { padding: 18px 20px; }
.sc-title { margin: 0; font-size: 20px; color: #fff; font-weight: 700; margin-bottom: 8px;}
.sc-tag { 
    display: inline-block; font-size: 10px; padding: 2px 6px; 
    border-radius: 4px; background: rgba(255,255,255,0.1); color: #888; margin-right: 5px; 
}
.sc-desc { color: #888; font-size: 13px; margin-top: 10px; line-height: 1.5; }

/* 动画定义 */
@keyframes shine { to { background-position: 200% center; } }
@keyframes fadeInUp { from {opacity:0; transform:translateY(20px);} to {opacity:1; transform:translateY(0);} }

/* 库存管理界面的“设为封面”按钮 */
.btn-set-cover {
    background: transparent; border: 1px solid rgba(255,255,255,0.2);
    color: #aaa; padding: 4px 8px; border-radius: 4px; font-size: 10px;
    cursor: pointer; margin-left: auto;
}
.btn-set-cover:hover { border-color: var(--gold-primary); color: var(--gold-primary); }

/* ★★★★★ 新增：红色删除按钮 ★★★★★ */
.btn-icon-del {
    background: transparent;
    border: 1px solid rgba(255, 50, 50, 0.3);
    color: #ff4d4d;
    border-radius: 4px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-icon-del:hover {
    background: rgba(255, 50, 50, 0.2);
    border-color: #ff4d4d;
}

/* =========================================
   2. 视图切换逻辑
   ========================================= */
.view-section {
    display: none; 
    min-height: 100vh;
    padding-top: calc(20px + var(--safe-area-top));
    padding-bottom: calc(40px + var(--safe-area-bottom));
    animation: fadeIn 0.4s ease;
}
.view-section.active { display: block; }
@keyframes fadeIn { from {opacity:0; transform:translateY(10px);} to {opacity:1; transform:translateY(0);} }

/* =========================================
   3. 视图A: 员工管理中心 (Dashboard)
   ========================================= */
#view-dashboard.active {
    display: flex; 
    flex-direction: column;
    align-items: center; justify-content: center;
    height: 100vh; padding: 20px; box-sizing: border-box;
    background: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.05) 0%, rgba(0,0,0,0) 70%);
}

.dashboard-title {
    font-size: 28px; margin-bottom: 10px;
    background: var(--gold-text-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-transform: uppercase; letter-spacing: 2px; font-weight: 800;
}
.dashboard-sub { color: #666; font-size: 12px; margin-bottom: 60px; letter-spacing: 4px; text-transform: uppercase; }

.menu-grid {
    display: grid; grid-template-columns: 1fr; gap: 20px; width: 100%; max-width: 400px;
}
.menu-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 25px;
    display: flex; align-items: center; gap: 20px;
    transition: all 0.3s; cursor: pointer;
    backdrop-filter: blur(10px);
}
.menu-card:active { transform: scale(0.98); background: rgba(212, 175, 55, 0.05); border-color: var(--gold-primary); }
.menu-icon { font-size: 32px; filter: drop-shadow(0 0 10px rgba(255,215,0,0.3)); }
.menu-text h3 { margin: 0; font-size: 18px; color: #eee; }
.menu-text p { margin: 5px 0 0; font-size: 12px; color: #888; }

/* =========================================
   4. 视图B: 石材库管理
   ========================================= */
.inventory-header {
    padding: 0 20px; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.inventory-title { font-size: 24px; font-weight: bold; color: #fff; }

.manage-card {
    background: var(--surface-color); border-radius: 12px;
    overflow: hidden; margin-bottom: 0; 
    border: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column;
}
.manage-card .img-area {
    width: 100%; aspect-ratio: 1; position: relative;
}
.manage-card img { width: 100%; height: 100%; object-fit: cover; }

.manage-tools {
    padding: 10px; background: rgba(0,0,0,0.3);
    display: flex; justify-content: space-between; align-items: center;
}

/* 开关组件 */
.switch-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aaa; }
.toggle-switch {
    position: relative; display: inline-block; width: 36px; height: 20px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--gold-primary); }
input:checked + .slider:before { transform: translateX(16px); }

/* 时间轴样式优化 */
.time-group { padding: 0 20px; margin-bottom: 30px; }
.time-header {
    color: var(--gold-primary); font-size: 12px; margin-bottom: 12px;
    display: flex; align-items: center; font-weight: bold; letter-spacing: 1px;
}
.time-header::after { content:""; flex:1; height:1px; background:rgba(255,255,255,0.1); margin-left:10px;}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 批量上传按钮固定底部 */
.fab-upload {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--gold-gradient); color: #000;
    padding: 12px 30px; border-radius: 50px; font-weight: bold;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    border: none; z-index: 100; cursor: pointer; display: flex; align-items: center; gap: 8px;
}

/* =========================================
   5. 视图C: 展示页 (Iframe等其他容器)
   ========================================= */
#view-showcase { padding: 0; }

/* =========================================
   6. 编辑弹窗 (Modal)
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    z-index: 3000; display: none; opacity: 0; transition: opacity 0.3s;
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; opacity: 1; }

.modal-content {
    background: #141414; border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px; padding: 25px; width: 85%; max-width: 340px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; flex-direction: column; gap: 15px;
}
.modal-overlay.open .modal-content { transform: scale(1); }

.modal-img-wrapper {
    width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1); position: relative;
}
.modal-img-preview {
    width: 100%; height: 100%; object-fit: cover;
}

.modal-input-group { position: relative; }
.modal-input {
    width: 100%; background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--gold-primary); padding: 12px; border-radius: 10px;
    font-size: 16px; box-sizing: border-box; outline: none; text-align: center;
    transition: all 0.3s;
}
.modal-input:focus { 
    border-color: var(--gold-primary); background: rgba(0,0,0,0.5); 
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 5px; }
.btn-danger {
    background: rgba(255, 50, 50, 0.08); color: #ff4d4d; 
    border: 1px solid rgba(255, 50, 50, 0.2);
    padding: 12px; border-radius: 50px; font-weight: bold; cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:active { background: rgba(255, 50, 50, 0.2); transform: scale(0.95); }

.btn-save {
    background: var(--gold-gradient); color: #000; border: none;
    padding: 12px; border-radius: 50px; font-weight: bold; cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    transition: all 0.2s;
}
.btn-save:active { transform: scale(0.95); }
.btn-close-text {
    text-align: center; color: #666; font-size: 13px; cursor: pointer; padding: 5px;
}

/* =========================================
   7. 分类 & Tab 样式
   ========================================= */
.inv-tabs {
    display: flex; gap: 20px; padding: 0 20px; margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.inv-tab {
    padding: 10px 0; color: #666; font-size: 16px; font-weight: bold; cursor: pointer;
    position: relative;
}
.inv-tab.active { color: var(--gold-primary); }
.inv-tab.active::after {
    content: ""; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px;
    background: var(--gold-primary); box-shadow: 0 -2px 10px var(--gold-primary);
}

.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

/* 文件夹网格 */
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 0 20px; }
.cat-card {
    background: rgba(255,255,255,0.05); 
    border-radius: 12px; padding: 15px;
    text-align: center; border: 1px solid rgba(255,255,255,0.05); 
    cursor: pointer; transition: all 0.2s;
    overflow: hidden; 
}
.cat-icon-box {
    width: 100%;
    aspect-ratio: 4/3; /* 长方形封面 */
    margin-bottom: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cat-cover-img { width: 100%; height: 100%; object-fit: cover; }
.cat-card:active { transform: scale(0.95); background: rgba(212,175,55,0.1); }
.cat-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.cat-name { font-weight: bold; color: #fff; }
.cat-count { font-size: 12px; color: #666; margin-top: 5px; }

/* 小按钮 */
.btn-small-gold {
    background: var(--gold-gradient); border: none; padding: 5px 12px;
    border-radius: 4px; font-size: 12px; font-weight: bold; color: #000;
}
.btn-text { background: none; border: none; color: #888; font-size: 14px; }

/* 选择器网格 */
.sel-item { position: relative; aspect-ratio: 1; border: 2px solid transparent; }
.sel-item img { width: 100%; height: 100%; object-fit: cover; }
.sel-item.selected { border-color: var(--gold-primary); }
.sel-item.selected::after {
    content: "✔"; position: absolute; top: 2px; right: 2px;
    background: var(--gold-primary); color: #000; width: 16px; height: 16px;
    border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* =========================================
   Showcase 分类卡片样式 (新)
   ========================================= */
/* 一级：分类墙（瀑布流） */
.sc-cat-wall{
  width: 100%;
  max-width: 1400px;     /* 你想更宽就调大或直接 none */
  margin: 0 auto;
  column-width: 420px;   /* 每列理想宽度：越大图越大 */
  column-gap: 22px;
}

/* 每张分类卡：必须 inline-block 才能参与 columns */
.sc-cat-card{
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
}

/* 分类封面：不要固定高度，不要 aspect-ratio，保持大图自然高度 */
.sc-cat-card img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

/* 移动端列宽小一点 */
@media (max-width: 900px){
  .sc-cat-wall{ column-width: 260px; }
}
.sc-cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-primary);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.2);
}
.sc-cat-bg {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s;
}
.sc-cat-card:hover .sc-cat-bg { transform: scale(1.1); }
.sc-cat-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
    display: flex; flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}
.sc-cat-name {
    font-size: 24px; font-weight: bold; color: #fff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sc-cat-meta {
    font-size: 12px; color: var(--gold-primary);
    margin-bottom: 10px;
}
.sc-cat-btn {
    font-size: 12px; color: #aaa;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
    display: flex; justify-content: space-between;
}
.sc-cat-card:hover .sc-cat-btn { color: #fff; }

/* =========================================
   新增：批量选择 & 底部栏样式
   ========================================= */

/* 底部浮动操作栏 */
.fab-bar {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold-primary);
    border-radius: 50px;
    padding: 10px 20px;
    display: flex; align-items: center; gap: 20px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    animation: fadeInUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-count { font-weight: bold; color: var(--gold-primary); font-size: 14px; min-width: 60px; }
.fab-actions { display: flex; gap: 10px; }

/* 批量删除的小红按钮 */
.btn-danger-small {
    background: #500; color: #ffcccc; border: none;
    padding: 5px 12px; border-radius: 4px; font-size: 12px; cursor: pointer;
}

/* 选中态的卡片样式 */
.manage-card.selected {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px var(--gold-primary);
}

/* 选中时的遮罩层 */
.select-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: none; /* 让点击穿透，或者由JS控制 */
    display: flex; align-items: center; justify-content: center;
}
.select-overlay.checked::after {
    content: "✔";
    font-size: 32px; color: var(--gold-primary);
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    animation: zoomIn 0.2s;
}
@keyframes zoomIn { from {transform:scale(0);} to {transform:scale(1);} }


/* =========================================
   新增：分类卡片上的删除按钮
   ========================================= */
.cat-card { position: relative; } /* 确保定位准确 */

.cat-del-btn {
    position: absolute; top: 5px; right: 5px;
    width: 24px; height: 24px;
    background: rgba(0,0,0,0.6);
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; z-index: 5;
    transition: all 0.2s;
}
.cat-del-btn:hover {
    background: #d00; transform: scale(1.1);
}

/* 优化一下 Header 里的按钮 */
.btn-text { cursor: pointer; font-weight: bold; transition: color 0.3s; }

@media (max-width: 600px) {
    .sc-cat-card { height: 160px; }
    .sc-cat-name { font-size: 18px; }
}

/* =========================================
   新布局支持 (Masonry & Album)
   ========================================= */

/* 1. 瀑布流容器 */
.masonry-container {
    column-count: 2; column-gap: 15px;
    padding: 20px; max-width: 1000px; margin: 0 auto;
}
@media (min-width: 768px) { .masonry-container { column-count: 3; } }

/* 2. 库存相册网格 (仿 iOS 相册) */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
    gap: 3px; padding: 0 5px 100px 5px;
}
.album-card {
    position: relative; aspect-ratio: 1; background: #222; overflow: hidden; cursor: pointer;
}
.album-card img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.album-card.selected img { transform: scale(0.9); }
.album-card.selected::after {
    content: "✔"; position: absolute; bottom: 5px; right: 5px;
    background: var(--gold-primary); color: #000; width: 20px; height: 20px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold;
}
/* 状态角标 */
.badge-showcased {
    position: absolute; top: 4px; right: 4px;
    color: var(--gold-primary); font-size: 12px; text-shadow: 0 1px 2px #000;
}

/* =========================================
   PATCH:V5 版本标识 & UI 修复
   ========================================= */

/* 石材库：左上返回 + 右上切换固定 */
#view-inventory .btn-back{
  position: fixed;
  top: calc(14px + var(--safe-area-top));
  left: 14px;
  z-index: 30;
}
#view-inventory .inv-tabs{
  position: fixed;
  top: calc(14px + var(--safe-area-top));
  right: 14px;
  z-index: 30;
  margin: 0;
  padding: 6px;
  gap: 6px;
  border-bottom: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
}
#view-inventory .inv-tab{
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}
#view-inventory .inv-tab.active{
  color: #000;
  background: var(--gold-gradient);
}
#view-inventory .inv-tab.active::after{ display:none; }

/* 给 inventory 内容让出顶部空间，避免被固定按钮遮挡 */
#view-inventory .tab-content{
  padding-top: 64px;
}

/* viewer modal（分类内点图查看信息/操作） */
.viewer-content{
  max-width: 420px;
}
.viewer-meta{
  padding: 12px 4px 0;
}
.viewer-name{
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.viewer-info{
  margin-top: 6px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  line-height: 1.4;
}


/* PATCH:V6 — Showcase 一级改为大图瀑布流 + 返回中控按钮美化 */
/* Showcase 一级：分类瀑布流（大图） */
.sc-cat-masonry{
  column-count: 1;
  column-gap: 16px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 700px){ .sc-cat-masonry{ column-count: 2; } }
@media (min-width: 1100px){ .sc-cat-masonry{ column-count: 3; } }

.sc-cat-card{
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  background: rgba(0,0,0,0.25);
  position: relative;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.sc-cat-card:hover{
  transform: translateY(-4px);
  border-color: var(--gold-primary);
  box-shadow: 0 14px 34px rgba(0,0,0,0.65);
}
.sc-cat-img{
  width: 100%;
  height: auto;
  display: block;
}
.sc-cat-placeholder{
  width: 100%;
  height: 260px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.10), rgba(0,0,0,0.55)),
              linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.65));
}
.sc-cat-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.80), rgba(0,0,0,0.12) 55%, rgba(0,0,0,0.02));
}
.sc-cat-name{
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}
.sc-cat-meta{
  margin-top: 6px;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
}
.sc-cat-btn{
  margin-top: 12px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 13px;
}
.sc-cat-card:hover .sc-cat-btn{
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* 返回中控按钮（统一高级玻璃态） */
.btn-back{
  position: fixed;
  top: calc(14px + var(--safe-area-top));
  left: 14px;
  z-index: 30;

  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(10,10,15,0.55);
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  letter-spacing: 0.2px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.55);
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn-back:hover{
  border-color: var(--gold-primary);
  background: rgba(10,10,15,0.62);
}
.btn-back:active{
  transform: translateY(1px) scale(0.99);
}


/* =========================================
   8. 数据中心 (Analytics) 样式
   ========================================= */
.an-section { margin-bottom: 40px; animation: fadeInUp 0.5s; }
.an-title {
    font-size: 18px; color: var(--gold-primary); 
    border-left: 3px solid var(--gold-primary);
    padding-left: 10px; margin-bottom: 20px;
}

/* 4列数据网格 */
.an-grid-4 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}
.an-grid-3 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* 数据卡片 */
.an-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 20px;
    display: flex; flex-direction: column; justify-content: center;
}
.rank-card { justify-content: flex-start; min-height: 200px; }
.rank-card h3 { margin: 0 0 15px 0; font-size: 16px; color: #ddd; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;}

.an-num { font-size: 32px; font-weight: bold; color: #fff; margin-bottom: 5px; }
.an-num.warn { color: #ff4d4d; }
.an-label { font-size: 12px; color: #888; }

/* 进度条 */
.an-progress {
    width: 100%; height: 4px; background: rgba(255,255,255,0.1);
    border-radius: 2px; margin-top: 10px; overflow: hidden;
}
.an-progress div {
    height: 100%; background: var(--gold-primary);
    border-radius: 2px;
}

/* 排行榜列表 */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: flex; align-items: center; font-size: 14px; }
.rank-idx {
    width: 20px; height: 20px; background: rgba(255,255,255,0.1);
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    font-size: 12px; margin-right: 10px; color: #aaa;
}
/* 前三名高亮 */
.rank-idx.r-1 { background: var(--gold-primary); color: #000; font-weight: bold; }
.rank-idx.r-2 { background: rgba(212, 175, 55, 0.6); color: #000; }
.rank-idx.r-3 { background: rgba(212, 175, 55, 0.3); color: #fff; }

.rank-name { flex: 1; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { color: var(--gold-primary); font-weight: bold; font-family: monospace; }



/* =========================================
   9. 数据中心 - 访问列表样式
   ========================================= */

/* 顶部标题栏 + Tab 的布局 */
.an-header-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px; margin-top: 40px;
}
.an-tabs {
    display: flex; gap: 5px; background: rgba(0,0,0,0.3); 
    padding: 4px; border-radius: 8px;
}
.an-tab {
    background: transparent; border: none; color: #666;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
    font-size: 12px; font-weight: bold; transition: all 0.2s;
}
.an-tab.active {
    background: var(--gold-primary); color: #000;
}

/* 访问日志列表容器 */
.log-card {
    padding: 0; max-height: 400px; overflow-y: auto; /* 允许滚动 */
}
.log-list {
    display: flex; flex-direction: column;
}
.log-row {
    display: flex; align-items: center; gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: rgba(255,255,255,0.02); }

.log-time {
    font-family: monospace; color: #888; font-size: 12px;
    min-width: 80px;
}
.log-icon { font-size: 16px; }
.log-detail { font-size: 13px; color: #aaa; flex: 1; }


