@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@500;600;700&display=swap");

:root {
  --page: #edf3f1;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --ink: #20352f;
  --ink-soft: #536a62;
  --muted: #81928c;
  --line: rgba(54, 91, 80, 0.16);
  --line-strong: rgba(54, 91, 80, 0.28);
  --accent: #396f62;
  --accent-strong: #28564b;
  --accent-soft: #e0efea;
  --warm: #b77c45;
  --danger: #aa4352;
  --shadow: 0 24px 70px rgba(39, 77, 66, 0.11);
  --sans: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(225, 240, 234, 0.9), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(244, 232, 216, 0.75), transparent 26%),
    var(--page);
  font-family: var(--sans);
  line-height: 1.65;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

.room-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 250, 0.86);
  backdrop-filter: blur(18px);
}

.room-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.room-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--accent);
  background: white;
  font-size: 21px;
}

.room-brand small,
.room-brand strong {
  display: block;
}

.room-brand small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.room-brand strong {
  font-family: var(--serif);
  font-size: 18px;
}

.room-header nav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 40px);
}

.room-header nav a {
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
}

.room-header nav a[aria-current="page"] {
  color: var(--accent-strong);
  font-weight: 700;
}

.quiet-button,
.primary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  border-color: transparent;
  color: white;
  background: var(--accent);
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(57, 111, 98, 0.2);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px) 72px;
}

.room-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 34px;
  padding: clamp(54px, 8vw, 96px) 0 40px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.room-hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 760px;
  margin: 17px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.privacy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 23px;
}

.privacy-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.hero-status {
  min-width: 190px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(39, 77, 66, 0.07);
}

.hero-status span,
.hero-status strong,
.hero-status small {
  display: block;
}

.hero-status span,
.hero-status small {
  color: var(--muted);
  font-size: 11px;
}

.hero-status strong {
  margin: 3px 0;
  font-family: var(--serif);
  font-size: 22px;
}

.hero-status small + small {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.upload-panel,
.library-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.upload-panel {
  position: sticky;
  top: 94px;
  padding: 28px;
}

.panel-heading h2,
.library-toolbar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
}

.panel-heading > p:last-child {
  margin: 7px 0 22px;
  color: var(--ink-soft);
  font-size: 12px;
}

.drop-zone {
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  text-align: center;
  background: color-mix(in srgb, var(--accent-soft) 42%, white);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  cursor: pointer;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.drop-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 16px;
  color: var(--accent);
  background: white;
  font-size: 25px;
  box-shadow: 0 10px 24px rgba(39, 77, 66, 0.09);
}

.drop-zone strong {
  font-size: 14px;
}

.drop-zone small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.field {
  display: block;
  margin-top: 17px;
}

.field > span,
.access-field legend {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.field > span small {
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field textarea,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.field input,
.field textarea {
  padding: 11px 12px;
  border-radius: 12px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.access-field {
  min-width: 0;
  margin: 18px 0;
  padding: 0;
  border: 0;
}

.access-field label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 0;
  cursor: pointer;
}

.access-field input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.access-field strong,
.access-field small {
  display: block;
}

.access-field strong {
  font-size: 12px;
}

.access-field small {
  color: var(--muted);
  font-size: 10px;
}

.extract-status {
  align-items: center;
  gap: 8px;
  margin: -3px 0 12px;
  color: var(--accent);
  font-size: 11px;
}

.extract-status:not([hidden]) {
  display: flex;
}

.extract-status i,
.library-state .ph-circle-notch {
  animation: spin 1s linear infinite;
}

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

.form-message {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--accent);
}

.format-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
}

.format-note summary {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.format-note p {
  margin: 10px 0 0;
}

.library-panel {
  min-height: 620px;
  padding: 30px;
}

.library-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.search-box {
  position: relative;
  width: min(340px, 100%);
}

.search-box i {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  min-height: 44px;
  padding: 0 13px 0 39px;
  border-radius: 14px;
}

.folder-creator {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 19px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent-soft) 34%, white);
}

.folder-creator label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.folder-creator input {
  min-height: 38px;
  padding: 0 11px;
  border-radius: 10px;
}

.folder-creator .quiet-button {
  min-height: 38px;
  padding: 0 13px;
}

.folder-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.folder-filter {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: white;
  font-size: 11px;
}

.folder-filter.is-active {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

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

.file-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.file-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 22px;
}

.file-card[data-kind="image"] .file-icon {
  color: #7b5a91;
  background: #f0e9f4;
}

.file-card[data-kind="audio"] .file-icon,
.file-card[data-kind="video"] .file-icon {
  color: #9a693e;
  background: #f7ecdf;
}

.file-main {
  min-width: 0;
}

.file-main h3 {
  overflow: hidden;
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta,
.file-description,
.file-parse {
  color: var(--muted);
  font-size: 10px;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}

.file-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-parse {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.file-parse.is-ready {
  color: var(--accent);
}

.file-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.file-actions button,
.file-actions select {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: white;
  font-size: 10px;
}

.file-actions select {
  min-width: 0;
  flex: 1 1 120px;
}

.file-actions .file-folder-select {
  flex-basis: 145px;
}

.file-actions .delete-file {
  color: var(--danger);
}

.library-state {
  grid-column: 1 / -1;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.library-state > i {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 30px;
}

.library-state strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
}

.library-state span {
  max-width: 480px;
  margin-top: 4px;
  font-size: 11px;
}

dialog {
  width: min(1000px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 30px 90px rgba(25, 52, 44, 0.24);
}

dialog::backdrop {
  background: rgba(22, 39, 34, 0.48);
  backdrop-filter: blur(6px);
}

.preview-shell > header,
.preview-shell > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
}

.preview-shell > header {
  border-bottom: 1px solid var(--line);
}

.preview-shell > footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.preview-shell h2 {
  margin: 1px 0 0;
  font-family: var(--serif);
  font-size: 19px;
}

.preview-shell header small {
  color: var(--muted);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.preview-body {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: #f4f6f5;
}

.preview-body iframe {
  width: 100%;
  height: min(70vh, 680px);
  border: 0;
}

.preview-body img,
.preview-body video {
  max-width: 100%;
  max-height: min(70vh, 680px);
}

.preview-body audio {
  width: min(560px, calc(100% - 40px));
}

.preview-placeholder {
  max-width: 520px;
  padding: 40px;
  color: var(--ink-soft);
  text-align: center;
}

.preview-placeholder i {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 44px;
}

@media (max-width: 980px) {
  .room-header nav {
    display: none;
  }

  .room-layout {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .room-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
    min-height: 66px;
    padding: 9px 14px;
  }

  .room-header .quiet-button {
    justify-self: end;
  }

  .room-header .quiet-button span {
    display: none;
  }

  main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .room-hero {
    grid-template-columns: 1fr;
    padding-top: 46px;
  }

  .hero-status {
    min-width: 0;
  }

  .upload-panel,
  .library-panel {
    padding: 21px 17px;
    border-radius: 22px;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .folder-creator {
    grid-template-columns: 1fr auto;
  }

  .folder-creator label {
    grid-column: 1 / -1;
  }

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

  .preview-shell > footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
