/* ==========================================================================
   元眸素材效果工厂 - 1:1 Pixel Perfect Design System & Application Styles
   ========================================================================== */

:root {
  /* Primary & Accent Palette */
  --primary-color: #5346e0;
  --primary-hover: #4335ce;
  --primary-light: #eeeffe;
  --primary-gradient: linear-gradient(135deg, #6355ff 0%, #4b3bcb 100%);
  
  /* Neutral Palette */
  --sidebar-bg: #181e2e;
  --sidebar-hover: #22293d;
  --sidebar-text: #8c96ab;
  --sidebar-text-active: #ffffff;
  --header-bg: #ffffff;
  --body-bg: #f5f7fa;
  
  /* Content & Text Colors */
  --text-main: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;

  /* Tag & Status Colors */
  --status-green-bg: #f0fdf4;
  --status-green-border: #bbf7d0;
  --status-green-text: #16a34a;
  
  --status-orange-bg: #fff7ed;
  --status-orange-border: #ffedd5;
  --status-orange-text: #ea580c;

  --status-red-bg: #fef2f2;
  --status-red-border: #fecaca;
  --status-red-text: #dc2626;

  --status-blue-bg: #eff6ff;
  --status-blue-border: #bfdbfe;
  --status-blue-text: #2563eb;
  
  --dark-pill-bg: #374151;
  --dark-navy-btn: #1e2638;

  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Global Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Main Layout Grid */
#app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: 230px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-brand {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--primary-gradient);
  color: var(--sidebar-text-active);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(83, 70, 224, 0.35);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-meta-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.user-meta-role {
  color: #6b7280;
  font-size: 11px;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header Navbar */
.top-header {
  height: 64px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}

.header-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Points Badge */
.points-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #fffbe6;
  border: 1px solid #ffe58f;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #d48806;
  font-weight: 600;
}

.points-icon {
  font-size: 13px;
}

/* Header Icons */
.header-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast);
}

.header-icon-btn:hover {
  background-color: #f3f4f6;
  color: var(--text-main);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: #ff4d4f;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Profile Menu */
.profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 20px;
}

/* Views Container & Switcher */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-container.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Header & Subtitles */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Common Card Box */
.card-box {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Badges & Pills */
.pill-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.pill-tag.gray {
  background-color: #f3f4f6;
  color: #4b5563;
}

.pill-tag.green {
  background-color: #f0fdf4;
  color: #16a34a;
  font-weight: 600;
}

.pill-tag.orange {
  background-color: #fff7ed;
  color: #ea580c;
  font-weight: 600;
}

.pill-tag.dark {
  background-color: var(--dark-pill-bg);
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(83, 70, 224, 0.25);
}

.btn-primary:hover {
  opacity: 0.93;
  box-shadow: 0 6px 16px rgba(83, 70, 224, 0.35);
  transform: translateY(-1px);
}

.btn-navy {
  background-color: var(--dark-navy-btn);
  color: #ffffff;
}

.btn-navy:hover {
  background-color: #2d3748;
}

.btn-secondary {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: #374151;
}

.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
}

/* Inputs & Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: border-color var(--transition-fast);
  font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(83, 70, 224, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* View 1: 素材修改 Layout */
.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Procedural Code-Generated Media Box */
.preview-media-box {
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: var(--radius-md);
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  padding-top: 40px;
}

.preview-media-box img {
  max-width: 90%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 8px;
}

/* Procedural Mockup Poster */
.procedural-poster {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 50% 30%, #fef3c7 0%, #f1f5f9 70%);
}

.poster-watermark {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.poster-hero-mock {
  margin-top: 10px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 28px;
  box-shadow: 0 8px 16px rgba(244, 63, 94, 0.25);
}

.poster-badge-text {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #e11d48;
  background: #ffe4e6;
  padding: 2px 8px;
  border-radius: 4px;
}

.score-badge-corner {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
}

.score-badge-corner .score-num {
  color: #fbbf24;
}

.score-badge-corner .score-num-green {
  color: #4ade80;
}

/* Alert Diagnosis Box */
.alert-diagnosis {
  background-color: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.alert-diagnosis-title {
  color: #c2410c;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.alert-diagnosis-body {
  color: #ea580c;
  font-size: 12px;
  line-height: 1.6;
}

/* Output Result Box */
.result-dashed-box {
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  border: 2px dashed #818cf8;
  border-radius: var(--radius-md);
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
}

.procedural-result-poster {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #e0e7ff 0%, #f8fafc 80%);
  position: relative;
}

.result-done-text {
  color: var(--primary-color);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.result-sparkle-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(83, 70, 224, 0.35);
}

.result-enhanced-cta {
  margin-top: 10px;
  background: linear-gradient(90deg, #ef4444, #f97316);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Evaluation Box */
.eval-result-box {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.eval-title {
  color: #166534;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 10px;
}

.eval-bullet {
  font-size: 12.5px;
  color: #15803d;
  margin-bottom: 6px;
}

.eval-bullet:last-child {
  margin-bottom: 0;
}

.eval-bold {
  font-weight: 700;
  color: #16a34a;
}

/* View 2: 一键复制 Layout */
.replica-steps-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 28px;
}

.replica-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 32px;
}

.step-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
}

.step-number-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dashed Dropzone */
.dashed-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: #fafafa;
  position: relative;
}

.dashed-dropzone:hover {
  border-color: var(--primary-color);
  background-color: #f5f3ff;
}

.dropzone-text-primary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 8px;
}

.dropzone-text-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.divider-or {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 14px 0;
  position: relative;
}

.btn-purple-light {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-size: 13px;
}

.btn-purple-light:hover {
  background-color: #e0e2fe;
}

/* Selected File Card */
.selected-file-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-thumb-video {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.file-meta-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.file-meta-score {
  font-size: 11px;
  color: #16a34a;
  font-weight: 600;
  margin-top: 2px;
}

/* Segment Pill Selector */
.pill-selector {
  display: flex;
  gap: 10px;
}

.pill-option {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-option.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: var(--primary-light);
  font-weight: 600;
}

/* Prediction Card */
.prediction-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.prediction-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

.progress-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.progress-bar-track {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-bar-fill.green { background-color: #22c55e; }
.progress-bar-fill.blue { background-color: #3b82f6; }

.prediction-footnote {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* View 3: 创意裂变 Layout */
.fission-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

/* Tab Segment Toggle */
.segment-tabs {
  display: inline-flex;
  background-color: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.segment-tab-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segment-tab-btn.active {
  background-color: #ffffff;
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Fission Step Item */
.fission-step-item {
  margin-bottom: 24px;
}

.fission-step-item:last-child {
  margin-bottom: 0;
}

.fission-step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fission-step-num {
  color: var(--primary-color);
  font-weight: 700;
}

.fission-step-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

/* Channel Select Grid */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.channel-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: #ffffff;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.channel-card.checked {
  border-color: var(--primary-color);
  background-color: #f5f3ff;
}

.channel-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.channel-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Engine Toggle Rows */
.engine-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.engine-row-card {
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.engine-info-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.engine-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.engine-icon.red { background-color: #fef2f2; color: #ef4444; }
.engine-icon.orange { background-color: #fff7ed; color: #f97316; }
.engine-icon.green { background-color: #f0fdf4; color: #22c55e; }

.engine-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.engine-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.tag-mini-green {
  background-color: #dcfce7;
  color: #15803d;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Toggle Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Fission Right Side Panel */
.ai-boost-card {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border: 1px solid #fef3c7;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 20px;
}

.ai-boost-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 14px;
}

.ai-metric-val {
  font-size: 16px;
  font-weight: 800;
}

.ai-metric-val.orange { color: #f97316; }
.ai-metric-val.yellow { color: #eab308; }
.ai-metric-val.green { color: #22c55e; }

.progress-bar-fill.orange { background-color: #f97316; }
.progress-bar-fill.yellow { background-color: #eab308; }

.cost-estimate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.cost-num {
  font-weight: 700;
  color: var(--text-main);
}

/* NEW: 5A素材效果排行榜 (Ranking List Table View) Styles */
.ranking-tabs-bar {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.ranking-tab-item {
  padding: 10px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.ranking-tab-item:hover {
  color: var(--primary-color);
}

.ranking-tab-item.active {
  color: var(--primary-color);
  font-weight: 700;
}

.ranking-tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.ranking-table-container {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ranking-table th {
  background-color: #fafafa;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.ranking-table td {
  padding: 16px 18px;
  font-size: 13px;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

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

/* Material Thumb & File Info */
.material-cell-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.material-thumb-square {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
  flex-shrink: 0;
}

.material-file-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 13.5px;
}

.material-file-size {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Score Cell Badges */
.score-cell-box {
  display: flex;
  flex-direction: column;
}

.score-cell-num {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.score-cell-letter {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.score-cell-num.green { color: #16a34a; }
.score-cell-num.blue { color: #2563eb; }
.score-cell-num.orange { color: #ea580c; }
.score-cell-num.red { color: #dc2626; }

.action-link {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.action-link:hover {
  text-decoration: underline;
}

/* Back Link Bar */
.back-link-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  margin-bottom: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: var(--primary-light);
  transition: background-color var(--transition-fast);
}

.back-link-bar:hover {
  background-color: #e0e2fe;
}

/* View 4: 5A素材效果诊断报告 Layout */
.report-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.report-brand-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 2px;
}

.report-meta-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.report-grid-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.report-file-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(168, 85, 247, 0.25);
  flex-shrink: 0;
}

.score-display-flex {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0;
}

.score-giant-num {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
}

.score-total-denom {
  font-size: 14px;
  color: var(--text-muted);
}

.tag-grade-orange {
  background: linear-gradient(90deg, #ffedd5, #fff7ed);
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-left: 8px;
}

/* Radar Chart Canvas Wrapper */
.radar-chart-container {
  width: 100%;
  height: 250px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

/* 5 Dimension Cards Row */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.dim-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 14px;
  background-color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dim-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dim-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dim-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.dim-score {
  font-size: 18px;
  font-weight: 800;
}

.dim-score.red { color: #ef4444; }
.dim-score.green { color: #22c55e; }
.dim-score.orange { color: #f97316; }
.dim-score.blue { color: #3b82f6; }

.dim-bar-track {
  height: 4px;
  background-color: #f1f5f9;
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 2px;
}

.dim-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Optimization Plan Section */
.plan-container {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 20px;
}

.plan-step-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.plan-step-item {
  display: flex;
  gap: 12px;
}

.plan-step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.plan-step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.plan-step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.prompt-display-card {
  background-color: #0f172a;
  border-radius: var(--radius-md);
  padding: 16px;
  color: #e2e8f0;
  position: relative;
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.btn-copy-mini {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-copy-mini:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.prompt-code-text {
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  color: #cbd5e1;
  word-break: break-all;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-in-out;
}

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

.modal-box {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  width: 440px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #1e293b;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================================================== */
/* Auth Overlay & Mobile Responsive */
/* ========================================================================== */

.auth-overlay {
  position: fixed; inset: 0; background: linear-gradient(135deg, #181e2e 0%, #1e2638 100%);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.auth-card {
  background: #fff; border-radius: 16px; padding: 40px 36px; width: 380px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand-icon { font-size: 36px; margin-bottom: 8px; }
.auth-brand-title { font-size: 20px; font-weight: 800; color: #1f2937; }
.auth-brand-sub { font-size: 12px; color: #6b7280; margin-top: 4px; }
.auth-tabs { display: flex; gap: 0; border-bottom: 2px solid #f1f5f9; margin-bottom: 20px; }
.auth-tab {
  flex: 1; text-align: center; padding: 10px; font-size: 14px; font-weight: 600;
  color: #9ca3af; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s;
}
.auth-tab.active { color: #5346e0; border-bottom-color: #5346e0; }
.auth-error {
  display: none; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.auth-field input {
  width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 10px;
  font-size: 14px; outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.auth-field input:focus { border-color: #5346e0; box-shadow: 0 0 0 3px rgba(83,70,224,0.1); }
.auth-btn {
  width: 100%; padding: 12px; background: linear-gradient(135deg, #6355ff 0%, #4b3bcb 100%);
  color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.auth-btn:hover { opacity: 0.93; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-footer { text-align: center; font-size: 11px; color: #9ca3af; margin-top: 20px; }

/* Mobile Hamburger */
.mobile-menu-btn {
  display: none; position: relative; background: transparent; color: var(--text-main); border: none; border-radius: 8px;
  width: 36px; height: 36px; font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 15;
}
.sidebar-overlay.active { display: block; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; left: -230px; top: 0; bottom: 0; z-index: 20;
    transition: left 0.25s ease;
  }
  .sidebar.sidebar-open { left: 0; }
  .main-wrapper { width: 100%; }
  .top-header { padding: 0 12px; height: 52px; }
  .header-title { font-size: 14px; }
  .header-controls { gap: 8px; }
  .points-pill { font-size: 11px; padding: 4px 8px; }
  .view-container { padding: 12px; }
  .page-title { font-size: 18px; }
  .edit-grid { grid-template-columns: 1fr; }
  .replica-grid { grid-template-columns: 1fr; gap: 20px; }
  .fission-layout { grid-template-columns: 1fr; }
  .report-grid-top { grid-template-columns: 1fr; gap: 16px; }
  .dimensions-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ranking-table-container { overflow-x: auto; }
  .ranking-table th, .ranking-table td { padding: 10px 12px; font-size: 12px; }
  .plan-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .card-box { padding: 14px; }
  .replica-steps-card { padding: 14px; }
  .modal-box { width: 90vw; padding: 20px; }
  .radar-chart-container { display: flex; justify-content: center; }
  .score-display-flex { gap: 6px; margin: 10px 0; }
  .score-giant-num { font-size: 36px; }
  .dim-card { padding: 10px; }
  .dim-card-header { gap: 4px; }
  .dim-name { font-size: 12px; }
  .dim-desc { font-size: 11px; }
  .plan-step-desc { font-size: 12px; }
  .alert-diagnosis-body { font-size: 13px !important; line-height: 1.5 !important; }
  .header-title-area { gap: 4px; }
}

@media (max-width: 480px) {
  .dimensions-grid { grid-template-columns: 1fr; }
  .ranking-table { min-width: 600px; }
  .score-giant-num { font-size: 36px; }
  .auth-card { padding: 28px 20px; }
}

/* Dropdown Panels (Notification/Settings/UserMenu) */
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12); z-index: 50;
  min-width: 240px; overflow: hidden;
}
.dropdown-panel-header {
  padding: 12px 16px; font-size: 13px; font-weight: 700; color: #1f2937;
  border-bottom: 1px solid #f1f5f9; background: #fafafa;
}
.dropdown-panel-body { padding: 8px; max-height: 400px; overflow-y: auto; }
.dropdown-empty { text-align: center; font-size: 13px; color: #9ca3af; padding: 24px 0; }
.settings-panel-wide { min-width: 360px; }
.settings-section { margin-bottom: 14px; }
.settings-label { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.settings-input {
  width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 13px; outline: none; box-sizing: border-box;
}
.settings-input:focus { border-color: #5346e0; box-shadow: 0 0 0 2px rgba(83,70,224,0.08); }
.settings-user-info { font-size: 13px; color: #1f2937; font-weight: 600; }
.settings-divider { height: 1px; background: #f1f5f9; margin: 12px 0; }
.settings-price-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.settings-price-grid label { font-size: 11px; color: #6b7280; }
.user-menu-item {
  padding: 10px 12px; font-size: 13px; color: #1f2937; cursor: pointer;
  border-radius: 8px; transition: background 0.15s; display: flex; align-items: center; gap: 6px;
}
.user-menu-item:hover { background: #f5f3ff; }
.user-menu-item.logout-item { color: #dc2626; border-top: 1px solid #f1f5f9; margin-top: 4px; padding-top: 12px; }

/* Mobile dropdown panels */
@media (max-width: 768px) {
  .dropdown-panel { position: fixed; left: 16px; right: 16px; top: 60px; min-width: auto; }
  .settings-panel-wide { min-width: auto; left: 16px; right: 16px; }
  .settings-price-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .settings-input { font-size: 12px; padding: 6px 8px; }
  .header-icon-btn { width: 28px; height: 28px; }
  .header-icon-btn svg { width: 16px; height: 16px; }
  .profile-menu .user-avatar-badge { width: 28px !important; height: 28px !important; font-size: 11px !important; }
  .header-controls { gap: 6px !important; }
  .points-pill { font-size: 10px; padding: 3px 6px; }
  .preview-media-box { height: 200px; }
  .result-dashed-box { height: 200px; }
  .card-header-flex { flex-wrap: wrap; gap: 8px; }
  .step-col-header { font-size: 13px; }
  .fission-step-title { font-size: 13px; }
  .engine-row-card { padding: 10px 12px; }
  .engine-name { font-size: 12px; }
  .engine-desc { font-size: 10px; }
  .ai-boost-card { padding: 12px; }
  .prompt-display-card { padding: 12px; }
  .prompt-code-text { font-size: 11px; }
  .dim-card { padding: 10px; }
  .dim-score { font-size: 16px; }
  .dim-name { font-size: 11px; }
  .dim-desc { font-size: 10px; }
  .report-top-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .score-display-flex { margin: 8px 0; }
  .score-giant-num { font-size: 32px; }
  .radar-chart-container { height: 200px; }
  .back-link-bar { margin-bottom: 8px; }
}

@media (max-width: 380px) {
  .settings-price-grid { grid-template-columns: 1fr; }
  .auth-brand-title { font-size: 18px; }
  .auth-btn { font-size: 14px; padding: 10px; }
}

/* Upload Placeholder */
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; cursor: pointer; transition: all 0.15s; padding: 20px;
}
.upload-placeholder:hover { opacity: 0.8; }

/* 文件名截断 */
.filename-truncate {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; vertical-align: middle;
}
.material-file-title { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-meta-text { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
  .filename-truncate { max-width: 100px; }
  .material-file-title { max-width: 100px; }
  .file-meta-name { max-width: 120px; }
  .report-meta-text { max-width: 180px; }
}

/* ===== Print/PDF Styles ===== */
@media print {
  body * { visibility: hidden; }
  #view-score-report, #view-score-report * { visibility: visible; }
  #view-score-report { position: absolute; left: 0; top: 0; width: 100%; }
  .sidebar, .top-nav, .mobile-menu-btn, #loadingModal, .auth-overlay { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
  .report-grid-top { grid-template-columns: 1fr 1fr; }
  .dim-card { break-inside: avoid; }
  .plan-container { break-inside: avoid; }
  .card-box { break-inside: avoid; box-shadow: none !important; border: 1px solid #e5e7eb !important; }
}

/* 长文件名截断 */
#report-active-file-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

#view-score-report h2 {
  word-break: break-all;
}
