/* =========================================================
   文件驿站 — DESERVE FILES
   A small, static file library.
   ========================================================= */

:root {
  --bg: #f4f1e8;
  --bg-elevated: #f9f6ee;
  --surface: #fffdf8;
  --surface-subtle: #f7f3ea;
  --surface-hover: #fbf8f0;
  --ink: #1a2b24;
  --ink-strong: #122019;
  --muted: #727b73;
  --muted-strong: #4f5b53;
  --line: #e1dccf;
  --line-strong: #d2ccbd;
  --accent: #173c33;
  --accent-hover: #0e2e26;
  --accent-contrast: #fffdf8;
  --signal: #d9eb75;
  --signal-soft: #eff4cf;
  --clay: #b65e40;
  --blue: #55747d;
  --focus: #718e3c;
  --stage: #101411;
  --page-toast-bg: #173c33;
  --page-toast-fg: #f7f4ec;
  --shadow-card: 0 22px 70px -56px rgba(23, 60, 51, 0.48);
  --shadow-soft: 0 10px 34px -26px rgba(23, 60, 51, 0.24);
  --shadow-search: 0 14px 40px -30px rgba(23, 60, 51, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Iowan Old Style", "Baskerville", "Times New Roman", "Songti SC",
    "STSong", "SimSun", serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Consolas", "Liberation Mono",
    monospace;
  --header-height: 76px;
  --gutter: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #101511;
  --bg-elevated: #151b16;
  --surface: #181f19;
  --surface-subtle: #1b231c;
  --surface-hover: #1d261f;
  --ink: #edf0e8;
  --ink-strong: #fbfdf7;
  --muted: #98a39a;
  --muted-strong: #c0c9c1;
  --line: #29322b;
  --line-strong: #38443a;
  --accent: #b7dfca;
  --accent-hover: #cee9da;
  --accent-contrast: #112019;
  --signal: #d9eb75;
  --signal-soft: #30391e;
  --clay: #de9275;
  --blue: #91b5bd;
  --focus: #d9eb75;
  --stage: #0a0d0b;
  --page-toast-bg: #e6eadf;
  --page-toast-fg: #122019;
  --shadow-card: 0 26px 80px -54px rgba(0, 0, 0, 0.86);
  --shadow-soft: 0 10px 34px -24px rgba(0, 0, 0, 0.62);
  --shadow-search: 0 18px 46px -30px rgba(0, 0, 0, 0.72);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 300px;
  background:
    radial-gradient(circle at 88% -6%, rgba(217, 235, 117, 0.13), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.24s ease, color 0.24s ease;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--signal);
  color: #16251f;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin-top: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  width: min(1180px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.section-label {
  margin: 0;
  color: var(--clay);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.section-label.light {
  color: var(--signal);
}

.tiny-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(217, 235, 117, 0.14);
}

/* =========================================================
   Header
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-height);
}

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

.brand-mark {
  display: grid;
  flex: none;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 12px;
  box-shadow: 0 5px 16px -9px rgba(23, 60, 51, 0.5);
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-glyph {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-mark.small .brand-glyph {
  font-size: 17px;
}

.brand-words {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  line-height: 1.15;
}

.brand-name {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-en {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.17em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-link {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted-strong);
  font-size: 13px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.nav-divider {
  width: 1px;
  height: 19px;
  margin: 0 6px;
  background: var(--line);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

.customize-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 12px;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.customize-button .icon {
  width: 15px;
  height: 15px;
}

.customize-button:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink);
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 68px;
}

.hero::before {
  position: absolute;
  top: -240px;
  right: -170px;
  width: 620px;
  height: 620px;
  border: 1px solid color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.hero::after {
  position: absolute;
  top: -60px;
  right: 90px;
  width: 380px;
  height: 380px;
  border: 1px solid color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.78fr);
  align-items: center;
  gap: clamp(44px, 7vw, 92px);
}

.hero-copy {
  max-width: 700px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 23px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 23%, transparent);
}

.eyebrow-rule {
  width: 34px;
  height: 1px;
  background: var(--line-strong);
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 25px;
  color: var(--ink-strong);
  font-size: clamp(2.85rem, 5.5vw, 5.1rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.08;
  text-wrap: balance;
}

.highlight {
  display: inline;
  padding: 0.015em 0.08em 0.055em;
  border-radius: 6px;
  background: var(--signal);
  color: #17251e;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lede {
  max-width: 540px;
  margin: 0 0 7px;
  color: var(--muted-strong);
  font-size: 16.5px;
  line-height: 1.8;
}

.lede-detail {
  margin: 0 0 29px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.search-box {
  display: flex;
  width: 100%;
  max-width: 620px;
  height: 60px;
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-search);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent),
    var(--shadow-search);
}

.search-icon {
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  height: 100%;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-kbd {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
}

.search-box.has-value .search-kbd {
  display: none;
}

.search-clear {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--muted);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.search-clear .icon {
  width: 15px;
  height: 15px;
}

.search-clear:hover {
  background: var(--line);
  color: var(--ink);
}

.hero-actions {
  display: flex;
  max-width: 620px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 0;
  color: var(--muted);
  font-size: 11.5px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.hero-stats span:not(:last-child)::after {
  width: 2px;
  height: 2px;
  margin: 0 10px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.hero-stats strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.text-button .icon {
  width: 15px;
  height: 15px;
}

.text-button:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.quick-index {
  position: relative;
  overflow: hidden;
  padding: 23px 24px 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.quick-index::before {
  position: absolute;
  top: -84px;
  right: -84px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--signal-soft);
  content: "";
  filter: blur(2px);
  opacity: 0.5;
  pointer-events: none;
}

.quick-index::after {
  position: absolute;
  right: 9px;
  bottom: -54px;
  color: var(--accent);
  content: "F";
  font-family: var(--font-serif);
  font-size: 195px;
  font-style: italic;
  line-height: 1;
  opacity: 0.035;
  pointer-events: none;
}

.quick-index-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.quick-total {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 22px 0 21px;
}

.quick-number {
  color: var(--ink-strong);
  font-family: var(--font-serif);
  font-size: 82px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.77;
}

.quick-caption {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.quick-caption em {
  color: var(--clay);
  font-style: normal;
}

.quick-categories {
  position: relative;
  z-index: 1;
}

.index-category {
  display: grid;
  width: 100%;
  grid-template-columns: 24px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  text-align: left;
  transition: padding 0.2s var(--ease), color 0.2s ease;
}

.index-category:hover,
.index-category.is-active {
  padding-left: 5px;
  color: var(--accent);
}

.index-category.is-active .index-name {
  font-weight: 600;
}

.index-no {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.index-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.index-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--cat-color, var(--accent));
}

.index-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.index-arrow {
  width: 13px;
  height: 13px;
  color: var(--muted);
  opacity: 0;
  transform: translate(-2px, 2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.index-category:hover .index-arrow,
.index-category.is-active .index-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.quick-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.quick-foot > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Category accent colors */
[data-category="documents"] {
  --cat-color: #ae5746;
}

[data-category="presentations"] {
  --cat-color: #b3743c;
}

[data-category="spreadsheets"] {
  --cat-color: #5c8666;
}

[data-category="images"] {
  --cat-color: #8d6b8f;
}

[data-category="archive"] {
  --cat-color: #877d66;
}

[data-theme="dark"] [data-category="documents"] {
  --cat-color: #dc8a78;
}

[data-theme="dark"] [data-category="presentations"] {
  --cat-color: #d4a26e;
}

[data-theme="dark"] [data-category="spreadsheets"] {
  --cat-color: #8bb897;
}

[data-theme="dark"] [data-category="images"] {
  --cat-color: #be9bc1;
}

[data-theme="dark"] [data-category="archive"] {
  --cat-color: #b5aa8f;
}

/* =========================================================
   Library
   ========================================================= */

.library {
  padding-top: 38px;
  scroll-margin-top: 98px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.section-title h2 {
  margin: 9px 0 0;
  color: var(--ink-strong);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.collection-tools {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 7px;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap::after {
  position: absolute;
  right: 12px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted-strong);
  border-bottom: 1.5px solid var(--muted-strong);
  content: "";
  pointer-events: none;
  transform: translateY(-2px) rotate(45deg);
}

.sort-control select {
  min-height: 34px;
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  appearance: none;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 11.5px;
  transition: border-color 0.18s ease;
}

.sort-control select:hover,
.sort-control select:focus {
  border-color: var(--line-strong);
}

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 18px;
}

.filter-chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 11.5px;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.filter-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  transform: translateY(-1px);
}

.chip-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--cat-color, var(--signal));
}

.filter-chip[aria-pressed="true"] .chip-dot {
  background: var(--signal);
}

.chip-count {
  padding-left: 1px;
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0.62;
}

.file-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.file-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 130px 224px;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.file-list-head span:last-child {
  text-align: right;
}

.file-row {
  position: relative;
  display: grid;
  grid-template-areas: "primary kind size actions";
  grid-template-columns: minmax(0, 1fr) 150px 130px 224px;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  animation: rowIn 0.42s var(--ease) both;
  animation-delay: calc(var(--row-index, 0) * 32ms);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: var(--surface-hover);
}

.file-row:focus-within {
  background: var(--surface-hover);
  box-shadow: inset 3px 0 0 var(--signal);
}

.file-row.is-current {
  background: var(--surface-hover);
  box-shadow: inset 3px 0 0 var(--signal);
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-primary {
  display: flex;
  min-width: 0;
  grid-area: primary;
  align-items: center;
  gap: 15px;
}

.file-icon {
  display: flex;
  width: 52px;
  height: 56px;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--type-color) 16%, transparent);
  border-radius: 11px;
  background: var(--type-bg);
  color: var(--type-color);
}

.file-icon .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
}

.file-icon-ext {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}

.file-icon-small {
  width: 42px;
  height: 44px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.file-icon-small .icon {
  display: none;
}

/* File type palettes */
.type-pdf {
  --type-bg: #f6e5e0;
  --type-color: #a74434;
}

.type-doc,
.type-docx {
  --type-bg: #e6edf5;
  --type-color: #315f86;
}

.type-ppt,
.type-pptx {
  --type-bg: #f7ead9;
  --type-color: #a4581d;
}

.type-xls,
.type-xlsx,
.type-csv {
  --type-bg: #e6f0e8;
  --type-color: #386b48;
}

.type-jpg,
.type-jpeg,
.type-png,
.type-webp,
.type-gif,
.type-svg {
  --type-bg: #f1e7f2;
  --type-color: #7d537f;
}

.type-zip,
.type-rar,
.type-7z {
  --type-bg: #efebdf;
  --type-color: #6b624c;
}

.type-file {
  --type-bg: var(--surface-subtle);
  --type-color: var(--muted-strong);
}

[data-theme="dark"] .type-pdf {
  --type-bg: #35221f;
  --type-color: #e49a8b;
}

[data-theme="dark"] .type-doc,
[data-theme="dark"] .type-docx {
  --type-bg: #1d2b37;
  --type-color: #9bc2df;
}

[data-theme="dark"] .type-ppt,
[data-theme="dark"] .type-pptx {
  --type-bg: #382a1c;
  --type-color: #e4b27f;
}

[data-theme="dark"] .type-xls,
[data-theme="dark"] .type-xlsx,
[data-theme="dark"] .type-csv {
  --type-bg: #1e2f23;
  --type-color: #9dc6a8;
}

[data-theme="dark"] .type-jpg,
[data-theme="dark"] .type-jpeg,
[data-theme="dark"] .type-png,
[data-theme="dark"] .type-webp,
[data-theme="dark"] .type-gif,
[data-theme="dark"] .type-svg {
  --type-bg: #2e2330;
  --type-color: #c9a3cb;
}

[data-theme="dark"] .type-zip,
[data-theme="dark"] .type-rar,
[data-theme="dark"] .type-7z {
  --type-bg: #2b291f;
  --type-color: #bdb193;
}

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

.file-name {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.4;
  text-align: left;
}

.file-name:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.file-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name .file-ext {
  margin-left: 1px;
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 500;
}

.file-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--signal);
  color: #17251e;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  transform: translateY(-1px);
}

.file-description {
  display: -webkit-box;
  max-width: 560px;
  margin: 3px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.file-tag {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.file-kind {
  display: flex;
  min-width: 0;
  grid-area: kind;
  flex-direction: column;
  gap: 2px;
}

.file-category {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-format {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.file-size {
  display: flex;
  min-width: 0;
  grid-area: size;
  flex-direction: column;
  gap: 2px;
}

.file-size-value {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.file-date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.file-actions {
  display: flex;
  min-width: 0;
  grid-area: actions;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
  white-space: nowrap;
}

.button .icon {
  width: 15px;
  height: 15px;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.button-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.button-outline {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button-outline:hover {
  border-color: var(--accent);
  background: var(--surface-subtle);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
}

.button-quiet:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.button-inverse {
  border-color: var(--signal);
  background: var(--signal);
  color: #17251e;
}

.button-inverse:hover {
  border-color: #e6f48a;
  background: #e6f48a;
  transform: translateY(-1px);
}

.button-wide {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding-inline: 14px;
}

.button-small {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 10.5px;
}

.file-actions .button {
  min-height: 34px;
  padding: 7px 10px;
}

.file-actions .button-primary {
  padding-inline: 11px;
}

.file-actions .icon-button {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  border-radius: 8px;
  background: transparent;
}

.file-actions .icon-button:hover {
  background: var(--surface-subtle);
}

.file-actions .button-primary .icon {
  width: 14px;
  height: 14px;
}

.empty-state {
  padding: 62px 24px 58px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
  color: var(--muted);
}

.empty-icon .icon {
  width: 25px;
  height: 25px;
}

.empty-state h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.library-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 2px 0;
  color: var(--muted);
  font-size: 10.5px;
}

.library-foot p {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.library-foot .icon {
  width: 13px;
  height: 13px;
}

/* =========================================================
   About
   ========================================================= */

.about {
  padding-top: 88px;
  scroll-margin-top: 96px;
}

.about-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: clamp(40px, 6vw, 82px);
  padding: clamp(32px, 5.4vw, 64px);
  border-radius: 32px;
  background: #173c33;
  box-shadow: 0 34px 90px -64px rgba(23, 60, 51, 0.82);
  color: #f4f1e8;
}

.about-panel::before {
  position: absolute;
  top: -175px;
  right: -110px;
  width: 450px;
  height: 450px;
  border: 1px solid rgba(244, 241, 232, 0.11);
  border-radius: 50%;
  content: "";
}

.about-panel::after {
  position: absolute;
  right: 54px;
  bottom: -220px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(244, 241, 232, 0.07);
  border-radius: 50%;
  content: "";
}

.about-copy,
.about-points {
  position: relative;
  z-index: 1;
}

.about-copy h2 {
  margin: 15px 0 0;
  color: #f7f4ec;
  font-size: clamp(2.4rem, 4.1vw, 3.8rem);
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1.08;
  text-wrap: balance;
}

.about-lede {
  max-width: 470px;
  margin: 23px 0 27px;
  color: #c4d2c9;
  font-size: 13.5px;
  line-height: 1.85;
}

.about-panel .button-inverse .icon {
  width: 15px;
  height: 15px;
}

.about-points {
  align-self: center;
  border-top: 1px solid rgba(244, 241, 232, 0.16);
}

.about-point {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 13px;
  padding: 21px 0;
  border-bottom: 1px solid rgba(244, 241, 232, 0.16);
}

.about-point > span {
  padding-top: 3px;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.about-point h3 {
  margin: 0 0 4px;
  color: #f7f4ec;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.about-point p {
  max-width: 440px;
  margin: 0;
  color: #b5c6bb;
  font-size: 11.5px;
  line-height: 1.7;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  padding: 70px 0 26px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 29px 0;
  border-top: 1px solid var(--line);
}

.footer-brand p {
  max-width: 360px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 17px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.footer-link {
  color: var(--muted);
  font-size: 11.5px;
  transition: color 0.18s ease;
}

.footer-link:hover {
  color: var(--ink);
}

.back-to-top {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.back-to-top .icon {
  width: 15px;
  height: 15px;
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.footer-domain {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-domain a:hover {
  color: var(--ink);
}

.footer-bottom > span:last-child {
  text-align: right;
}

/* =========================================================
   Dialogs
   ========================================================= */

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(9, 14, 11, 0.56);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: backdropIn 0.22s ease both;
}

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

.preview-dialog,
.settings-dialog {
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.preview-dialog {
  width: min(1140px, calc(100vw - 48px));
}

.preview-shell {
  display: flex;
  height: min(782px, calc(100dvh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 45px 130px -36px rgba(0, 0, 0, 0.56);
  animation: modalIn 0.28s var(--ease) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.preview-topbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.preview-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.preview-heading-copy {
  min-width: 0;
}

.preview-heading h2 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-heading p {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-top-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
}

.preview-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.preview-stage {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--stage);
}

.preview-image-stage {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 27px;
  background:
    radial-gradient(circle at 50% 34%, rgba(217, 235, 117, 0.07), transparent 60%),
    var(--stage);
}

.preview-image-link {
  display: flex;
  max-width: 100%;
  max-height: 100%;
  align-items: center;
  justify-content: center;
}

.preview-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 210px);
  border-radius: 4px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.image-caption {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(9, 14, 11, 0.66);
  color: #c8d1c9;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.preview-pdf-wrap {
  position: relative;
  min-height: 0;
  flex: 1;
  background: #f3f0e8;
}

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

.preview-pdf-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  background: #0e1410;
  color: #aeb9b0;
  font-size: 10px;
}

.preview-pdf-bar a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d9eb75;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.preview-pdf-bar .icon {
  width: 12px;
  height: 12px;
}

.no-preview-stage {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(circle at 50% 40%, rgba(217, 235, 117, 0.075), transparent 52%),
    var(--stage);
  color: #d8dfd8;
  text-align: center;
}

.no-preview-icon {
  display: grid;
  width: 70px;
  height: 78px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgba(217, 235, 117, 0.22);
  border-radius: 14px;
  background: rgba(217, 235, 117, 0.055);
  color: #d9eb75;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.no-preview-stage h3 {
  margin: 0 0 7px;
  color: #f4f1e8;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.no-preview-stage p {
  max-width: 310px;
  margin: 0 0 21px;
  color: #9faca2;
  font-size: 11.5px;
  line-height: 1.7;
}

.no-preview-stage .button {
  border-color: rgba(217, 235, 117, 0.28);
  background: rgba(217, 235, 117, 0.1);
  color: #e7f59a;
}

.no-preview-stage .button:hover {
  background: rgba(217, 235, 117, 0.17);
}

.preview-info {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  padding: 25px 25px 22px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.preview-description {
  margin: 11px 0 0;
  color: var(--muted-strong);
  font-size: 12.5px;
  line-height: 1.75;
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 11px;
}

.preview-tag {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.5;
}

.preview-meta {
  margin: 21px 0 0;
  border-top: 1px solid var(--line);
}

.preview-meta div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.preview-meta dt {
  color: var(--muted);
  font-size: 10px;
}

.preview-meta dd {
  margin: 0;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-align: right;
}

.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}

#previewDownload .download-size {
  margin-left: auto;
  padding-left: 12px;
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 8.5px;
  opacity: 0.58;
}

#previewDownload .icon {
  margin-left: 0;
}

.copy-direct {
  align-self: flex-start;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.preview-hint {
  margin: 18px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

/* Settings */

.settings-dialog {
  width: min(520px, calc(100vw - 32px));
}

.settings-shell {
  display: flex;
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 40px 120px -36px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.24s var(--ease) both;
}

.settings-header {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 23px 17px;
  border-bottom: 1px solid var(--line);
}

.settings-header h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.settings-form {
  overflow-y: auto;
  padding: 20px 23px 23px;
}

.settings-note {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.settings-note code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--line);
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 15px;
}

.field > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
}

.field > span em {
  margin-left: 4px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 400;
}

.field input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 12.5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.field input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 19px 0 21px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-subtle);
}

.brand-preview-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.brand-preview-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-preview-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 3px;
}

/* =========================================================
   Toast
   ========================================================= */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 120;
  display: flex;
  max-width: calc(100vw - 32px);
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 13px;
  border: 1px solid color-mix(in srgb, var(--page-toast-fg) 12%, transparent);
  border-radius: 999px;
  background: var(--page-toast-bg);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.46);
  color: var(--page-toast-fg);
  font-size: 11.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 13px);
  transition:
    opacity 0.22s ease,
    transform 0.22s var(--ease),
    visibility 0.22s ease;
  visibility: hidden;
}

.toast::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--signal);
  content: "";
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.page-toast {
  z-index: 140;
}

/* =========================================================
   No script
   ========================================================= */

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  max-width: 600px;
  margin-inline: auto;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  font-size: 12px;
}

.noscript code {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* =========================================================
   Responsive — tablet
   ========================================================= */

@media (max-width: 1080px) {
  .hero-grid {
    gap: 46px;
  }

  .file-list-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 132px 112px 214px;
    gap: 15px;
  }

  .file-actions {
    gap: 5px;
  }

  .file-actions .button {
    padding-inline: 8px;
  }

  .file-description {
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 960px) {
  :root {
    --gutter: 24px;
  }

  .hero {
    padding-top: 61px;
  }

  .hero-grid {
    max-width: 780px;
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero h1 {
    font-size: clamp(2.85rem, 7.2vw, 4.65rem);
  }

  .quick-index {
    padding: 23px 24px 0;
  }

  .quick-total {
    padding: 20px 0 18px;
  }

  .quick-number {
    font-size: 72px;
  }

  .quick-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 26px;
  }

  .index-category {
    padding: 10px 0;
  }

  .index-category:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  .quick-foot {
    margin-top: 2px;
  }

  .file-list-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 212px;
    gap: 12px 18px;
  }

  .file-list-head {
    display: none;
  }

  .file-row {
    grid-template-areas:
      "primary primary"
      "kind size"
      "actions actions";
    padding: 19px 20px;
  }

  .file-kind {
    flex-direction: row;
    align-items: center;
    gap: 7px;
  }

  .file-format::before {
    content: "·";
    margin-right: 6px;
    color: var(--line-strong);
  }

  .file-size {
    flex-direction: row;
    align-items: center;
    justify-self: end;
    gap: 9px;
  }

  .file-date::before {
    content: "·";
    margin-right: 6px;
    color: var(--line-strong);
  }

  .file-actions {
    justify-content: flex-start;
    padding-top: 13px;
    border-top: 1px dashed var(--line);
  }

  .file-actions .file-download {
    margin-left: auto;
  }

  .file-description {
    -webkit-line-clamp: 2;
  }
}

/* =========================================================
   Responsive — mobile
   ========================================================= */

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --header-height: 68px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-en {
    font-size: 7.5px;
  }

  .nav-link {
    padding-inline: 8px;
    font-size: 12px;
  }

  .nav-link-about,
  .nav-divider {
    display: none;
  }

  .customize-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .customize-button span {
    display: none;
  }

  .site-nav {
    gap: 2px;
  }

  .hero {
    padding: 47px 0 44px;
  }

  .hero::before {
    top: -310px;
    right: -320px;
    width: 560px;
    height: 560px;
  }

  .eyebrow {
    gap: 8px;
    font-size: 8.5px;
    letter-spacing: 0.13em;
  }

  .eyebrow-rule {
    width: 20px;
  }

  .hero h1 {
    margin-bottom: 20px;
    font-size: clamp(2.55rem, 10.3vw, 3.7rem);
    letter-spacing: -0.06em;
  }

  .lede {
    font-size: 14.5px;
    line-height: 1.75;
  }

  .lede-detail {
    margin-bottom: 23px;
    font-size: 9px;
  }

  .search-box {
    height: 55px;
    padding-left: 15px;
    border-radius: 14px;
  }

  .search-box input {
    font-size: 14px;
  }

  .search-kbd {
    display: none;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-top: 18px;
  }

  .quick-index {
    padding: 21px 20px 0;
    border-radius: 20px;
  }

  .quick-categories {
    grid-template-columns: 1fr;
  }

  .index-category {
    padding: 10px 0;
  }

  .index-category:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  .quick-number {
    font-size: 68px;
  }

  .library {
    padding-top: 26px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  .section-title h2 {
    font-size: 2.3rem;
  }

  .collection-tools {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
  }

  .filters {
    flex-wrap: wrap;
    margin: 18px 0 16px;
    row-gap: 7px;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .file-panel {
    border-radius: 18px;
  }

  .file-row {
    grid-template-columns: 1fr auto;
    padding: 17px 15px;
  }

  .file-primary {
    gap: 12px;
  }

  .file-icon {
    width: 47px;
    height: 51px;
    border-radius: 10px;
  }

  .file-name {
    font-size: 14px;
  }

  .file-description {
    font-size: 11px;
  }

  .file-tags {
    gap: 3px;
    margin-top: 5px;
  }

  .file-tag {
    font-size: 7px;
  }

  .file-kind {
    font-size: 10.5px;
  }

  .file-size {
    gap: 6px;
  }

  .file-actions {
    gap: 5px;
  }

  .file-actions .button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 10.5px;
  }

  .file-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .library-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding-top: 15px;
  }

  .about {
    padding-top: 56px;
  }

  .about-panel {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 23px;
    border-radius: 24px;
  }

  .about-copy h2 {
    font-size: 2.5rem;
  }

  .about-lede {
    margin: 18px 0 22px;
    font-size: 12.5px;
  }

  .about-point {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 9px;
    padding: 17px 0;
  }

  .about-point h3 {
    font-size: 13.5px;
  }

  .about-point p {
    font-size: 10.5px;
  }

  .site-footer {
    padding-top: 52px;
  }

  .footer-top {
    flex-direction: column;
    gap: 24px;
    padding: 25px 0;
  }

  .footer-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    padding-top: 0;
  }

  .back-to-top {
    margin-left: auto;
  }

  .footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
  }

  .footer-bottom > span:last-child {
    text-align: left;
  }

  /* Full-screen preview */
  .preview-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
  }

  .preview-shell {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .preview-topbar {
    gap: 10px;
    padding: 9px 11px 9px 13px;
  }

  .preview-heading {
    gap: 9px;
  }

  .preview-heading h2 {
    font-size: 12.5px;
  }

  .preview-heading p {
    font-size: 7.5px;
  }

  .preview-heading .file-icon-small {
    width: 36px;
    height: 38px;
    border-radius: 8px;
    font-size: 8px;
  }

  .preview-top-actions .button-small {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .top-action-label {
    display: none;
  }

  .preview-grid {
    display: flex;
    overflow-y: auto;
    flex-direction: column;
  }

  .preview-stage {
    height: 44dvh;
    min-height: 280px;
    flex: none;
  }

  .preview-image-stage {
    padding: 13px;
  }

  .preview-image {
    max-height: 40dvh;
  }

  .image-caption {
    right: 10px;
    bottom: 9px;
    font-size: 7.5px;
  }

  .no-preview-stage {
    padding: 25px;
  }

  .no-preview-icon {
    width: 56px;
    height: 62px;
    margin-bottom: 14px;
    font-size: 10px;
  }

  .no-preview-stage h3 {
    font-size: 16px;
  }

  .no-preview-stage p {
    margin-bottom: 16px;
    font-size: 10.5px;
  }

  .preview-info {
    overflow: visible;
    padding: 21px 19px 28px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .preview-description {
    font-size: 12px;
  }

  .preview-meta div {
    padding: 8px 0;
  }

  .preview-actions {
    margin-top: 19px;
  }

  .preview-hint {
    margin-top: 17px;
  }

  .settings-header {
    padding: 18px 19px 15px;
  }

  .settings-form {
    padding: 18px 19px 20px;
  }

  .settings-actions {
    gap: 8px;
  }

  .settings-actions .button {
    flex: 1;
  }

  .toast {
    bottom: 18px;
    padding: 9px 14px 9px 12px;
    font-size: 10.5px;
  }
}

@media (max-width: 430px) {
  .brand-en {
    display: none;
  }

  .brand-words {
    gap: 0;
  }

  .brand-name {
    font-size: 14.5px;
  }

  .site-nav {
    gap: 0;
  }

  .icon-button,
  .customize-button {
    width: 35px;
    height: 35px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 10.6vw, 2.95rem);
  }

  .hero-stats {
    font-size: 10.5px;
  }

  .hero-stats span:not(:last-child)::after {
    margin: 0 7px;
  }

  .hero-stats strong {
    font-size: 11px;
  }

  .file-tags {
    display: none;
  }

  .file-actions .button .icon {
    width: 13px;
    height: 13px;
  }

  .file-actions .button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .file-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .collection-tools {
    gap: 10px;
  }

  .sort-control > span:first-child {
    display: none;
  }

  .about-copy h2 {
    font-size: 2.2rem;
  }

  .settings-form {
    padding-inline: 16px;
  }

  .settings-header {
    padding-inline: 16px;
  }
}

@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;
  }
}

/* =========================================================
   Print
   ========================================================= */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-subtle: #fff;
    --surface-hover: #fff;
    --ink: #000;
    --ink-strong: #000;
    --muted: #555;
    --muted-strong: #333;
    --line: #ddd;
    --line-strong: #ccc;
  }

  body {
    background: #fff;
  }

  .site-header,
  .hero,
  .about,
  .site-footer,
  .filters,
  .collection-tools,
  .file-actions,
  .library-foot,
  .toast,
  .search-box {
    display: none !important;
  }

  .library {
    padding-top: 0;
  }

  .section-head {
    padding-bottom: 14px;
  }

  .file-panel {
    border: 0;
    box-shadow: none;
  }

  .file-row {
    break-inside: avoid;
    padding-inline: 0;
  }
}
