* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; }
.hidden { display: none !important; }

/* 登录（全屏遮罩，登录成功后隐藏） */
.login-page { position: fixed; inset: 0; z-index: 9999; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e1b4b, #312e81, #4c1d95); }
#loginPage.hidden { display: none !important; visibility: hidden; pointer-events: none; }
.login-card { background: rgba(255,255,255,0.08); backdrop-filter: blur(16px); padding: 48px 40px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); width: 400px; }
.login-card h1 { text-align: center; margin-bottom: 8px; font-size: 26px; }
.login-card .sub { text-align: center; color: #94a3b8; margin-bottom: 32px; font-size: 14px; }
.login-card input { width: 100%; padding: 14px; margin-bottom: 16px; border: 1px solid #475569; border-radius: 10px; background: #1e293b; color: #fff; }
.login-card button { width: 100%; padding: 14px; background: linear-gradient(135deg, #6366f1, #8b5cf6); border: none; border-radius: 10px; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #1e293b; border-right: 1px solid #334155; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 24px; font-size: 18px; font-weight: 700; background: linear-gradient(135deg, #818cf8, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; border-bottom: 1px solid #334155; }
.nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav a { display: block; padding: 12px 24px; color: #94a3b8; text-decoration: none; font-size: 14px; transition: 0.2s; cursor: pointer; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(99,102,241,0.2); border-left: 3px solid #6366f1; }
.sidebar-footer { padding: 16px; border-top: 1px solid #334155; }
.sidebar-footer button { width: 100%; padding: 10px; background: transparent; border: 1px solid #475569; color: #94a3b8; border-radius: 8px; cursor: pointer; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { padding: 20px 32px; border-bottom: 1px solid #334155; background: #1e293b; display: flex; justify-content: space-between; align-items: center; }
.topbar h2 { font-size: 22px; }
.topbar .api-hint { font-size: 12px; color: #64748b; }
.content { flex: 1; padding: 24px 32px; overflow-y: auto; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 20px; text-align: center; }
.stat-card.accent { border-color: #6366f1; background: linear-gradient(135deg, rgba(99,102,241,0.15), transparent); }
.stat-num { font-size: 32px; font-weight: 700; color: #818cf8; display: block; }
.stat-label { font-size: 13px; color: #94a3b8; margin-top: 4px; }

/* 工具栏 */
.toolbar { margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 500; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.btn-success { background: #10b981; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid #475569; color: #e2e8f0; }

/* 表格 */
.card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #334155; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #334155; }
th { background: #0f172a; color: #94a3b8; font-weight: 600; white-space: nowrap; }
tr:hover td { background: rgba(99,102,241,0.05); }
table img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; }
.tag-pay { background: rgba(16,185,129,0.2); color: #34d399; }
.tag-ship { background: rgba(99,102,241,0.2); color: #818cf8; }
.tag-wait { background: rgba(245,158,11,0.2); color: #fbbf24; }
.tag-done { background: rgba(148,163,184,0.2); color: #94a3b8; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #94a3b8; }
.form-group .sub-label { display: block; margin: 14px 0 8px; font-size: 12px; color: #64748b; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #475569; border-radius: 8px;
  background: #0f172a; color: #fff; font-size: 14px;
}
.form-group textarea { min-height: 100px; resize: vertical; }
.upload-box { border: 2px dashed #475569; border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: 0.2s; }
.upload-box:hover { border-color: #6366f1; background: rgba(99,102,241,0.05); }
.upload-preview { max-width: 200px; max-height: 120px; margin-top: 12px; border-radius: 8px; }
.tbl-thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; vertical-align: middle; }
.detail-img-editor { margin-top: 16px; padding: 16px; background: rgba(15, 23, 42, 0.35); border: 1px solid #334155; border-radius: 12px; }
.detail-img-editor .sub-label { display: block; margin-bottom: 10px; font-weight: 600; color: #cbd5e1; }
.detail-img-preview-wrap { min-height: 120px; display: flex; align-items: center; justify-content: center; background: #0f172a; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.detail-img-preview { max-width: 100%; max-height: 280px; cursor: zoom-in; border-radius: 8px; }
.detail-img-placeholder { color: #64748b; font-size: 14px; padding: 40px 16px; text-align: center; }
.detail-img-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.detail-img-url { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #475569; background: #0f172a; color: #e2e8f0; font-size: 13px; box-sizing: border-box; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; }
.tag-on { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.tag-off { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.preview-video { max-width: 300px; max-height: 180px; margin-top: 12px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal-box { background: #1e293b; border: 1px solid #334155; border-radius: 16px; width: 640px; max-width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px; }
.modal-box.wide { width: 800px; }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid #334155; }

/* 标签页 */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 8px; background: #1e293b; border: 1px solid #334155; cursor: pointer; font-size: 13px; }
.tab.active { background: #6366f1; border-color: #6366f1; }

.panel-section { display: none; }
.panel-section.active { display: block; }

.empty { text-align: center; padding: 48px; color: #64748b; }
.hidden { display: none !important; }
.muted { color: #94a3b8; font-size: 12px; }
.nav-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.nav-toolbar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-preview-box { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.nav-preview-box img { object-fit: contain; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.emoji-btn { width: 40px; height: 40px; font-size: 22px; border: 1px solid #475569; border-radius: 8px; background: #0f172a; cursor: pointer; }
.emoji-btn:hover { border-color: #6366f1; background: rgba(99,102,241,0.15); }
.color-dot { display: inline-block; width: 24px; height: 24px; border-radius: 6px; border: 1px solid #475569; }
.btn-danger { background: #dc2626; color: #fff; border: none; }
.btn-danger:hover { background: #b91c1c; }
.nav-count-label { font-size: 13px; color: #94a3b8; margin-right: 4px; }
.level-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.level-tag.l1 { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.level-tag.l2 { background: rgba(52,211,153,0.2); color: #6ee7b7; }
.level-tag.l3 { background: rgba(251,191,36,0.2); color: #fcd34d; }
