/* ===================================================================== */
/* 壹点 SelfStart · 管理后台 - 公共样式                                   */
/* 所有后台页面共享此文件，保持风格统一                                  */
/* ===================================================================== */

* { box-sizing: border-box; }
body { margin: 0; font-family: 'DM Sans', 'Noto Sans SC', sans-serif; background: #FFF6EC; }

/* ============ 侧边栏 ============ */
.sidebar { width: 230px; background: linear-gradient(180deg, #2D2A26 0%, #1D1710 100%); min-height: 100vh; position: fixed; left: 0; top: 0; color: #fff; z-index: 1000; display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(45,42,38,0.15); }
.sidebar .logo { padding: 24px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar .logo .logo-icon { width: 44px; height: 44px; margin: 0 auto 10px; background: #fff; border: 1px solid rgba(255,140,66,0.35); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; }
.sidebar .logo h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.1em; margin: 0; font-family: 'Outfit', sans-serif; }
.sidebar .logo p { font-size: 10px; color: rgba(255,179,102,0.55); letter-spacing: 0.2em; margin: 4px 0 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 13px 24px; color: rgba(255,255,255,0.6); text-decoration: none; transition: all 0.2s; font-size: 14px; border-left: 3px solid transparent; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: #FF8C42; }
.nav-item i { font-size: 18px; width: 20px; text-align: center; transition: transform 0.3s; }
.nav-item:hover i { transform: scale(1.2); }
.nav-item.active::after { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: #FF8C42; border-radius: 3px 0 0 3px; animation: slideIn 0.3s ease; }
.nav-section { padding: 16px 24px 6px; font-size: 10px; color: rgba(255,255,255,0.3); letter-spacing: 0.15em; text-transform: uppercase; }
.nav-logout { margin-top: auto; color: rgba(255,255,255,0.4) !important; border-top: 1px solid rgba(255,255,255,0.08); }
.nav-logout:hover { color: #ef4444 !important; background: rgba(239,68,68,0.08) !important; }
@keyframes slideIn { from { height: 0; opacity: 0; } to { height: 60%; opacity: 1; } }

/* ============ 主区域 ============ */
.main { margin-left: 230px; padding: 24px; min-height: 100vh; }

/* ============ 顶部栏 ============ */
.topbar { background: #fff; border-radius: 14px; padding: 18px 28px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 12px rgba(45,42,38,0.05); }
.topbar h2 { font-size: 20px; font-weight: 600; color: #2D2A26; margin: 0; }
.topbar .sub { font-size: 12px; color: #A79B8E; margin-top: 2px; }

/* ============ 卡片通用 ============ */
.card { background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 2px 12px rgba(45,42,38,0.05); transition: box-shadow 0.3s; }
.card:hover { box-shadow: 0 8px 30px rgba(45,42,38,0.1); }
.card-title { font-size: 15px; font-weight: 600; color: #2D2A26; margin: 0 0 20px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 12px; color: #FF8C42; cursor: pointer; }

/* ============ 统计卡 ============ */
.stat { background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 2px 12px rgba(45,42,38,0.05); position: relative; overflow: hidden; transition: transform 0.2s; }
.stat:hover { transform: translateY(-2px); }
.stat::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,140,66,0.08), transparent); transition: left 0.6s; }
.stat:hover::before { left: 100%; }
.stat .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.stat:hover .stat-icon { transform: scale(1.15) rotate(-5deg); }
.stat .stat-num { font-size: 30px; font-weight: 700; color: #2D2A26; font-family: 'Outfit', sans-serif; line-height: 1; }
.stat .stat-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.stat .stat-label { font-size: 13px; color: #A79B8E; }
.stat .stat-trend { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.stat .trend-up { color: #22c55e; }
.stat .trend-down { color: #ef4444; }
.stat .deco { position: absolute; right: -10px; bottom: -10px; font-size: 80px; opacity: 0.04; animation: floatBg 6s ease-in-out infinite; }

/* ============ 表格 ============ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; color: #A79B8E; font-weight: 500; padding: 10px 12px; border-bottom: 2px solid #FFF5E6; white-space: nowrap; }
.data-table td { padding: 12px; font-size: 13px; color: #2D2A26; border-bottom: 1px solid #FFFBF5; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { position: relative; transition: all 0.2s; }
.data-table tbody tr:hover td { background: #FFF8F0; }
.data-table tbody tr td:first-child { position: relative; }
.data-table tbody tr td:first-child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #FF8C42; transform: scaleY(0); transition: transform 0.2s; border-radius: 0 3px 3px 0; }
.data-table tbody tr:hover td:first-child::before { transform: scaleY(1); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: #FF8C42; border-radius: 2px; }

/* ============ 状态标签 ============ */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-done { background: #D1FAE5; color: #065F46; }
.badge-cancel { background: #FEE2E2; color: #991B1B; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-inactive { background: #F3F4F6; color: #6B7280; }
.badge-gold { background: #FEF3C7; color: #92400E; }

/* ============ 排行列表 ============ */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #FFFBF5; }
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rank-1 { background: #2D2A26; color: #fff; }
.rank-2 { background: #8B7E74; color: #fff; }
.rank-3 { background: #FF8C42; color: #fff; }
.rank-other { background: #FFF5E6; color: #A79B8E; }
.rank-bar { flex: 1; height: 6px; background: #FFF5E6; border-radius: 3px; overflow: hidden; }
.rank-bar-fill { height: 100%; background: linear-gradient(90deg, #FF8C42, #8B7E74); border-radius: 3px; width: 0 !important; transition: width 1.2s cubic-bezier(0.22,1,0.36,1); }

/* ============ 待办 ============ */
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #FFFBF5; transition: all 0.2s; cursor: pointer; padding-left: 4px; }
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { padding-left: 12px; background: #FFF8F0; border-radius: 8px; }
.todo-item.completed .todo-text { text-decoration: line-through; opacity: 0.5; }
.todo-item.completed .todo-dot { background: #ccc !important; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.todo-text { flex: 1; font-size: 13px; color: #2D2A26; }
.todo-count { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }

/* ============ 搜索框 & 头像 ============ */
.search-box { background: #FFFBF5; border: 1px solid #FFE4C4; border-radius: 10px; padding: 8px 16px; display: flex; align-items: center; gap: 8px; }
.search-box input { border: none; background: transparent; outline: none; font-size: 13px; width: 160px; }
.admin-avatar { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #2D2A26, #8B7E74); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; background: #FFF5E6; border: none; align-items: center; justify-content: center; cursor: pointer; color: #2D2A26; font-size: 20px; flex-shrink: 0; }

/* ============ 按钮 ============ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-brand { background: #2D2A26; color: #fff; }
.btn-brand:hover { background: #8B7E74; }
.btn-brand:active { transform: scale(0.96); }
.btn-gold { background: #FF8C42; color: #fff; }
.btn-gold:hover { background: #E8702A; }
.btn-outline { background: #fff; color: #2D2A26; border: 1px solid #FFE4C4; }
.btn-outline:hover { background: #FFFBF5; border-color: #FF8C42; }
.btn-danger { background: #FEE2E2; color: #991B1B; }
.btn-danger:hover { background: #FECACA; }
.btn-success { background: #D1FAE5; color: #065F46; }
.btn-success:hover { background: #A7F3D0; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ============ 表单 ============ */
.form-label { font-size: 13px; color: #8B7E74; margin-bottom: 6px; display: block; font-weight: 500; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #FFE4C4; border-radius: 10px; font-size: 13px; color: #2D2A26; outline: none; transition: all 0.2s; background: #fff; }
.form-input:focus { border-color: #FF8C42; box-shadow: 0 0 0 3px rgba(255,140,66,0.12); }
.form-textarea { min-height: 90px; resize: vertical; font-family: inherit; }
select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239C7A5F' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ============ 开关 ============ */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #FFE4C4; border-radius: 22px; transition: 0.3s; }
.switch .slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: #2D2A26; }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ============ 筛选标签 ============ */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tab { padding: 7px 16px; border-radius: 10px; font-size: 13px; color: #A79B8E; background: #FFFBF5; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.filter-tab:hover { color: #2D2A26; }
.filter-tab.active { background: #2D2A26; color: #fff; }

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 20px; }
.page-btn { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #8B7E74; background: #FFFBF5; cursor: pointer; border: none; transition: all 0.2s; }
.page-btn:hover { background: #FFE4C4; }
.page-btn.active { background: #2D2A26; color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 48px 20px; color: #A79B8E; }
.empty-state i { font-size: 48px; opacity: 0.3; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 14px; margin: 0; }

/* ============ 模态弹窗 ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.show { display: flex; opacity: 1; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1); box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-overlay.show .modal { transform: scale(1); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #FFF5E6; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; font-weight: 600; color: #2D2A26; margin: 0; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: #FFFBF5; color: #A79B8E; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s; }
.modal-close:hover { background: #FEE2E2; color: #991B1B; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #FFF5E6; display: flex; gap: 10px; justify-content: flex-end; }

/* ============ 渐入动画 ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeUp 0.5s ease-out forwards; opacity: 0; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.1s; } .d3 { animation-delay: 0.15s; } .d4 { animation-delay: 0.2s; } .d5 { animation-delay: 0.25s; } .d6 { animation-delay: 0.3s; }

/* ============ 动态交互效果 ============ */
@keyframes floatBg { 0%,100% { transform: translate(0,0); } 50% { transform: translate(10px,-10px); } }
@keyframes numPulse { 0% { transform: scale(1); } 50% { transform: scale(1.08); color: #FF8C42; } 100% { transform: scale(1); } }
.num-pulse { animation: numPulse 0.6s ease; }
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes bellShake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(10deg); } 40% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-4deg); } }
.bell-icon:hover { animation: bellShake 0.5s ease; transform-origin: top center; }

/* 顶部加载进度条 */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, #FF8C42, #2D2A26); z-index: 9998; width: 0; transition: width 0.3s ease; box-shadow: 0 0 10px rgba(255,140,66,0.6); }

/* 遮罩层 */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999; opacity: 0; transition: opacity 0.3s; }
.sidebar-overlay.show { display: block; opacity: 1; }

/* 实时时钟 */
.live-clock { font-family: 'Outfit', sans-serif; font-size: 13px; color: #8B7E74; font-weight: 600; letter-spacing: 0.05em; }
.live-clock .blink { animation: blink 1s steps(1) infinite; }

/* 点击水波纹 */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,140,66,0.3); transform: scale(0); animation: rippleAnim 0.6s ease-out; pointer-events: none; }
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* 主题切换按钮 */
.theme-toggle { width: 40px; height: 40px; border-radius: 10px; background: #FFF5E6; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #2D2A26; font-size: 18px; transition: all 0.3s; flex-shrink: 0; }
.theme-toggle:hover { transform: rotate(180deg); }

/* 滚动渐入 */
.scroll-reveal { opacity: 0; transform: translateY(30px); transition: all 0.6s cubic-bezier(0.22,1,0.36,1); }
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ 暗色主题 ============ */
body.dark-mode { background: #1a1614; }
body.dark-mode .topbar, body.dark-mode .card, body.dark-mode .stat { background: #2a2420; }
body.dark-mode .topbar h2, body.dark-mode .card-title span, body.dark-mode .stat .stat-num, body.dark-mode .data-table td { color: #FFFBF5; }
body.dark-mode .topbar .sub, body.dark-mode .data-table th, body.dark-mode .stat .stat-label { color: #A79B8E; }
body.dark-mode .data-table th { border-bottom-color: #3a3430; }
body.dark-mode .data-table td { border-bottom-color: #2a2420; }
body.dark-mode .data-table tr:hover td { background: #332e2a; }
body.dark-mode .search-box { background: #332e2a; border-color: #3a3430; }
body.dark-mode .menu-toggle { background: #332e2a; }
body.dark-mode .theme-toggle { background: #332e2a; color: #FF8C42; }
body.dark-mode .form-input { background: #332e2a; border-color: #3a3430; color: #FFFBF5; }
body.dark-mode .filter-tab { background: #332e2a; color: #A79B8E; }
body.dark-mode .filter-tab.active { background: #FF8C42; color: #2D2A26; }
body.dark-mode .page-btn { background: #332e2a; color: #A79B8E; }
body.dark-mode .btn-outline { background: #332e2a; color: #FFFBF5; border-color: #3a3430; }
body.dark-mode .modal { background: #2a2420; }
body.dark-mode .modal-header, body.dark-mode .modal-footer { border-color: #3a3430; }
body.dark-mode .modal-header h3 { color: #FFFBF5; }
body.dark-mode .modal-close { background: #332e2a; }

/* ============ 响应式断点 ============ */
@media (max-width: 1279px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1); }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: flex; }
    .main { margin-left: 0; }
}
@media (max-width: 1023px) {
    .main { padding: 16px; }
    .topbar { padding: 14px 18px; }
    .topbar h2 { font-size: 17px; }
    .card { padding: 18px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .grid-3 { grid-template-columns: 1fr !important; }
    .grid-3 > .col-span-2 { grid-column: span 1 !important; }
}
@media (max-width: 767px) {
    .main { padding: 12px; }
    .topbar { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
    .topbar .topbar-right { gap: 8px; }
    .search-box { display: none; }
    .topbar .sub { display: none; }
    .card { padding: 14px; border-radius: 12px; }
    .card-title { font-size: 14px; margin-bottom: 14px; }
    .stat { padding: 16px; }
    .stat .stat-num { font-size: 24px; }
    .stat .stat-icon { width: 40px; height: 40px; font-size: 18px; margin-bottom: 10px; }
    .stats-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .data-table th, .data-table td { padding: 8px 6px; font-size: 12px; }
    .admin-info-text { display: none; }
}
@media (max-width: 479px) {
    .topbar h2 { font-size: 15px; }
    .stat .stat-num { font-size: 20px; }
}
