/* ============================================
   美拍打印机 · 后台运营操作指引
   Design Tokens
   ============================================ */
:root {
  /* Primary */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a5f;

  /* Neutral */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Risk / Warning */
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;

  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Reset & Base
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--gray-900);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.sidebar-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
}

.sidebar-nav {
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.35);
  padding: 16px 10px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--primary-600);
  color: #fff;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nav-item .nav-label {
  flex: 1;
  line-height: 1.3;
}

.nav-item .risk-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--danger-600);
  color: #fff;
  letter-spacing: 0.5px;
}

.nav-item.active .risk-badge {
  background: rgba(255, 255, 255, 0.3);
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================
   Main Content
   ============================================ */
.main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.page-breadcrumb {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
  flex: 1;
}

.risk-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.risk-tag.high {
  background: var(--danger-50);
  color: var(--danger-700);
  border: 1px solid var(--danger-100);
}

.risk-tag.high::before {
  content: "🔴";
  font-size: 14px;
}

.risk-tag.medium {
  background: var(--warning-50);
  color: #92400e;
  border: 1px solid var(--warning-100);
}

.risk-tag.medium::before {
  content: "🟡";
  font-size: 14px;
}

.risk-tag.low {
  background: var(--success-50);
  color: var(--success-600);
  border: 1px solid var(--success-100);
}

.risk-tag.low::before {
  content: "🟢";
  font-size: 14px;
}

.page-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray-500);
}

/* ============================================
   Section Cards
   ============================================ */
.section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-600);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 12px;
}

/* Card variants */
.card.info {
  background: var(--primary-50);
  border-color: var(--primary-100);
}

.card.warning {
  background: var(--warning-50);
  border-color: var(--warning-100);
}

.card.danger {
  background: var(--danger-50);
  border-color: var(--danger-100);
}

.card.success {
  background: var(--success-50);
  border-color: var(--success-100);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card.danger .card-title {
  color: var(--danger-700);
}

.card.warning .card-title {
  color: #92400e;
}

.card.info .card-title {
  color: var(--primary-700);
}

.card-content {
  font-size: 14px;
  color: var(--gray-700);
}

.card-content ul,
.card-content ol {
  padding-left: 20px;
}

.card-content li {
  margin-bottom: 4px;
}

/* ============================================
   Steps
   ============================================ */
.step {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.step:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-sm);
}

.step.done {
  background: var(--success-50);
  border-color: var(--success-100);
}

.step-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.15s ease;
  user-select: none;
  background: #fff;
}

.step-checkbox:hover {
  border-color: var(--primary-500);
}

.step.done .step-checkbox {
  background: var(--success-500);
  border-color: var(--success-500);
  color: #fff;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.step.done .step-title {
  text-decoration: line-through;
  color: var(--gray-500);
}

.step-desc {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
}

.step-desc strong {
  color: var(--gray-800);
}

.step-desc code {
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  color: var(--primary-700);
}

/* ============================================
   Collapsible
   ============================================ */
.collapsible {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  margin-bottom: 10px;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  background: var(--gray-50);
  transition: background 0.15s ease;
}

.collapsible-header:hover {
  background: var(--gray-100);
}

.collapsible-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapsible-toggle {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  color: var(--gray-400);
}

.collapsible.open .collapsible-toggle {
  transform: rotate(90deg);
}

.collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible.open .collapsible-body {
  max-height: 2000px;
}

.collapsible-body-inner {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.7;
}

/* ============================================
   Tables
   ============================================ */
.table-wrap {
  overflow-x: auto;
  margin: 8px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--gray-100);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody td:first-child {
  font-weight: 500;
  white-space: nowrap;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--primary-600);
  transition: width 0.3s ease;
  z-index: 100;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

.progress-info {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 12px;
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 48px;
  z-index: 5;
  display: flex;
  align-items: center;
}

.topbar-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

/* ============================================
   Language Switch
   ============================================ */
.lang-switch {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  overflow: hidden;
  margin-left: auto;
}

.lang-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.lang-btn + .lang-btn {
  border-left: 1px solid var(--gray-200);
}

.lang-btn:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.lang-btn.active {
  background: var(--primary-600);
  color: #fff;
}

/* ============================================
   Home / Overview Page
   ============================================ */
.home-intro {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary-50) 0%, #fff 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-100);
}

.task-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.task-card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.task-card-icon.blue {
  background: var(--primary-50);
  color: var(--primary-600);
}

.task-card-icon.red {
  background: var(--danger-50);
  color: var(--danger-600);
}

.task-card-body {
  flex: 1;
  min-width: 0;
}

.task-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-card-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

.task-card-arrow {
  color: var(--gray-400);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 4px;
}

/* ============================================
   Callout / Tip
   ============================================ */
.tip-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-100);
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.code-inline {
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--primary-700);
}

/* ============================================
   Phase Blocks (template publish flow)
   ============================================ */
.phase-block {
  margin-bottom: 18px;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, var(--primary-50) 0%, #fff 100%);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.phase-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 3px 10px;
  background: var(--primary-600);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: 1px;
}

.phase-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}

.phase-block .step {
  margin-left: 10px;
  border-left: 3px solid var(--gray-200);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.phase-block .step:hover {
  border-left-color: var(--primary-300);
}

.phase-block .step.done {
  border-left-color: var(--success-500);
}

@media (max-width: 768px) {
  .phase-block .step {
    margin-left: 0;
  }
}

/* ============================================
   Step Screenshots
   ============================================ */
.step-screenshots {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.step-screenshots.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.step-screenshots.cols-1 {
  grid-template-columns: 1fr;
}

.screenshot {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-50);
  cursor: zoom-in;
  transition: all 0.2s ease;
}

.screenshot:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-caption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--gray-600);
  background: #fff;
  border-top: 1px solid var(--gray-100);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: #fff;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.step.has-images {
  /* Slight visual adjustment */
}

/* ============================================
   Footer Nav
   ============================================ */
.footer-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.footer-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
  transition: all 0.15s ease;
  font-family: inherit;
}

.footer-nav-btn:hover:not(:disabled) {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.footer-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-nav-btn .btn-label {
  font-weight: 600;
}

/* ============================================
   Utility
   ============================================ */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }

.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger-600); font-weight: 600; }
.text-success { color: var(--success-600); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: 280px;
    z-index: 100;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main {
    padding: 24px 20px 60px;
    max-width: 100%;
  }

  .topbar {
    padding: 10px 16px;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    margin-right: 8px;
  }

  .page-title {
    font-size: 22px;
  }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .hide-on-mobile {
    display: none;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}
