:root {
  color-scheme: light;
  --ink: #2f261f;
  --muted: #7c6d5e;
  --paper: #fbf3e3;
  --paper-deep: #f0ddbd;
  --line: rgba(95, 70, 44, 0.2);
  --cinnabar: #a73528;
  --cinnabar-dark: #7f241c;
  --jade: #2f6b5f;
  --jade-dark: #214c44;
  --tea: #8d6b3f;
  --gold: #c49a55;
  --mist: #e8efe7;
  --shadow: 0 22px 60px rgba(61, 45, 25, 0.18);
  --shadow-soft: 0 12px 28px rgba(61, 45, 25, 0.12);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 10px;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", "Microsoft YaHei", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(167, 53, 40, 0.1), transparent 34%),
    linear-gradient(24deg, rgba(47, 107, 95, 0.12), transparent 46%),
    linear-gradient(180deg, #fff8e9 0%, #f4e2c4 48%, #e8d2ae 100%),
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(72, 48, 28, 0.042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 48, 28, 0.035) 1px, transparent 1px),
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 18px);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 90%);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  position: relative;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: #fff7ec;
  background: var(--cinnabar);
  border: 2px solid rgba(85, 22, 15, 0.4);
  box-shadow:
    inset 0 0 0 2px rgba(255, 245, 225, 0.18),
    0 9px 18px rgba(127, 36, 28, 0.18);
}

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

.ghost-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 248, 233, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(95, 70, 44, 0.08);
}

.ghost-button {
  appearance: none;
}

.hero,
.admin-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: stretch;
  min-height: clamp(430px, 66vh, 650px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 250, 238, 0.96) 0%, rgba(250, 237, 207, 0.86) 54%, rgba(217, 194, 147, 0.62) 100%),
    linear-gradient(145deg, rgba(47, 107, 95, 0.18), transparent 42%),
    radial-gradient(circle at 78% 18%, rgba(196, 154, 85, 0.34), transparent 30%),
    linear-gradient(135deg, #f6e6c7, #d9b97d);
  box-shadow: var(--shadow);
}

.hero::before,
.admin-hero::before {
  position: absolute;
  inset: 12px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(141, 107, 63, 0.22);
  border-radius: 6px;
}

.admin-hero {
  display: block;
  min-height: auto;
  padding: clamp(28px, 5vw, 54px);
  margin-bottom: 22px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 670px;
  padding: clamp(32px, 6vw, 72px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cinnabar);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: 4.8rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.admin-hero h1,
.download-content h1 {
  font-size: 3rem;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 2.05rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  margin-bottom: 28px;
  color: #5d4f42;
  font-size: 1.08rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.network-status {
  width: fit-content;
  max-width: 620px;
  margin: 18px 0 0;
  padding: 9px 12px;
  color: var(--jade-dark);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  line-height: 1.6;
  background: rgba(235, 247, 241, 0.82);
  border-left: 3px solid var(--jade);
}

.network-status.warning {
  color: var(--cinnabar-dark);
  background: rgba(255, 242, 229, 0.86);
  border-left-color: var(--cinnabar);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  color: #fff8ea;
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-dark));
  box-shadow: 0 12px 28px rgba(127, 36, 28, 0.24);
}

.secondary-button {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.95), rgba(245, 229, 195, 0.86));
  border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-link:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.compact {
  min-height: 40px;
  padding-inline: 16px;
}

.hero-art {
  position: relative;
  min-height: 360px;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(232, 239, 231, 0.62), rgba(47, 107, 95, 0.22)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
}

.hero-art::before {
  position: absolute;
  top: 17%;
  left: 13%;
  width: 160px;
  height: 280px;
  content: "";
  border-left: 2px solid rgba(47, 107, 95, 0.22);
  border-bottom: 2px solid rgba(47, 107, 95, 0.16);
  transform: skewX(-12deg);
}

.moon {
  position: absolute;
  top: 14%;
  right: 20%;
  width: 116px;
  aspect-ratio: 1;
  background: #fff2c8;
  border: 1px solid rgba(141, 107, 63, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(255, 235, 173, 0.72);
}

.scroll {
  position: absolute;
  right: clamp(32px, 9vw, 110px);
  bottom: 17%;
  z-index: 3;
  width: min(290px, 68%);
  min-height: 330px;
  padding: 48px 34px;
  background: linear-gradient(90deg, #e8cf9e, #fff3d9 11%, #f7e1b7 88%, #c69d62);
  border: 1px solid rgba(95, 70, 44, 0.28);
  box-shadow: 0 24px 48px rgba(75, 56, 32, 0.24);
}

.scroll::before,
.scroll::after {
  position: absolute;
  left: 50%;
  width: 112%;
  height: 24px;
  content: "";
  background: linear-gradient(90deg, #8d6b3f, #d2ad70, #8d6b3f);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll::before {
  top: -12px;
}

.scroll::after {
  bottom: -12px;
}

.scroll span {
  display: block;
  height: 10px;
  margin-bottom: 22px;
  background: rgba(95, 70, 44, 0.34);
}

.scroll span:nth-child(2) {
  width: 72%;
}

.scroll span:nth-child(3) {
  width: 86%;
}

.mountain {
  position: absolute;
  bottom: -12%;
  width: 72%;
  aspect-ratio: 1.7;
  background: rgba(47, 107, 95, 0.3);
  clip-path: polygon(0 100%, 42% 22%, 62% 58%, 78% 38%, 100% 100%);
}

.mountain-one {
  right: -8%;
}

.mountain-two {
  left: -18%;
  background: rgba(85, 107, 78, 0.22);
  transform: scale(1.12);
}

.workspace-grid,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  margin: 26px 0 52px;
  align-items: start;
}

.upload-panel,
.files-panel,
.login-panel,
.manager-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.92), rgba(244, 226, 192, 0.82)),
    rgba(255, 248, 234, 0.84);
  box-shadow: var(--shadow-soft);
}

.upload-panel,
.login-panel,
.manager-panel {
  padding: clamp(18px, 3vw, 28px);
}

.files-panel {
  padding: clamp(18px, 3vw, 26px);
}

.section-heading {
  margin-bottom: 20px;
}

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

.upload-form {
  display: grid;
  gap: 16px;
}

.share-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 14px;
  margin-top: 16px;
  padding: 15px;
  background:
    linear-gradient(135deg, rgba(47, 107, 95, 0.12), transparent 56%),
    rgba(255, 252, 244, 0.86);
  border: 1px solid rgba(95, 70, 44, 0.2);
  border-radius: var(--radius);
}

.share-result[hidden] {
  display: none;
}

.share-result-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.share-result-copy strong {
  font-size: 1.12rem;
}

.share-result-copy small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.link-copy input {
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: text;
  user-select: text;
}

.qr-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 250, 240, 0.8);
  border: 1px solid rgba(95, 70, 44, 0.18);
  border-radius: var(--radius);
}

.qr-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 120px;
  min-height: 120px;
}

.qr-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(95, 70, 44, 0.16);
  border-radius: var(--radius);
}

.qr-fallback {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 22px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(47, 107, 95, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.9), rgba(244, 230, 199, 0.72));
  border: 1px dashed rgba(95, 70, 44, 0.48);
  border-radius: var(--radius);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-zone.dragging {
  border-color: var(--cinnabar);
  background: rgba(255, 245, 226, 0.98);
  transform: translateY(-1px);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  color: #fff8ea;
  background: linear-gradient(180deg, var(--jade), var(--jade-dark));
  border: 1px solid rgba(33, 76, 68, 0.45);
  border-radius: 50%;
  font-size: 2.1rem;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(47, 107, 95, 0.18);
}

.drop-zone strong {
  font-size: 1.15rem;
}

.drop-zone small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.note-field,
.search-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.note-field input,
.note-field select,
.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.note-field input:focus,
.note-field select:focus,
.search-box input:focus {
  border-color: rgba(167, 53, 40, 0.55);
  box-shadow: 0 0 0 3px rgba(167, 53, 40, 0.1);
}

.note-field small {
  color: var(--tea);
  font-size: 0.78rem;
}

.share-settings {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
}

.access-gate,
.unlock-panel {
  display: grid;
  gap: 10px;
  padding: 16px 16px 16px 18px;
  color: var(--muted);
  background: rgba(255, 252, 244, 0.58);
  border-left: 3px solid var(--jade);
}

.access-gate strong,
.unlock-panel strong {
  color: var(--ink);
  font-size: 1rem;
}

.access-gate .secondary-button {
  width: fit-content;
  margin-top: 4px;
}

.access-gate.compact {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.access-gate.compact span:last-child {
  grid-column: 2;
}

.gate-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff8ea;
  background: var(--jade-dark);
  border-radius: 4px;
}

.unlock-panel {
  max-width: 520px;
  margin: 18px auto 20px;
  text-align: left;
}

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

.progress {
  overflow: hidden;
  height: 8px;
  background: rgba(95, 70, 44, 0.12);
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--cinnabar));
  transition: width 180ms ease;
}

.status-line {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.status-line.error {
  color: var(--cinnabar-dark);
}

.file-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.file-card,
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 17px;
  background:
    linear-gradient(90deg, rgba(255, 252, 244, 0.94), rgba(247, 233, 203, 0.86)),
    rgba(255, 252, 244, 0.78);
  border: 1px solid rgba(95, 70, 44, 0.18);
  border-left: 4px solid rgba(47, 107, 95, 0.54);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(95, 70, 44, 0.08);
}

.file-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}

.file-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: #fff8ea;
  background: linear-gradient(180deg, var(--jade), var(--jade-dark));
  border: 1px solid rgba(47, 107, 95, 0.22);
  border-radius: 50%;
}

.file-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.file-note {
  margin: 0 0 10px;
  color: #5f5348;
  line-height: 1.6;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-actions {
  min-width: 246px;
}

.download-link,
.share-button,
.state-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-width: 86px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 700;
  border: 0;
  white-space: nowrap;
}

.download-link {
  color: #fff8ea;
  background: linear-gradient(180deg, var(--jade), var(--jade-dark));
}

.share-button {
  color: var(--ink);
  background: linear-gradient(180deg, #fffaf0, #ead3a5);
  border: 1px solid rgba(95, 70, 44, 0.22);
}

.danger-button {
  color: #fff8ea;
  background: var(--cinnabar-dark);
  border: 0;
}

.state-button {
  color: var(--jade-dark);
  background: rgba(232, 239, 231, 0.92);
  border: 1px solid rgba(47, 107, 95, 0.34);
}

button:disabled,
.share-button:disabled,
.state-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.share-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 700;
}

.share-state.active {
  color: var(--jade-dark);
  background: rgba(47, 107, 95, 0.12);
}

.share-state.protected {
  color: #6b4d20;
  background: rgba(196, 154, 85, 0.18);
}

.share-state.revoked,
.share-state.expired {
  color: var(--cinnabar-dark);
  background: rgba(167, 53, 40, 0.12);
}

.empty-state {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(47, 107, 95, 0.08), transparent 58%),
    rgba(255, 252, 244, 0.72);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state .text-button {
  display: block;
  margin: 14px auto 0;
  padding: 7px 12px;
  color: var(--jade-dark);
  font-weight: 700;
  background: transparent;
  border: 1px solid rgba(47, 107, 95, 0.34);
  border-radius: var(--radius);
}

.empty-state .text-button:hover {
  color: #fff;
  background: var(--jade);
}

.admin-body .shell {
  width: min(1120px, calc(100% - 32px));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-grid article {
  padding: 14px;
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stats-grid span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--cinnabar-dark);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
}

.stats-grid small {
  color: var(--muted);
}

.login-panel {
  position: sticky;
  top: 16px;
}

.share-body {
  min-height: 100vh;
}

.share-shell {
  width: min(1040px, calc(100% - 32px));
}

.share-stage {
  display: grid;
  min-height: calc(100vh - 108px);
  padding-bottom: 48px;
  place-items: center;
}

.download-scroll {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr);
  width: 100%;
  min-height: 540px;
  border: 1px solid rgba(95, 70, 44, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(232, 239, 231, 0.86), rgba(255, 249, 236, 0.94) 42%, rgba(238, 214, 174, 0.86)),
    #f6e6c7;
  box-shadow: var(--shadow);
}

.download-scroll::before,
.download-scroll::after {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 12px;
  content: "";
  background: linear-gradient(90deg, var(--tea), var(--gold), var(--tea));
  border-radius: 999px;
}

.download-scroll::before {
  top: 18px;
}

.download-scroll::after {
  bottom: 18px;
}

.download-scene {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(47, 107, 95, 0.12)),
    rgba(232, 239, 231, 0.72);
}

.scene-moon {
  position: absolute;
  top: 70px;
  left: 50%;
  width: 112px;
  aspect-ratio: 1;
  background: #fff0bf;
  border: 1px solid rgba(141, 107, 63, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 48px rgba(255, 237, 182, 0.72);
  transform: translateX(-50%);
}

.scene-branch {
  position: absolute;
  top: 64px;
  left: -18px;
  width: 180px;
  height: 90px;
  border-top: 3px solid rgba(47, 107, 95, 0.45);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.scene-branch::before,
.scene-branch::after {
  position: absolute;
  content: "";
  width: 42px;
  height: 18px;
  background: rgba(167, 53, 40, 0.62);
  border-radius: 50% 0 50% 0;
}

.scene-branch::before {
  top: -14px;
  left: 74px;
  transform: rotate(24deg);
}

.scene-branch::after {
  top: 4px;
  left: 116px;
  transform: rotate(-16deg);
}

.scene-mountain {
  position: absolute;
  right: -16%;
  bottom: 0;
  width: 132%;
  height: 46%;
  background: linear-gradient(180deg, rgba(47, 107, 95, 0.26), rgba(47, 107, 95, 0.44));
  clip-path: polygon(0 100%, 21% 36%, 36% 64%, 52% 20%, 73% 72%, 88% 42%, 100% 100%);
}

.download-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(28px, 5vw, 64px);
}

.share-note {
  max-width: 560px;
  color: #5d4f42;
  font-size: 1.05rem;
  line-height: 1.8;
}

.download-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.download-facts div {
  padding: 14px;
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(95, 70, 44, 0.18);
  border-radius: var(--radius);
}

.download-facts dt {
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
}

.download-facts dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--cinnabar-dark);
  font-family: "Microsoft YaHei", sans-serif;
  font-weight: 800;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-main {
  min-width: 160px;
}

.preview-panel {
  display: grid;
  gap: 12px;
  margin: 6px 0 22px;
}

.preview-panel[hidden] {
  display: none;
}

.preview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.preview-heading h2 {
  font-size: 1.35rem;
}

.preview-body {
  overflow: hidden;
  min-height: 150px;
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(95, 70, 44, 0.18);
  border-radius: var(--radius);
}

.preview-image,
.preview-media {
  display: block;
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  background: rgba(47, 107, 95, 0.08);
}

.preview-frame {
  display: block;
  width: 100%;
  height: 390px;
  border: 0;
  background: #fffaf0;
}

.preview-audio {
  display: block;
  width: calc(100% - 28px);
  margin: 26px 14px;
}

.text-preview {
  max-height: 360px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #3b3027;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.preview-empty {
  display: grid;
  min-height: 150px;
  place-content: center;
  gap: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.preview-empty strong {
  color: var(--ink);
}

.share-page-qr {
  grid-template-columns: auto 1fr;
  justify-items: start;
  width: min(340px, 100%);
  margin-top: 16px;
}

.share-page-qr .qr-box {
  width: 88px;
  min-height: 88px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3.4rem;
  }

  .hero-art {
    min-height: 280px;
    order: -1;
  }

  .workspace-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .download-scroll {
    grid-template-columns: 1fr;
  }

  .download-scene {
    min-height: 220px;
  }

  .login-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .shell,
  .admin-body .shell {
    width: min(100% - 22px, 1180px);
  }

  .site-header,
  .section-heading.row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .ghost-link,
  .ghost-button,
  .search-box,
  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
  }

  .hero-copy {
    padding: 28px 22px 30px;
  }

  .hero-art {
    min-height: 230px;
  }

  .moon {
    top: 12%;
    right: 11%;
    width: 84px;
  }

  .scroll {
    right: 22px;
    bottom: 16%;
    width: 190px;
    min-height: 210px;
    padding: 34px 24px;
  }

  .file-card,
  .admin-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 1.72rem;
  }

  .download-link,
  .share-button,
  .state-button,
  .danger-button {
    width: 100%;
  }

  .file-actions,
  .admin-actions,
  .share-actions {
    width: 100%;
    min-width: 0;
  }

  .download-facts {
    grid-template-columns: 1fr;
  }

  .download-content {
    padding: 42px 22px 52px;
  }

  .preview-frame {
    height: 320px;
  }

  .share-page-qr {
    grid-template-columns: 1fr;
    justify-items: center;
  }

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

  .share-result,
  .link-copy,
  .share-settings {
    grid-template-columns: 1fr;
  }

  .qr-box {
    width: 150px;
  }
}

/* v4 admin enhancements */
.compact-text {
  max-width: 760px;
  margin-inline: auto;
  color: var(--muted);
}

.admin-heading-row,
.admin-top-buttons,
.admin-tools,
.bulk-bar,
.pagination-bar,
.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-heading-row,
.admin-tools,
.bulk-bar,
.pagination-bar {
  flex-wrap: wrap;
}

.admin-heading-row {
  justify-content: space-between;
}

.admin-top-buttons {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-tools {
  margin: 0 0 14px;
  padding: 12px;
  background: rgba(255, 252, 244, 0.58);
  border: 1px solid rgba(95, 70, 44, 0.14);
  border-radius: var(--radius);
}

.admin-search {
  flex: 1 1 260px;
}

.compact-field {
  flex: 0 1 160px;
  margin: 0;
}

.bulk-bar {
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(47, 107, 95, 0.08);
  border: 1px dashed rgba(47, 107, 95, 0.22);
  border-radius: var(--radius);
}

.check-line,
.row-check {
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.admin-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.admin-row-main {
  min-width: 0;
}

.admin-row.is-deleted {
  opacity: 0.86;
  border-left-color: rgba(127, 36, 28, 0.42);
  background: linear-gradient(90deg, rgba(248, 237, 229, 0.94), rgba(243, 220, 205, 0.78));
}

.row-check input,
.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--jade);
}

.hidden-link {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(95, 70, 44, 0.14);
  border-radius: 10px;
}

.share-state.deleted {
  color: #6d5f52;
  background: rgba(95, 70, 44, 0.12);
}

.pagination-bar {
  justify-content: center;
  margin: 18px 0 22px;
}

.password-panel {
  margin-top: 20px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.94), rgba(247, 233, 203, 0.78)),
    rgba(255, 252, 244, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.download-progress {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .admin-row {
    grid-template-columns: 1fr;
  }

  .row-check {
    justify-self: start;
  }

  .admin-tools,
  .bulk-bar,
  .admin-top-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-tools > *,
  .bulk-bar > *,
  .admin-top-buttons > *,
  .pagination-bar > * {
    width: 100%;
  }

  .compact-field {
    flex-basis: auto;
  }

  .admin-actions .secondary-button,
  .admin-actions .download-link,
  .admin-actions .share-button,
  .admin-actions .state-button,
  .admin-actions .danger-button,
  .bulk-bar .secondary-button,
  .bulk-bar .danger-button {
    width: 100%;
  }
}


/* desktop-focused UI refinement */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 251, 241, 0.82);
  border: 1px solid rgba(95, 70, 44, 0.14);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(95, 70, 44, 0.06);
}

.top-actions .ghost-link,
.top-actions .ghost-button {
  backdrop-filter: blur(10px);
}

@media (min-width: 1024px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(167, 53, 40, 0.08), transparent 28%),
      radial-gradient(circle at top right, rgba(47, 107, 95, 0.10), transparent 24%),
      linear-gradient(180deg, #fff9ee 0%, #f7ead2 100%);
  }

  body::before {
    opacity: 0.58;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 82%);
  }

  .shell,
  .share-shell,
  .admin-body .shell {
    width: min(1320px, calc(100% - 56px));
  }

  .site-header {
    position: sticky;
    top: 0;
    padding: 18px 0;
    backdrop-filter: blur(14px);
  }

  .site-header::before {
    position: absolute;
    inset: 8px -18px;
    z-index: -1;
    content: "";
    background: rgba(255, 251, 241, 0.72);
    border: 1px solid rgba(95, 70, 44, 0.08);
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(61, 45, 25, 0.08);
  }

  .brand strong {
    font-size: 1.48rem;
  }

  .hero,
  .admin-hero {
    border-radius: var(--radius-lg);
  }

  .hero {
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    min-height: 410px;
  }

  .hero-copy {
    max-width: 760px;
    padding: 46px 52px;
  }

  h1 {
    margin-bottom: 14px;
    font-size: 3.65rem;
    line-height: 1.06;
  }

  .admin-hero h1,
  .download-content h1 {
    font-size: 2.7rem;
  }

  .hero-text,
  .share-note,
  .compact-text {
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.78;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-art {
    min-height: 100%;
  }

  .moon {
    width: 102px;
  }

  .scroll {
    right: clamp(34px, 8vw, 86px);
    bottom: 14%;
    width: min(250px, 66%);
    min-height: 280px;
    padding: 38px 28px;
    border-radius: 18px;
  }

  .workspace-grid {
    grid-template-columns: minmax(350px, 390px) minmax(0, 1fr);
    gap: 24px;
    margin: 22px 0 48px;
  }

  .upload-panel,
  .files-panel,
  .manager-panel,
  .login-panel,
  .download-scroll,
  .password-panel {
    border-radius: var(--radius-lg);
  }

  .upload-panel {
    position: sticky;
    top: 98px;
  }

  .files-panel {
    min-height: 100%;
  }

  .file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .file-card {
    min-height: 100%;
    align-items: start;
  }

  .file-actions {
    align-self: stretch;
  }

  .file-card,
  .admin-row {
    padding: 18px 18px 16px;
  }

  .download-link,
  .share-button,
  .state-button,
  .danger-button,
  .secondary-button,
  .primary-button,
  .ghost-link,
  .ghost-button {
    border-radius: 12px;
  }

  .admin-hero {
    padding: 30px 36px;
    margin-bottom: 18px;
  }

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

  .stats-grid article {
    padding: 16px;
  }

  .admin-layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 20px;
  }

  .login-panel {
    top: 96px;
  }

  .manager-panel {
    grid-column: 1 / -1;
  }

  .admin-tools,
  .bulk-bar {
    padding: 14px;
    border-radius: 16px;
  }

  .admin-actions {
    min-width: 0;
    max-width: 350px;
  }

  .download-scroll {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    min-height: 480px;
  }

  .download-content {
    padding: 48px 52px;
  }
}

@media (min-width: 1400px) {
  .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .admin-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px 14px;
    align-items: start;
  }

  .admin-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 34px;
  }
}


/* v5 refined ancient showcase style */
:root {
  --silk: #fffaf1;
  --silk-soft: rgba(255, 250, 241, 0.78);
  --rouge-soft: rgba(167, 53, 40, 0.10);
  --jade-soft: rgba(47, 107, 95, 0.12);
  --gold-soft: rgba(196, 154, 85, 0.18);
}

body {
  background:
    radial-gradient(circle at 13% 7%, rgba(167, 53, 40, 0.11), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(47, 107, 95, 0.13), transparent 26%),
    radial-gradient(circle at 42% 94%, rgba(196, 154, 85, 0.18), transparent 30%),
    linear-gradient(180deg, #fffaf0 0%, #f7ead2 49%, #ead6b5 100%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(167, 53, 40, 0.10) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 36%, rgba(47, 107, 95, 0.11) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 70%, rgba(196, 154, 85, 0.12) 0 2px, transparent 3px);
  background-size: 180px 180px, 220px 220px, 260px 260px;
  opacity: 0.42;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 88%);
}

.seal {
  border-radius: 12px 4px 12px 4px;
  transform: rotate(-2deg);
}

.hero,
.admin-hero,
.download-scroll,
.upload-panel,
.files-panel,
.login-panel,
.manager-panel {
  position: relative;
}

.hero::after,
.admin-hero::after,
.download-scroll::after,
.upload-panel::after,
.files-panel::after,
.manager-panel::after {
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 90px;
  height: 20px;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(141, 107, 63, 0.18), transparent),
    radial-gradient(circle at 50% 50%, rgba(167, 53, 40, 0.18) 0 3px, transparent 4px);
  background-size: 100% 1px, 24px 20px;
  background-repeat: no-repeat, repeat-x;
  background-position: center, center;
  opacity: 0.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  width: 18px;
  height: 1px;
  content: "";
  background: currentColor;
  opacity: 0.62;
}

.hero {
  background:
    linear-gradient(90deg, rgba(255, 251, 243, 0.98) 0%, rgba(250, 239, 217, 0.88) 52%, rgba(232, 207, 163, 0.70) 100%),
    radial-gradient(circle at 82% 16%, rgba(255, 238, 184, 0.70), transparent 26%),
    radial-gradient(circle at 72% 78%, rgba(47, 107, 95, 0.20), transparent 34%),
    linear-gradient(135deg, #f8e8c9, #d9b77b);
}

.refined-art {
  overflow: hidden;
}

.cloud,
.lotus {
  position: absolute;
  pointer-events: none;
}

.cloud {
  height: 26px;
  background: rgba(255, 250, 238, 0.76);
  border: 1px solid rgba(141, 107, 63, 0.08);
  border-radius: 999px;
  box-shadow: 0 16px 32px rgba(95, 70, 44, 0.08);
}

.cloud::before,
.cloud::after {
  position: absolute;
  bottom: 5px;
  content: "";
  background: inherit;
  border-radius: 50%;
}

.cloud::before {
  left: 20px;
  width: 34px;
  height: 34px;
}

.cloud::after {
  right: 18px;
  width: 46px;
  height: 46px;
}

.cloud-one {
  top: 22%;
  left: 10%;
  width: 138px;
}

.cloud-two {
  right: 10%;
  bottom: 25%;
  width: 116px;
  opacity: 0.72;
}

.lotus {
  width: 72px;
  height: 36px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(47, 107, 95, 0.36), transparent 56%),
    radial-gradient(ellipse at 50% 0%, rgba(167, 53, 40, 0.44), transparent 62%);
  border-radius: 50% 50% 42% 42%;
  filter: drop-shadow(0 14px 18px rgba(95, 70, 44, 0.10));
}

.lotus::before,
.lotus::after {
  position: absolute;
  bottom: 4px;
  width: 34px;
  height: 28px;
  content: "";
  background: rgba(167, 53, 40, 0.24);
  border-radius: 50% 50% 40% 40%;
}

.lotus::before {
  left: 8px;
  transform: rotate(-28deg);
}

.lotus::after {
  right: 8px;
  transform: rotate(28deg);
}

.lotus-one {
  right: 18%;
  bottom: 8%;
}

.lotus-two {
  left: 16%;
  bottom: 18%;
  transform: scale(0.72);
  opacity: 0.72;
}

.showcase-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

.showcase-band article {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  padding: 20px 20px 18px 78px;
  background:
    linear-gradient(135deg, rgba(255, 252, 245, 0.94), rgba(244, 229, 198, 0.74)),
    rgba(255, 250, 241, 0.88);
  border: 1px solid rgba(95, 70, 44, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(61, 45, 25, 0.08);
}

.showcase-band article::after {
  position: absolute;
  top: -26px;
  right: -24px;
  width: 94px;
  height: 94px;
  content: "";
  background: radial-gradient(circle, rgba(196, 154, 85, 0.26), transparent 65%);
  border-radius: 50%;
}

.showcase-band span {
  position: absolute;
  left: 20px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 54px;
  color: #fff8ea;
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-dark));
  border-radius: 14px 14px 20px 20px;
  box-shadow: 0 12px 22px rgba(127, 36, 28, 0.18);
}

.showcase-band strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.showcase-band small {
  display: block;
  color: var(--muted);
  line-height: 1.7;
}

.upload-panel,
.files-panel,
.login-panel,
.manager-panel,
.password-panel {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(246, 232, 205, 0.82)),
    linear-gradient(135deg, rgba(47, 107, 95, 0.06), transparent 44%),
    rgba(255, 248, 234, 0.88);
}

.drop-zone {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 246, 223, 0.86), transparent 34%),
    linear-gradient(135deg, rgba(47, 107, 95, 0.10), transparent 52%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(246, 231, 201, 0.74));
}

.file-card,
.admin-row {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.file-card:hover,
.admin-row:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 53, 40, 0.26);
  box-shadow: 0 16px 34px rgba(95, 70, 44, 0.12);
}

.file-mark {
  border-radius: 12px 4px 12px 4px;
}

.download-scroll {
  background:
    linear-gradient(90deg, rgba(232, 239, 231, 0.88), rgba(255, 250, 239, 0.98) 45%, rgba(240, 218, 182, 0.90)),
    radial-gradient(circle at 72% 18%, rgba(255, 238, 184, 0.52), transparent 25%),
    #f6e6c7;
}

.refined-download-scene {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(47, 107, 95, 0.10)),
    radial-gradient(circle at 52% 18%, rgba(255, 239, 185, 0.44), transparent 20%),
    rgba(232, 239, 231, 0.76);
}

.scene-river {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 15%;
  height: 46px;
  background:
    repeating-linear-gradient(170deg, rgba(255, 255, 255, 0.44) 0 2px, transparent 2px 18px),
    linear-gradient(90deg, rgba(47, 107, 95, 0.18), rgba(255, 255, 255, 0.36), rgba(47, 107, 95, 0.22));
  border-radius: 50%;
  transform: rotate(-8deg);
}

.scene-pavilion {
  position: absolute;
  left: 48%;
  bottom: 31%;
  width: 92px;
  height: 74px;
  transform: translateX(-50%);
}

.scene-pavilion::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 92px;
  height: 22px;
  content: "";
  background: linear-gradient(90deg, transparent 0 7%, rgba(127, 36, 28, 0.82) 7% 93%, transparent 93% 100%);
  clip-path: polygon(0 100%, 18% 22%, 82% 22%, 100% 100%);
}

.scene-pavilion::after {
  position: absolute;
  left: 18px;
  top: 22px;
  width: 56px;
  height: 52px;
  content: "";
  background:
    linear-gradient(90deg, rgba(95, 70, 44, 0.42) 0 4px, transparent 4px 26px, rgba(95, 70, 44, 0.42) 26px 30px, transparent 30px 52px, rgba(95, 70, 44, 0.42) 52px 56px),
    rgba(255, 248, 231, 0.58);
  border-bottom: 5px solid rgba(127, 36, 28, 0.56);
}

.scene-petals {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 28% 30%, rgba(167, 53, 40, 0.46) 0 3px, transparent 4px),
    radial-gradient(ellipse at 66% 24%, rgba(167, 53, 40, 0.34) 0 3px, transparent 4px),
    radial-gradient(ellipse at 74% 56%, rgba(167, 53, 40, 0.30) 0 3px, transparent 4px),
    radial-gradient(ellipse at 22% 66%, rgba(167, 53, 40, 0.28) 0 3px, transparent 4px);
  background-size: 120px 120px, 160px 160px, 190px 190px, 150px 150px;
  opacity: 0.72;
}

.download-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.download-tags span {
  padding: 5px 10px;
  color: var(--jade-dark);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(232, 239, 231, 0.74);
  border: 1px solid rgba(47, 107, 95, 0.16);
  border-radius: 999px;
}

.refined-admin-hero {
  background:
    linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(243, 226, 194, 0.86)),
    radial-gradient(circle at 90% 14%, rgba(196, 154, 85, 0.20), transparent 24%);
}

@media (min-width: 1024px) {
  .showcase-band {
    margin-bottom: 2px;
  }

  .hero-tags span,
  .download-tags span {
    backdrop-filter: blur(8px);
  }

  .download-scroll {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .showcase-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .showcase-band {
    display: none;
  }

  .hero::after,
  .admin-hero::after,
  .download-scroll::after,
  .upload-panel::after,
  .files-panel::after,
  .manager-panel::after {
    display: none;
  }

  .cloud,
  .lotus,
  .scene-pavilion,
  .scene-river,
  .scene-petals {
    display: none;
  }
}

/* v6 layout correction: separate decorations from layout layers */
.hero-copy,
.hero-art,
.upload-panel,
.files-panel,
.login-panel,
.manager-panel,
.password-panel,
.download-content,
.download-scene,
.admin-row-main {
  min-width: 0;
}

.hero-copy,
.hero-art,
.admin-hero > *,
.upload-panel > *,
.files-panel > *,
.login-panel > *,
.manager-panel > *,
.password-panel > *,
.download-content > * {
  position: relative;
  z-index: 1;
}

.hero::after,
.admin-hero::after,
.upload-panel::after,
.files-panel::after,
.manager-panel::after {
  z-index: 0;
}

/* Keep the original download scroll rods; the refined ornament must not replace the bottom rod. */
.download-scroll::before,
.download-scroll::after {
  position: absolute;
  left: 18px;
  right: 18px;
  z-index: 2;
  width: auto;
  height: 12px;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, var(--tea), var(--gold), var(--tea));
  border-radius: 999px;
  opacity: 1;
}

.download-scroll::before {
  top: 18px;
}

.download-scroll::after {
  top: auto;
  bottom: 18px;
}

.download-scene,
.refined-art {
  overflow: hidden;
}

.download-content {
  z-index: 3;
}

.preview-body,
.text-preview,
.hidden-link,
.share-result-copy,
.file-title strong,
.download-facts dd,
.share-note,
.status-line {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Prevent desktop decorative blocks from crowding medium screens. */
@media (max-width: 1023px) {
  .showcase-band {
    display: none;
  }

  .hero-tags {
    margin-bottom: 0;
  }

  .cloud,
  .lotus,
  .scene-pavilion,
  .scene-river,
  .scene-petals {
    display: none;
  }

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

  .download-scroll::before,
  .download-scroll::after {
    left: 14px;
    right: 14px;
  }
}

@media (max-width: 760px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .download-tags {
    margin-top: 0;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span,
  .download-tags span {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .download-scroll::before,
  .download-scroll::after {
    display: none;
  }

  .hero-tags {
    display: none;
  }
}


/* v7 screenshot-based layout fix: avoid sticky overlap and desktop card squeezing */
@media (min-width: 1024px) {
  /* The sticky glass header was covering the showcase cards while scrolling on Windows. */
  .site-header {
    position: relative;
    top: auto;
    z-index: 20;
  }

  .site-header::before {
    inset: 8px -14px;
  }

  /* Keep the display cards fully visible and away from the header edge. */
  .showcase-band {
    margin: 22px 0 24px;
    scroll-margin-top: 24px;
  }

  .showcase-band article {
    min-height: 118px;
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .showcase-band span {
    top: 24px;
  }

  /* Align upload and archive panels at the same top line. */
  .workspace-grid {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
    align-items: start;
    margin-top: 0;
  }

  .upload-panel {
    position: static;
    top: auto;
    align-self: start;
  }

  .files-panel {
    align-self: start;
    min-height: 420px;
  }

  /* Avoid a single file becoming a narrow half-width tile. */
  .file-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  }

  .file-card {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .file-card > div:first-child {
    min-width: 0;
  }

  .file-actions {
    flex: 0 0 auto;
  }

  .file-card .download-link,
  .file-card .share-button {
    min-width: 92px;
  }

  .section-heading.row {
    align-items: start;
  }

  .search-box {
    width: min(260px, 34vw);
  }
}

/* Medium desktop and narrow laptop: make archive cards more comfortable. */
@media (min-width: 1024px) and (max-width: 1280px) {
  .shell,
  .share-shell,
  .admin-body .shell {
    width: min(1220px, calc(100% - 40px));
  }

  .workspace-grid {
    grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
    gap: 20px;
  }

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

  .file-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hero {
    min-height: 390px;
  }
}

/* Keep mobile behavior from the previous version. */
@media (max-width: 900px) {
  .site-header {
    position: relative;
  }

  .upload-panel {
    position: static;
  }
}

/* v8 settings and category management */
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  color: var(--jade-dark);
  font-weight: 700;
  background: rgba(47, 107, 95, 0.10);
  border: 1px solid rgba(47, 107, 95, 0.16);
  border-radius: 999px;
}

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

.settings-panel {
  overflow: hidden;
  background: rgba(255, 252, 244, 0.66);
  border: 1px solid rgba(95, 70, 44, 0.16);
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 10px 28px rgba(95, 70, 44, 0.06);
}

.settings-panel summary {
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(90deg, rgba(255, 252, 244, 0.9), rgba(239, 222, 189, 0.56));
}

.settings-form,
.category-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

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

.color-field input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.category-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.category-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(95, 70, 44, 0.14);
  border-radius: 14px;
}

.category-dot {
  width: 14px;
  height: 36px;
  background: var(--category-color, var(--jade));
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(47, 107, 95, 0.14);
}

.category-item strong,
.category-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-item small {
  margin-top: 3px;
  color: var(--muted);
}

@media (min-width: 1024px) {
  .site-header {
    position: relative;
    top: auto;
    z-index: 20;
  }

  .showcase-band {
    margin: 22px 0 24px;
  }

  .workspace-grid {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
    align-items: start;
    margin-top: 0;
  }

  .upload-panel {
    position: static;
    top: auto;
    align-self: start;
  }

  .file-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  }

  .file-card > div:first-child {
    min-width: 0;
  }

  .share-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .download-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  .file-list {
    grid-template-columns: 1fr;
  }

  .admin-subpanels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-subpanels,
  .settings-form,
  .category-form {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .category-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .category-item button {
    grid-column: 1 / -1;
    width: 100%;
  }
}
