/* ============================================
   斗城传媒全景平台 v7.0 - 全新蓝紫色B端管理系统风格
   ============================================ */

/* === CSS 变量 === */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5b4cdb;
  --primary-light: #a29bfe;
  --primary-bg: #f0edff;
  --primary-bg-hover: #e8e3ff;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-hover: linear-gradient(135deg, #5a6fd6 0%, #6a4392 100%);
  --success: #00b894;
  --success-bg: #e0f8f4;
  --warning: #fdcb6e;
  --warning-bg: #fff5e0;
  --danger: #e74c3c;
  --danger-bg: #fdeaea;
  --info: #0984e3;
  --info-bg: #e3f2fd;
  
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-tertiary: #b2bec3;
  --text-white: #ffffff;
  
  --bg-page: #f5f6fa;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f8f9fa;
  
  --border-color: #e9ecef;
  --border-light: #f1f3f5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-purple: 0 4px 16px rgba(108,92,231,0.25);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --sidebar-w: 220px;
  --topbar-h: 60px;
  
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }

/* === Material Icons === */
.material-icons { font-size: 18px; vertical-align: middle; }

/* === Login Screen === */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient);
  padding: 20px;
}
.login-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.brand-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.brand-mark {
  width: 48px; height: 48px;
  background: var(--gradient);
  color: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; flex-shrink: 0;
  box-shadow: var(--shadow-purple);
}
.brand-row strong { display: block; font-size: 18px; color: var(--text-primary); font-weight: 600; }
.brand-row span { font-size: 13px; color: var(--text-tertiary); }

/* Auth Tabs */
.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--border-light); }
.auth-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-tertiary); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-tab:hover { color: var(--text-secondary); }

/* Auth Forms */
.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.auth-form input, .auth-form select, .auth-form textarea {
  padding: 11px 14px; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-page); color: var(--text-primary); transition: all 0.2s;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-bg);
}
.auth-links { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.remember-row { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); cursor: pointer; }
.remember-row input { width: 15px; height: 15px; accent-color: var(--primary); }
#forgotPasswordLink { color: var(--primary); font-size: 13px; }
.login-note { text-align: center; font-size: 12px; color: var(--text-tertiary); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* Captcha */
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-img { width: 100px; height: 40px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border-color); }

/* Social Login */
.social-divider { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: 12px; margin: 4px 0; }
.social-divider::before, .social-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-light); }
.social-login-buttons { display: flex; gap: 10px; justify-content: center; }
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1;
  border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; color: var(--text-secondary);
  background: #fff; transition: all 0.2s;
}
.btn-social:hover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.btn-social .social-icon { width: 18px; height: 18px; }
.btn-social .social-icon svg { width: 100%; height: 100%; }
.btn-social.wechat:hover { border-color: #07c160; background: rgba(7,193,96,0.05); color: #07c160; }
.btn-social.qq:hover { border-color: #12b7f5; background: rgba(18,183,245,0.05); color: #12b7f5; }

/* === Buttons === */
.primary-button {
  background: var(--primary); color: #fff; border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  transition: all 0.2s; border: none;
}
.primary-button:hover { background: var(--primary-dark); box-shadow: var(--shadow-purple); }
.primary-button.full { width: 100%; padding: 12px; }
.secondary-button {
  background: #fff; color: var(--text-secondary); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 10px 20px; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.secondary-button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.secondary-button.full { width: 100%; padding: 12px; }

/* === App Shell === */
.app-shell { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
}
.sidebar .brand-row { padding: 16px 20px; margin-bottom: 0; border-bottom: 1px solid var(--border-light); }
.nav-list { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 16px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  text-align: left; transition: all 0.2s; margin-bottom: 3px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-item::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary);
  flex-shrink: 0; transition: all 0.2s;
}
.nav-item.active::before { background: var(--primary); }
.sidebar-card {
  margin: 12px; padding: 16px; background: var(--bg-page); border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-card span { font-size: 12px; color: var(--text-tertiary); }
.sidebar-card strong { font-size: 15px; color: var(--text-primary); }
.sidebar-card small { font-size: 12px; color: var(--primary); margin-bottom: 8px; }
.sidebar-card .secondary-button { margin-top: 4px; }

/* === Main === */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

/* === Topbar === */
.topbar {
  height: var(--topbar-h); background: var(--gradient);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 90;
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}
.topbar > div:first-child { display: flex; flex-direction: column; }
.topbar .eyebrow { font-size: 11px; color: rgba(255,255,255,0.7); letter-spacing: 1px; }
.topbar h1 { font-size: 16px; color: #fff; font-weight: 600; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.top-actions .secondary-button { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.25); }
.top-actions .secondary-button:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.4); }
.top-actions .primary-button { background: rgba(255,255,255,0.2); color: #fff; }
.top-actions .primary-button:hover { background: rgba(255,255,255,0.3); box-shadow: none; }

/* Top nav links */
.topbar-nav {
  display: flex; align-items: center; gap: 2px; flex: 1; margin: 0 30px;
}
.topbar-nav-item {
  padding: 8px 14px; font-size: 13px; color: rgba(255,255,255,0.75);
  border-radius: var(--radius-sm); transition: all 0.2s; white-space: nowrap;
}
.topbar-nav-item:hover { color: #fff; background: rgba(255,255,255,0.12); }
.topbar-nav-item.active { color: #fff; background: rgba(255,255,255,0.2); font-weight: 500; }
.topbar-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px;
  border-radius: var(--radius-sm); transition: all 0.2s;
}
.topbar-user:hover { background: rgba(255,255,255,0.12); }
.topbar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600;
}
.topbar-user-name { font-size: 13px; color: #fff; }

/* === Views === */
.view { display: none; padding: 24px; flex: 1; }
.view.active { display: block; }

/* === Metrics Grid === */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all 0.2s; border: 1px solid var(--border-light);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-card .metric-label { font-size: 13px; color: var(--text-tertiary); margin-bottom: 8px; }
.metric-card .metric-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.metric-card .metric-icon {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.metric-icon.purple { background: var(--gradient); }
.metric-icon.green { background: linear-gradient(135deg, #00b894, #00cec9); }
.metric-icon.blue { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.metric-icon.orange { background: linear-gradient(135deg, #e17055, #fdcb6e); }

/* === Content Grid === */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1024px) { .content-grid { grid-template-columns: 1fr; } }

/* === Panel === */
.panel {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); margin-bottom: 16px;
}
.panel.span-2 { grid-column: span 2; }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { font-size: 16px; color: var(--text-primary); font-weight: 600; margin-bottom: 4px; }
.panel-head p { font-size: 13px; color: var(--text-tertiary); }
.panel-head.compact { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head.compact h2 { margin-bottom: 0; font-size: 14px; }

/* === Feature Grid === */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.feature-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm); transition: all 0.2s;
}
.feature-card:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.feature-card .feature-icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.feature-card .feature-icon .material-icons { color: var(--primary); font-size: 20px; }
.feature-card .feature-info { flex: 1; }
.feature-card h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.feature-card p { font-size: 12px; color: var(--text-tertiary); }

/* === Queue/Task List === */
.queue-list { display: flex; flex-direction: column; gap: 8px; }
.queue-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--bg-page); transition: all 0.2s;
}
.queue-item:hover { background: var(--primary-bg); }
.queue-item .queue-status {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.queue-status.done { background: var(--success); }
.queue-status.pending { background: var(--warning); }
.queue-status.error { background: var(--danger); }
.queue-item .queue-name { flex: 1; font-size: 13px; color: var(--text-secondary); }
.queue-item .queue-time { font-size: 12px; color: var(--text-tertiary); }

/* === Section Head === */
.section-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.section-head h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.section-head p { font-size: 13px; color: var(--text-tertiary); }

/* === Toolbar === */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; }
.search-input, .select-input {
  padding: 9px 14px; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
  background: #fff; color: var(--text-primary); transition: all 0.2s;
}
.search-input { flex: 1; }
.search-input:focus, .select-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

/* === Project List === */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card {
  background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-light); }
.project-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-page); position: relative; overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--gradient); color: rgba(255,255,255,0.5); font-size: 36px;
}
.project-info { padding: 14px; }
.project-info h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.project-info p { font-size: 12px; color: var(--text-tertiary); margin-bottom: 8px; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.project-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500;
}
.project-tag.published { background: var(--success-bg); color: var(--success); }
.project-tag.draft { background: var(--warning-bg); color: #d4a017; }
.project-actions { display: flex; gap: 6px; padding: 0 14px 14px; }
.project-actions button { flex: 1; font-size: 12px; padding: 7px 10px; }

/* === Editor Layout === */
.editor-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
@media (max-width: 1200px) { .editor-layout { grid-template-columns: 1fr; } }
.panorama-stage {
  background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
}
.stage-toolbar { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--border-light); background: var(--bg-page); }
.stage-toolbar button {
  padding: 8px 16px; font-size: 13px; color: var(--text-secondary); border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.stage-toolbar button:hover { background: #fff; color: var(--primary); }
.stage-toolbar button.active { background: #fff; color: var(--primary); font-weight: 500; box-shadow: var(--shadow-sm); }
.panorama-preview {
  width: 100%; aspect-ratio: 16/9; background: #1a1a2e; position: relative; overflow: hidden;
}
.empty-panorama {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); gap: 8px;
}
.empty-panorama strong { font-size: 16px; }
.empty-panorama span { font-size: 13px; }
.reticle { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; transform: translate(-50%,-50%); }
.hotspot {
  position: absolute; padding: 6px 12px; background: rgba(108,92,231,0.85); color: #fff;
  border-radius: 20px; font-size: 12px; cursor: pointer; backdrop-filter: blur(4px);
}
.hotspot-a { top: 35%; left: 30%; }
.hotspot-b { top: 55%; left: 65%; }
.compass { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; background: rgba(255,255,255,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }

/* === Editor Panel === */
.editor-panel {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 20px;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); max-height: calc(100vh - 120px); overflow-y: auto;
}
.editor-panel h2 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 16px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.editor-panel h2:first-child { margin-top: 0; }
.editor-panel label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; font-weight: 500; }
.editor-panel input, .editor-panel select, .editor-panel textarea {
  padding: 9px 12px; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-page); color: var(--text-primary); transition: all 0.2s;
}
.editor-panel input:focus, .editor-panel select:focus, .editor-panel textarea:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-bg);
}
.upload-box {
  padding: 12px; background: var(--bg-page); border-radius: var(--radius-sm); margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.upload-box strong { font-size: 13px; color: var(--text-primary); }
.upload-box span { font-size: 12px; color: var(--text-tertiary); }

/* === Switch Row === */
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.switch-row span { font-size: 13px; color: var(--text-secondary); }
.switch-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* === Scene/Hotspot Lists === */
.scene-list-editor, .hotspot-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.scene-item, .hotspot-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-page);
  border-radius: var(--radius-sm); font-size: 13px;
}
.scene-item .scene-name, .hotspot-item .hotspot-name { flex: 1; color: var(--text-secondary); }
.scene-item button, .hotspot-item button { color: var(--text-tertiary); padding: 4px 8px; font-size: 12px; }
.scene-item button:hover, .hotspot-item button:hover { color: var(--danger); }

/* === Asset Grid === */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.asset-card {
  background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); transition: all 0.2s; cursor: pointer;
}
.asset-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.asset-thumb { width: 100%; aspect-ratio: 1; background: var(--bg-page); display: flex; align-items: center; justify-content: center; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb .material-icons { font-size: 40px; color: var(--text-tertiary); }
.asset-info { padding: 10px; }
.asset-info h4 { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.asset-info p { font-size: 11px; color: var(--text-tertiary); }

/* === Admin Grid === */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 16px; }
.admin-card {
  display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: var(--radius-md); transition: all 0.2s; cursor: pointer;
}
.admin-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.admin-card .admin-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-card .admin-icon .material-icons { color: var(--primary); font-size: 24px; }
.admin-card .admin-info h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.admin-card .admin-info p { font-size: 12px; color: var(--text-tertiary); }

/* === Plugin Grid === */
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.plugin-item {
  display: flex; align-items: center; justify-content: space-between; padding: 12px;
  background: var(--bg-page); border-radius: var(--radius-sm); transition: all 0.2s;
}
.plugin-item:hover { background: var(--primary-bg); }
.plugin-item .plugin-name { font-size: 13px; color: var(--text-secondary); }
.plugin-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* === Config List === */
.config-list { display: flex; flex-direction: column; gap: 8px; }
.config-item {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  background: var(--bg-page); border-radius: var(--radius-sm);
}
.config-item .config-label { font-size: 13px; color: var(--text-secondary); }
.config-item .config-value { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.config-item .config-actions { display: flex; gap: 6px; }
.config-item .config-actions button { padding: 4px 10px; font-size: 12px; border-radius: 4px; }

/* === Admin Ops Grid === */
.admin-ops-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .admin-ops-grid { grid-template-columns: 1fr; } }

/* === Material Picker === */
.material-picker {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.material-picker.active { display: flex; }
.material-picker-dialog {
  background: #fff; border-radius: var(--radius-lg); padding: 0; max-width: 800px; width: 90%; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.material-picker-dialog header {
  display: flex; justify-content: space-between; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.material-picker-dialog header h2 { font-size: 16px; font-weight: 600; }
.material-picker-dialog header button { color: var(--text-tertiary); font-size: 14px; padding: 6px 12px; }
.material-picker-dialog header button:hover { color: var(--danger); }
.material-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 20px; overflow-y: auto; }

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text-primary); color: #fff; padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 14px; z-index: 10000; transition: transform 0.3s; box-shadow: var(--shadow-lg); pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

/* === Status Badges === */
.status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 500;
}
.status-badge.published, .status-badge.paid, .status-badge.active, .status-badge.done { background: var(--success-bg); color: var(--success); }
.status-badge.draft, .status-badge.pending { background: var(--warning-bg); color: #d4a017; }
.status-badge.disabled, .status-badge.error { background: var(--danger-bg); color: var(--danger); }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9000;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.modal-content {
  background: #fff; border-radius: var(--radius-lg); max-width: 600px; width: 90%; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.modal-header .btn-close { color: var(--text-tertiary); padding: 6px; border-radius: var(--radius-sm); }
.modal-header .btn-close:hover { background: var(--bg-hover); color: var(--danger); }
.modal-body { padding: 20px; overflow-y: auto; }

/* === Admin Tabs === */
.admin-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border-light); margin-bottom: 16px; flex-wrap: wrap; }
.admin-tab-btn {
  padding: 8px 14px; font-size: 13px; color: var(--text-tertiary); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.admin-tab-btn:hover { color: var(--text-secondary); }
.admin-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.admin-tab-content { margin-top: 16px; }
.admin-tab-content h4 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }

/* === Card Items (Batch2) === */
.card-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-page); border-radius: var(--radius-sm); margin-bottom: 8px; transition: all 0.2s;
}
.card-item:hover { background: var(--primary-bg); }
.card-thumb {
  width: 48px; height: 48px; border-radius: 8px; background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-thumb .material-icons { font-size: 24px; color: var(--primary); }
.card-info { flex: 1; min-width: 0; }
.card-info h4 { margin: 0 0 2px 0; font-size: 14px; color: var(--text-primary); }
.card-info p { margin: 0; font-size: 12px; color: var(--text-tertiary); }
.card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-icon {
  background: none; border: none; color: var(--text-tertiary); cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm); transition: all 0.2s;
}
.btn-icon:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }
.btn-icon .material-icons { font-size: 16px; }

/* === Data Table === */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; color: var(--text-tertiary); font-weight: 500;
  border-bottom: 2px solid var(--border-light); font-size: 12px;
}
.data-table td { padding: 10px 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
.data-table tr:hover td { background: var(--bg-page); }

/* === Config Form === */
.config-form { background: var(--bg-page); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; }
.config-form .form-group { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.config-form label { min-width: 100px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.config-form input, .config-form select {
  flex: 1; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--text-primary); background: #fff;
}
.config-form input:focus, .config-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.config-form .checkbox-group { display: flex; align-items: center; }
.config-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* === Theme Cards === */
.theme-card {
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--border-color);
  border-radius: var(--radius-md); margin-bottom: 10px; cursor: pointer; transition: all 0.2s; position: relative;
}
.theme-card:hover { border-color: var(--primary-light); }
.theme-card.active { border-color: var(--primary); background: var(--primary-bg); }
.theme-preview { width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; }
.theme-doucheng { background: linear-gradient(135deg, #667eea, #764ba2); }
.theme-dark-pro { background: linear-gradient(135deg, #2d3436, #636e72); }
.theme-light-clean { background: linear-gradient(135deg, #ffffff, #f5f6fa); border: 1px solid var(--border-color); }
.theme-business { background: linear-gradient(135deg, #0984e3, #6c5ce7); }
.theme-info h4 { margin: 0 0 2px 0; font-size: 14px; color: var(--text-primary); }
.theme-info p { margin: 0; font-size: 12px; color: var(--text-tertiary); }

/* === Upgrade Card === */
.upgrade-card { background: var(--bg-page); border-radius: var(--radius-md); padding: 20px; text-align: center; }
.upgrade-current, .upgrade-latest { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.upgrade-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; font-size: 14px; }
.upgrade-status.latest { color: var(--success); }
.upgrade-status.has-update { color: var(--warning); }

/* === Redpack Widget === */
.redpack-widget { position: fixed; bottom: 80px; right: 20px; z-index: 9000; display: none; }
.redpack-inner {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #e53935, #c62828);
  border-radius: 12px; padding: 12px 16px; box-shadow: 0 4px 20px rgba(229,57,53,0.3);
}
.redpack-icon .material-icons { font-size: 28px; color: #ffd54f; }
.redpack-info h4 { margin: 0; font-size: 14px; color: #fff; }
.redpack-info p { margin: 0; font-size: 12px; color: rgba(255,255,255,0.8); }
.btn-redpack { background: #ffd54f; color: #c62828; border: none; border-radius: 20px; padding: 8px 20px; font-weight: 600; }

/* === Coupon === */
.coupon-item {
  display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 10px; position: relative;
}
.coupon-value { font-size: 24px; font-weight: 700; color: #fff; min-width: 60px; text-align: center; }
.coupon-detail { flex: 1; }
.coupon-detail h4 { margin: 0 0 4px 0; font-size: 14px; color: #fff; }
.coupon-detail p { margin: 0; font-size: 12px; color: rgba(255,255,255,0.8); }
.btn-coupon { background: rgba(255,255,255,0.25); color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 20px; padding: 6px 16px; }

/* === Weather Widget === */
#weatherWidget {
  display: none; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--info-bg); border-radius: 20px; font-size: 13px; color: var(--text-secondary);
}
.weather-icon .material-icons { font-size: 18px; color: var(--warning); }
.weather-temp { font-weight: 600; color: var(--text-primary); }
.weather-desc { color: var(--text-tertiary); }
.weather-detail { font-size: 11px; color: var(--text-tertiary); }

/* === Empty State === */
.empty-state { text-align: center; color: var(--text-tertiary); padding: 40px 20px; font-size: 14px; }

/* === Code === */
code { background: var(--bg-page); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--primary); }

/* === QQ Login Button === */
.btn-qq-login {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: #12b7f5; color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px; font-size: 14px;
}
.btn-qq-login:hover { background: #0aa3de; }

/* === WeChat QR Modal === */
.wx-qr-modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 10000;
  align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.wx-qr-content { background: #fff; border-radius: var(--radius-lg); max-width: 360px; width: 90%; overflow: hidden; box-shadow: var(--shadow-lg); }
.wx-qr-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.wx-qr-header h3 { margin: 0; font-size: 16px; color: var(--text-primary); }
.wx-qr-body { padding: 24px 20px; text-align: center; }
.wx-qr-container { min-height: 320px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.wx-qr-loading { color: var(--text-tertiary); text-align: center; }
.wx-qr-loading .material-icons.spinning { font-size: 32px; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.wx-qr-error { color: var(--danger); text-align: center; }
.wx-qr-tip { font-size: 12px; color: var(--text-tertiary); margin: 8px 0 16px; }
.wx-qr-footer { padding-top: 8px; border-top: 1px solid var(--border-light); }
.btn-text { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 8px 16px; }
.btn-text:hover { text-decoration: underline; }

/* === WX Bind Status === */
.wx-bind-status { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); }
.wx-bind-status.bound { color: var(--success); background: var(--success-bg); }
.wx-bind-status.unbound { color: var(--text-tertiary); background: var(--bg-page); }
.wx-user-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* === btn-primary (batch2) === */
.btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-purple); }

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .brand-row strong, .sidebar .brand-row span, .nav-item, .sidebar-card { display: none; }
  .main { margin-left: 60px; }
  .topbar-nav { display: none; }
  .editor-layout { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .admin-ops-grid { grid-template-columns: 1fr; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
