﻿:root {
  --bg: #f4efe8;
  --panel: rgba(255, 251, 245, 0.88);
  --panel-strong: #fffdfa;
  --line: rgba(84, 58, 35, 0.12);
  --line-strong: rgba(84, 58, 35, 0.22);
  --text: #2f241d;
  --muted: #7c6658;
  --accent: #bb5a2a;
  --accent-dark: #8b3513;
  --shadow: 0 24px 60px rgba(90, 56, 24, 0.15);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(250, 190, 134, 0.5), transparent 26%),
    radial-gradient(circle at top right, rgba(205, 120, 73, 0.24), transparent 24%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
}

.preview-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.sidebar,
.viewer-shell {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sidebar {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar h1 {
  margin: -8px 0 0;
  line-height: 1.05;
  font-size: clamp(28px, 3vw, 42px);
}

.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.upload-card {
  position: relative;
  min-height: 164px;
  padding: 20px;
  border: 1px dashed rgba(84, 58, 35, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.98), rgba(255, 240, 225, 0.95));
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.upload-card.drag-active {
  border-color: rgba(187, 90, 42, 0.6);
  box-shadow: 0 18px 40px rgba(187, 90, 42, 0.16);
  background: linear-gradient(180deg, rgba(255, 245, 233, 1), rgba(255, 233, 212, 0.96));
  transform: translateY(-2px);
}

.upload-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-card strong {
  font-size: 18px;
}

.upload-card span,
.upload-card small {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 700;
}

select,
button {
  font: inherit;
}

select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 14px 16px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  border-radius: 16px;
  padding: 14px 16px;
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-btn {
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #d56c3c, #ab4317);
  box-shadow: 0 16px 36px rgba(171, 67, 23, 0.24);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.ghost-btn.active {
  background: linear-gradient(135deg, rgba(213, 108, 60, 0.18), rgba(171, 67, 23, 0.18));
  border-color: rgba(171, 67, 23, 0.28);
}

.wide {
  grid-column: 1 / -1;
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.info-card span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-card strong {
  font-size: 15px;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.file-list li {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  word-break: break-word;
}

.file-list .selected {
  border-color: var(--line-strong);
  background: rgba(255, 244, 233, 0.88);
}

.tips {
  color: var(--muted);
  font-size: 13px;
}

.tips p {
  margin: 0 0 6px;
}

.viewer-shell {
  position: relative;
  min-height: calc(100vh - 40px);
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 249, 241, 0.95), rgba(243, 230, 216, 0.92)),
    linear-gradient(180deg, #f4ece2, #ebdfd0);
}

.viewer {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 40px);
}

.viewer canvas {
  display: block;
}

.viewer-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  display: flex;
  pointer-events: none;
}

.viewer-overlay.top {
  top: 18px;
}

.viewer-overlay.bottom {
  bottom: 18px;
}

.viewer-overlay span {
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(84, 58, 35, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  color: var(--text);
  word-break: break-word;
}

@media (max-width: 980px) {
  .preview-page {
    grid-template-columns: 1fr;
  }

  .viewer-shell,
  .viewer {
    min-height: 62vh;
  }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.toplink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.range-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.recent-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.viewer-shell.theme-studio {
  background:
    radial-gradient(circle at top, rgba(250, 250, 250, 0.98), rgba(234, 236, 239, 0.96)),
    linear-gradient(180deg, #eceef1, #dfe3e8);
}

.viewer-shell.theme-dark {
  background:
    radial-gradient(circle at top, rgba(71, 77, 87, 0.92), rgba(29, 31, 37, 0.98)),
    linear-gradient(180deg, #2f333b, #191b20);
}

.viewer-shell.theme-dark .viewer-overlay span {
  background: rgba(36, 40, 46, 0.72);
  color: #f7efe6;
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 980px) {
  .field-grid,
  .actions {
    grid-template-columns: 1fr;
  }
}
