@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-soft: #f3f4f5;
  --surface-muted: #edf1f6;
  --line: #d7dce6;
  --line-strong: #c2cad8;
  --text: #1f2937;
  --muted: #5f6b7a;
  --primary: #005bbf;
  --primary-strong: #1a73e8;
  --primary-soft: #e8f1ff;
  --success: #117a44;
  --success-soft: #e6f6ee;
  --warning: #9a6700;
  --warning-soft: #fff3db;
  --danger: #bc2f2a;
  --danger-soft: #fdecec;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top, rgba(26, 115, 232, 0.07), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 30%, var(--bg) 100%);
  zoom: var(--page-zoom, 1);
}

button,
input,
select,
a {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}

.container {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(248, 249, 250, 0.92);
  border-bottom: 1px solid rgba(194, 202, 216, 0.7);
}

.topbar-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #111827;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.97rem;
  font-weight: 600;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
}

.nav-link.is-active {
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-note {
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.zoom-control button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.zoom-control button:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.zoom-control button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.top-cta,
.primary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.top-cta:hover,
.primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.primary:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary,
.result-actions a,
.history-actions button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.secondary:hover,
.result-actions a:hover,
.history-actions button:hover {
  border-color: var(--primary-strong);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.page {
  padding: 34px 0 88px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
  align-items: start;
  gap: 28px;
  min-height: calc(100vh - 126px);
}

.hero-copy {
  display: grid;
  gap: 16px;
  justify-items: start;
  text-align: left;
  padding-top: 18px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.45rem, 5.1vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #111827;
}

.hero-copy p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.45vw, 1.13rem);
  line-height: 1.8;
}

.hero-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.hero-badge span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(0, 91, 191, 0.16);
  border-radius: 999px;
  background: rgba(232, 241, 255, 0.72);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-points {
  width: min(100%, 560px);
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.hero-points span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(215, 220, 230, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.hero-points strong {
  color: var(--text);
  white-space: nowrap;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(194, 202, 216, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
}

.hero-stats strong {
  color: var(--primary);
  font-size: 1.05rem;
}

.quota-card {
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(194, 202, 216, 0.75);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 255, 0.92) 100%);
  box-shadow: var(--shadow-sm);
}

.quota-copy {
  display: grid;
  gap: 6px;
  text-align: left;
}

.quota-copy strong {
  font-size: 1.05rem;
}

.quota-copy p {
  max-width: none;
  font-size: 0.92rem;
  line-height: 1.6;
}

.quota-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.quota-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.quota-pill.is-member {
  background: var(--success-soft);
  color: var(--success);
}

.quota-pill.is-limit {
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.auth-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(194, 202, 216, 0.75);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.auth-head h2 {
  margin: 6px 0 0;
  font-size: 1.35rem;
  line-height: 1.35;
}

.auth-close {
  min-width: 84px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.auth-send-btn {
  min-width: 132px;
}

.auth-actions {
  justify-content: flex-end;
}

.workspace {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 104px;
}

.workspace-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.workspace-label span {
  color: var(--primary);
  font-weight: 900;
}

.workspace-label strong {
  color: var(--text);
  font-size: 0.94rem;
}

.workspace-panel {
  display: none;
  padding: 18px;
  border: 1px solid rgba(194, 202, 216, 0.75);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-panel.is-active {
  display: block;
}

.workspace-frame {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.workspace-side,
.panel-shell {
  display: grid;
  gap: 16px;
}

.workspace-side {
  align-content: start;
}

.workspace-side .actions {
  justify-content: center;
}

.workspace-side .status {
  width: min(100%, 720px);
  justify-self: center;
}

.section-head,
.section-title {
  display: grid;
  gap: 8px;
}

.section-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head h2,
.section-title h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  line-height: 1.3;
}

.section-title p,
.tool-head p,
.dropzone small,
.mini-dropzone small,
.file-meta small,
.result-meta,
.result-note,
.empty-state p,
.history-item p {
  color: var(--muted);
  line-height: 1.7;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dropzone,
.mini-dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 46px 24px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  text-align: center;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.compact-dropzone {
  padding-block: 52px;
}

.mini-dropzone {
  padding: 24px 18px;
  margin-top: 8px;
}

.dropzone:hover,
.dropzone.is-dragging,
.mini-dropzone:hover,
.mini-dropzone.is-dragging {
  border-color: var(--primary-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.dropzone-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
}

.dropzone strong {
  font-size: clamp(1.35rem, 2.4vw, 1.72rem);
  font-weight: 800;
}

.dropzone-or {
  color: var(--muted);
  font-size: 1rem;
}

.dropzone-button {
  min-width: 152px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.file-card,
.stack-card,
.result-card,
.history-item,
.empty-state,
.tool-card,
.pdf-tool-card {
  border: 1px solid rgba(194, 202, 216, 0.75);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.file-card,
.stack-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.file-card-inline {
  width: min(100%, 360px);
  margin-top: 2px;
  padding: 14px 16px;
  border-radius: 16px;
  text-align: left;
}

.file-card-inline.is-empty {
  display: none;
}

.file-card-inline .file-meta strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.file-card-inline .file-meta small {
  font-size: 0.88rem;
}

.file-card-inline .file-ext {
  min-width: 64px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.file-meta {
  display: grid;
  gap: 4px;
}

.meta-kicker {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.file-ext {
  min-width: 76px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: center;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.target-picker {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(194, 202, 216, 0.75);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  box-shadow: var(--shadow-sm);
}

.target-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.target-picker-head strong {
  font-size: 1rem;
}

.target-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.target-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.target-chip:hover {
  border-color: var(--primary-strong);
  color: var(--primary);
}

.target-chip.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

.control-grid.narrow {
  grid-template-columns: minmax(0, 360px);
}

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

.field span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.field output,
.field select,
.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field output {
  display: flex;
  align-items: center;
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.actions,
.result-actions,
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.96rem;
  line-height: 1.6;
}

.status-idle {
  background: #f3f6fa;
  color: var(--muted);
}

.status-running {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.tools-section,
.result-section,
.history-section {
  margin-top: 64px;
}

.result-dock {
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(194, 202, 216, 0.75);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.result-dock .section-title {
  margin-bottom: 8px;
}

.result-dock .section-title h2 {
  font-size: 1rem;
}

.result-dock .section-title p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.result-dock .result-card {
  min-height: auto;
  padding: 14px;
  border-radius: 18px;
}

.result-dock .result-empty {
  min-height: 56px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(194, 202, 216, 0.9);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  text-align: center;
  font-size: 0.86rem;
}

.result-dock .result-actions {
  gap: 8px;
}

.result-dock .result-actions a {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 0.86rem;
}

.tools-section .section-title h2 {
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  line-height: 1.22;
}

.tools-section .section-title p {
  font-size: 0.82rem;
  line-height: 1.55;
}

.tools-section .section-title {
  gap: 5px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(26, 115, 232, 0.35);
  box-shadow: var(--shadow-md);
}

.tool-card.is-active {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(0, 91, 191, 0.16);
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
}

.tool-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

.tool-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.tone-red {
  background: #ffe9e8;
  color: #d9342b;
}

.tone-blue {
  background: #e7f1ff;
  color: #1b6fe0;
}

.tone-green {
  background: #e8f8ef;
  color: #198754;
}

.tone-lime {
  background: #ebf7e9;
  color: #409f4a;
}

.tone-amber {
  background: #fff1da;
  color: #c46a00;
}

.tone-violet {
  background: #f3eaff;
  color: #8c4ed6;
}

.pdf-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pdf-tool-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.pdf-tool-card.is-highlighted {
  border-color: rgba(26, 115, 232, 0.35);
  box-shadow: var(--shadow-md);
}

.tool-head strong {
  font-size: 1.1rem;
}

.tool-head p {
  margin: 8px 0 0;
}

.tool-controls {
  margin-top: 0;
}

.file-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-pill,
.empty-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.file-pill small,
.empty-chip {
  color: var(--muted);
}

.result-card,
.history-item,
.empty-state {
  padding: 22px;
}

.result-empty {
  margin: 0;
  color: var(--muted);
}

.result-compact-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.result-success-dot {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #12803a;
  font-size: 0.78rem;
  font-weight: 800;
}

.result-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.result-meta {
  margin: 5px 0 0;
  font-size: 0.84rem;
}

.result-note {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.preview-box,
.path-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.preview-box strong,
.path-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.preview-box pre,
.path-box code {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
  line-height: 1.65;
}

.result-path-box code {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  line-height: 1.45;
}

.result-actions {
  margin-top: 12px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.history-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.history-item header strong {
  font-size: 1.05rem;
}

.history-item header p {
  margin: 6px 0 0;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-actions {
  margin-top: 16px;
}

.empty-state {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 180px;
}

.empty-state strong {
  font-size: 1.1rem;
}

.support-chip {
  display: inline-flex;
  margin: 4px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer {
  border-top: 1px solid rgba(194, 202, 216, 0.75);
  background: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--blue-strong);
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 126, 229, 0.08), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 55%);
  color: var(--text);
}

.legal-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 34px;
}

.legal-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

.legal-card h2 {
  margin: 30px 0 12px;
  font-size: 1.22rem;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.legal-card ul {
  padding-left: 1.2em;
}

.legal-back {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--blue-strong);
  font-weight: 900;
  text-decoration: none;
}

.legal-back:hover {
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    justify-items: center;
    text-align: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .workspace {
    position: static;
  }

  .workspace-frame,
  .pdf-tool-grid,
  .tool-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .topbar-inner,
  .section-title-row,
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav,
  .top-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .brand {
    text-align: center;
  }

  .page {
    padding-top: 30px;
  }

  .workspace-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .dropzone {
    padding: 42px 18px;
  }

  .auth-head,
  .auth-code-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .auth-actions {
    justify-content: stretch;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 20px, 100%);
  }

  .nav-link,
  .top-cta,
  .primary,
  .secondary,
  .result-actions a,
  .history-actions button {
    width: 100%;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy h1 {
    max-width: none;
  }

  .hero-stats,
  .actions,
  .result-actions,
  .history-actions {
    flex-direction: column;
  }

  .quota-card {
    flex-direction: column;
    align-items: stretch;
  }

  .quota-side {
    justify-items: stretch;
  }

  .file-card,
  .stack-card,
  .history-item header {
    flex-direction: column;
    align-items: stretch;
  }

  .file-ext,
  .history-tag {
    align-self: flex-start;
  }
}
