:root {
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #18201c;
  --muted: #69736e;
  --line: #dde3df;
  --brand: #eb5b36;
  --brand-dark: #c84627;
  --forest: #183c32;
  --forest-light: #28584b;
  --blue: #27689d;
  --green: #287653;
  --gold: #a86f1d;
  --danger: #b63a3a;
  --shadow-sm: 0 4px 14px rgba(22, 37, 30, .06);
  --shadow: 0 14px 34px rgba(18, 35, 28, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--brand); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.35; letter-spacing: 0; }
.container { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(26, 43, 35, .1);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 2px 10px rgba(20, 36, 28, .03);
}
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { width: 166px; height: auto; max-height: 44px; object-fit: contain; }
.main-nav { min-width: 0; display: flex; align-self: stretch; align-items: stretch; flex: 1; gap: 2px; }
.main-nav a { display: flex; align-items: center; padding: 0 12px; border-bottom: 3px solid transparent; color: #38433d; white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { border-color: var(--brand); color: var(--brand); }
.account-nav { display: flex; align-items: center; flex: 0 0 auto; gap: 12px; }
.account-nav > a:not(.button), .link-button { color: #4f5a55; }
.account-nav > a:not(.button):hover, .link-button:hover { color: var(--brand); }
.account-nav form { margin: 0; display: flex; }
.link-button { padding: 0; border: 0; background: transparent; }

.button {
  min-height: 42px;
  padding: 9px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand);
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  line-height: 1.25;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.button:hover { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }
.button:active { transform: translateY(1px); }
.button-small { min-height: 36px; padding: 7px 13px; font-size: 14px; }
.button-block { width: 100%; }
.button-secondary { border-color: #ccd5d0; background: #fff; color: #34423b; }
.button-secondary:hover { border-color: var(--forest); background: var(--forest); color: #fff; }

.messages { padding-top: 14px; }
.message { padding: 11px 14px; border: 1px solid #b8d7c5; border-radius: 4px; background: #eef8f2; color: #215d3d; }
.message-error { border-color: #e7baba; background: #fff1f1; color: #8a2727; }
.message-info { border-color: #b8d2e8; background: #eff7fd; color: #285a82; }

.search-band { position: relative; overflow: hidden; border-bottom: 4px solid var(--brand); background: var(--forest); color: #fff; }
.search-banner { position: absolute; inset: 0; background-position: center; background-size: cover; opacity: .26; filter: saturate(.75) contrast(.95); }
.search-band.has-banner::after { content: ""; position: absolute; inset: 0; z-index: 0; background: rgba(15, 47, 38, .48); }
.banner-link { position: absolute; inset: 0; z-index: 1; }
.search-band-inner {
  position: relative;
  z-index: 2;
  min-height: 356px;
  padding-block: 48px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.search-band-inner form, .search-band-inner a { pointer-events: auto; }
.hero-copy { max-width: 780px; text-align: center; }
.hero-eyebrow { display: block; margin-bottom: 8px; color: #ff9b7e; font-size: 13px; font-weight: 700; }
.search-band h1 { margin-bottom: 7px; color: #fff; font-size: 40px; font-weight: 650; }
.search-band p { margin-bottom: 25px; color: #dce8e3; font-size: 17px; }
.hero-search { width: min(100%, 820px); display: grid; grid-template-columns: minmax(0, 1fr) 108px; box-shadow: var(--shadow); }
.hero-search input, .compact-search input {
  min-width: 0;
  height: 54px;
  padding: 0 17px;
  border: 1px solid #cbd4cf;
  border-right: 0;
  border-radius: 5px 0 0 5px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.hero-search input::placeholder, .compact-search input::placeholder { color: #929b96; }
.hero-search input:focus, .compact-search input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.hero-search .button, .compact-search .button { height: 54px; border-radius: 0 5px 5px 0; }
.quick-categories { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: #d9e4df; }
.quick-categories strong { margin-right: 2px; font-size: 13px; }
.quick-categories a { padding: 4px 9px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; background: rgba(255, 255, 255, .07); color: #fff; font-size: 13px; }
.quick-categories a:hover { border-color: #ff9b7e; background: rgba(255, 255, 255, .13); color: #fff; }
.collection-stats { width: min(100%, 820px); margin-top: 25px; padding-top: 15px; display: flex; justify-content: center; gap: 28px; border-top: 1px solid rgba(255, 255, 255, .16); color: #bdcec7; text-align: center; font-size: 13px; }
.collection-stats strong { color: #fff; font-size: 17px; }

.page-stack { padding-block: 34px 54px; display: flex; flex-direction: column; gap: 42px; }
.page-top { padding-top: 24px; padding-bottom: 52px; }
.content-section { min-width: 0; }
.section-heading { margin-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading > div { position: relative; padding-left: 14px; }
.section-heading > div::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 0; width: 4px; border-radius: 2px; background: var(--brand); }
.section-heading h2, .panel-heading h2 { margin-bottom: 2px; font-size: 23px; font-weight: 650; }
.section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.section-heading > a { color: #506059; font-size: 14px; }
.section-heading > a:hover { color: var(--brand); }

.home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 26px; align-items: start; }
.sidebar-list { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-heading { padding: 17px 19px; background: var(--forest); color: #fff; }
.panel-heading span { color: #aac1b8; font-size: 12px; }
.panel-heading h2 { color: #fff; font-size: 20px; }
.sidebar-list > .button { width: calc(100% - 36px); margin: 3px 18px 18px; }
.ranking-list { margin: 0; padding: 8px 18px; list-style: none; }
.ranking-list li { min-height: 51px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid #edf1ee; }
.ranking-list li:last-child { border-bottom: 0; }
.ranking-list li > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 3px; background: #edf1ef; color: #59645f; font-size: 12px; }
.ranking-list li:nth-child(-n+3) > span { background: var(--brand); color: #fff; }
.ranking-list a { min-width: 0; overflow: hidden; color: #344039; text-overflow: ellipsis; white-space: nowrap; }
.ranking-list a:hover { color: var(--brand); }
.ranking-list small { color: var(--gold); }

.document-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.document-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.document-card:hover { transform: translateY(-3px); border-color: #c7d2cc; box-shadow: var(--shadow); }
.document-cover { position: relative; aspect-ratio: 210 / 297; display: flex; overflow: hidden; border-bottom: 1px solid var(--line); background: #e9eeeb; color: var(--ink); }
.document-cover img { width: 100%; height: 100%; background: #fff; object-fit: contain; }
.cover-placeholder { position: relative; width: calc(100% - 28px); height: calc(100% - 28px); margin: 14px; padding: 27% 17px 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #d9d5ca; background: #fffdf7; box-shadow: 0 7px 18px rgba(41, 43, 35, .08); }
.cover-placeholder::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 20%; background: var(--forest); }
.cover-placeholder::after { content: ""; position: absolute; top: 20%; bottom: 0; left: 14px; width: 4px; background: var(--brand); }
.file-type { position: absolute; top: 13px; right: 12px; z-index: 1; padding: 3px 7px; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; color: #fff; font-size: 11px; font-weight: 700; }
.manual-label { position: absolute; top: 14px; left: 15px; z-index: 1; color: #dce8e3; font-size: 10px; font-weight: 700; }
.cover-title { position: relative; z-index: 1; padding-left: 8px; color: #27312c; font-size: 16px; font-weight: 650; line-height: 1.7; text-align: left; overflow-wrap: anywhere; }
.manual-footer { padding-left: 8px; color: #8c928e; font-size: 11px; }
.document-card-body { padding: 15px 16px 14px; }
.document-category { display: block; margin-bottom: 6px; color: var(--brand); font-size: 12px; font-weight: 600; }
.document-card h3 { min-height: 43px; margin-bottom: 7px; font-size: 16px; font-weight: 650; }
.document-card h3 a { display: -webkit-box; overflow: hidden; color: #26312b; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.document-card h3 a:hover { color: var(--brand); }
.document-card p { min-height: 42px; margin-bottom: 12px; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.document-meta { padding-top: 10px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #edf1ee; color: #89928d; font-size: 11px; }

.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-group { min-height: 138px; padding: 17px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); transition: border-color .16s ease, background-color .16s ease; }
.category-group:hover { border-color: #bdccc4; background: #fbfcfb; }
.category-group h3 { margin-bottom: 5px; font-size: 17px; }
.category-group h3 a { color: #26352e; }
.category-group h3 a:hover { color: var(--brand); }
.category-group p { min-height: 40px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.category-group > div { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.category-group > div a { color: #53625a; font-size: 12px; }

.breadcrumbs { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: #53615a; }
.breadcrumbs a:hover { color: var(--brand); }
.list-header { padding: 8px 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.list-header h1 { margin-bottom: 5px; font-size: 28px; font-weight: 650; }
.list-header p { max-width: 650px; margin: 0; color: var(--muted); }
.compact-search { display: grid; grid-template-columns: minmax(230px, 350px) 84px; box-shadow: var(--shadow-sm); }
.compact-search input { height: 46px; }
.compact-search .button { height: 46px; }
.sort-tabs { padding: 10px 12px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.sort-tabs a { padding: 6px 12px; border-radius: 3px; color: #4d5a53; }
.sort-tabs a:hover { color: var(--brand); }
.sort-tabs a.active { background: var(--forest); color: #fff; }
.sort-tabs span { margin-left: auto; color: var(--muted); font-size: 13px; }
.document-grid-list { padding: 0; border: 0; background: transparent; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.pagination span { color: var(--muted); }
.empty-state { grid-column: 1 / -1; padding: 56px 24px; border: 1px dashed #c6d0ca; border-radius: 5px; background: var(--surface-soft); color: var(--muted); text-align: center; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 850px) minmax(250px, 310px); gap: 24px; align-items: start; }
.document-detail { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.document-header, .product-intro, .preview-section, .text-excerpt { padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.document-header { display: flex; gap: 18px; box-shadow: var(--shadow-sm); }
.file-badge { width: 58px; height: 66px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 4px; background: var(--forest); color: #fff; font-size: 12px; font-weight: 700; }
.document-title-block { min-width: 0; }
.document-title-block h1 { margin-bottom: 11px; overflow-wrap: anywhere; font-size: 27px; font-weight: 650; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 5px 17px; color: var(--muted); font-size: 13px; }
.tag-list { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list a { padding: 3px 8px; border: 1px solid #d6ded9; border-radius: 3px; background: #f8faf9; color: #4d5b54; font-size: 12px; }
.text-excerpt h2 { margin-bottom: 10px; font-size: 20px; }
.text-excerpt p { margin-bottom: 0; color: #46524b; }

.product-intro { border-left: 4px solid var(--green); }
.product-intro > h2 { margin-bottom: 11px; font-size: 23px; }
.product-name { margin-bottom: 8px; color: var(--green); font-size: 16px; font-weight: 700; }
.intro-summary { color: #35423b; font-size: 16px; line-height: 1.9; }
.intro-columns { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.intro-columns section, .usage-notes { padding: 15px 17px; border: 1px solid #dbe5df; border-radius: 4px; background: #f8fbf9; }
.product-intro h3 { margin-bottom: 8px; font-size: 16px; }
.product-intro ul { margin: 0; padding-left: 20px; }
.product-intro li + li { margin-top: 5px; }
.usage-notes { margin-top: 18px; border-color: #e4ddc8; background: #fcfaf4; }
.intro-disclaimer { margin: 17px 0 0; color: var(--muted); font-size: 12px; }

.preview-heading { padding-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.preview-heading h2 { margin-bottom: 3px; font-size: 21px; }
.preview-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.local-label { padding: 3px 8px; flex: 0 0 auto; border: 1px solid #bbd8c7; border-radius: 3px; background: #eff8f2; color: var(--green); font-size: 12px; }
.preview-pages { padding: 22px; display: flex; flex-direction: column; gap: 22px; border-radius: 4px; background: #343b37; }
.preview-pages figure { width: min(100%, 760px); margin: 0 auto; scroll-margin-top: 92px; }
.preview-pages figure img { width: 100%; height: auto; border: 1px solid #d6d9d7; background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
.preview-pages figcaption { margin-top: 7px; color: #c6ceca; text-align: center; font-size: 12px; }
.text-preview { max-height: 900px; overflow: auto; padding: 24px; border: 1px solid var(--line); background: #fcfdfc; white-space: normal; }

.detail-sidebar { position: sticky; top: 94px; display: flex; flex-direction: column; gap: 18px; }
.download-panel, .related-panel { padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.sidebar-cover { width: min(100%, 210px); aspect-ratio: 210 / 297; margin: 0 auto 17px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.download-panel form { margin-top: 10px; }
.download-panel dl { margin: 17px 0 0; padding-top: 9px; border-top: 1px solid var(--line); }
.download-panel dl div { padding-top: 8px; display: flex; justify-content: space-between; gap: 12px; }
.download-panel dt { color: var(--muted); }
.download-panel dd { margin: 0; text-align: right; }
.related-panel h2 { margin-bottom: 8px; font-size: 18px; }
.related-panel > a { padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf1ee; color: #3e4b44; }
.related-panel > a:last-child { border-bottom: 0; }
.related-panel span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-panel small { flex: 0 0 auto; color: var(--muted); }

.ad-slot { overflow: hidden; border: 1px dashed #d3dad6; border-radius: 4px; background: #fff; text-align: center; }
.ad-unit { min-height: 36px; max-width: 100%; overflow: hidden; }
.ad-unit img, .ad-unit iframe { max-width: 100%; }
.preview-pages > .ad-slot { width: 100%; background: #fff; }

.narrow-page { width: min(820px, calc(100% - 40px)); }
.upload-page { width: min(980px, calc(100% - 40px)); }
.form-page { padding: 27px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.form-page header { margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.form-page header h1 { margin-bottom: 4px; font-size: 26px; }
.form-page header p { margin: 0; color: var(--muted); }
.form-field { margin-bottom: 19px; }
.form-field > label { display: block; margin-bottom: 6px; font-weight: 600; }
.form-field input[type="text"], .form-field input[type="password"], .form-field input[type="file"], .form-field textarea, .form-field select, .auth-form input { width: 100%; padding: 10px 11px; border: 1px solid #c8d1cc; border-radius: 4px; background: #fff; color: var(--ink); outline: none; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus, .auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(235, 91, 54, .12); }
.form-field small { display: block; margin-top: 5px; color: var(--muted); }
.checkbox-grid > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 14px; }
.checkbox-grid label { display: flex; align-items: center; gap: 7px; }
.errorlist { margin: 6px 0 0; padding-left: 20px; color: var(--danger); }
.form-errors { margin-bottom: 16px; padding: 10px 12px; border: 1px solid #e4b9b9; background: #fff2f2; color: var(--danger); }
.upload-config { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 18px; }
.batch-options { margin: 0 0 20px; padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); }
.batch-options legend { padding: 0 7px; color: var(--ink); font-weight: 650; }
.upload-policy-note { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.upload-policy-note strong { color: var(--brand); }
.upload-policy-note .text-success { color: #216943; }
.batch-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.batch-options .form-field { margin: 0; }
.toggle-option { min-height: 72px; padding: 12px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.toggle-option input { margin-top: 4px; accent-color: var(--brand); }
.toggle-option span, .toggle-option strong, .toggle-option small { display: block; }
.toggle-option small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.permission-note { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid #aeb8b2; background: var(--surface-soft); color: var(--muted); font-size: 13px; }
.upload-dropzone { position: relative; min-height: 190px; padding: 28px; display: grid; place-content: center; border: 2px dashed #bdc9c2; border-radius: 6px; background: #f8faf9; text-align: center; }
.upload-dropzone:hover { border-color: var(--brand); background: #fffaf8; }
.upload-dropzone > label { margin-bottom: 12px; }
.upload-dropzone input[type="file"] { max-width: 540px; margin: 0 auto 12px; background: #fff; }
.upload-dropzone > strong { font-size: 16px; }
.upload-selection { margin: 2px 0 20px; }
.selection-heading { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 18px; }
.selection-heading span { color: var(--muted); }
.batch-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.batch-strip span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font-size: 13px; }
.reader-toolbar { position: fixed; right: max(16px, calc((100vw - 1260px) / 2)); bottom: 26px; z-index: 25; padding: 5px; display: flex; align-items: center; gap: 4px; border: 1px solid #cbd4cf; border-radius: 6px; background: rgba(255,255,255,.97); box-shadow: var(--shadow); }
.reader-toolbar button { width: 36px; height: 36px; border: 0; border-radius: 4px; background: transparent; color: #3f4b44; font-size: 19px; }
.reader-toolbar button:hover { background: #eef2f0; color: var(--brand); }
.reader-toolbar span { min-width: 58px; color: var(--muted); text-align: center; font-size: 13px; }
.auth-page { min-height: 560px; padding-top: 60px; display: grid; place-items: start center; }
.auth-form { width: min(100%, 430px); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { background: #f5f8f6; color: #4d5b54; font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child { width: 42%; }
.data-table td small { display: block; color: var(--muted); }
.status { padding: 2px 7px; display: inline-flex; border-radius: 3px; background: #ecefed; color: #4c5751; font-size: 12px; white-space: nowrap; }
.status-ready { background: #e9f6ee; color: #216943; }
.status-pending, .status-processing, .status-generating { background: #fff4dc; color: #86601a; }
.status-failed, .status-disabled { background: #fdecec; color: #9c3030; }
.error-text { max-width: 260px; color: var(--danger) !important; }

.site-footer { margin-top: 14px; border-top: 4px solid var(--brand); background: #1d2d26; color: #aebdb6; }
.footer-inner { min-height: 132px; padding: 28px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.footer-brand { width: 100%; }
.footer-inner strong { color: #fff; font-size: 17px; }
.footer-inner p { margin: 3px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.footer-links a { color: #cfdbd5; }
.footer-links a:hover { color: #ff9b7e; }
.footer-records { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; }
.footer-records a { color: #cfdbd5; }
.footer-records a:hover { color: #ff9b7e; }

@media (max-width: 1080px) {
  .main-nav a:nth-child(n+5) { display: none; }
  .document-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-columns { grid-template-columns: minmax(0, 1fr) 270px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .container, .narrow-page, .upload-page { width: min(100% - 24px, 720px); }
  .header-inner { min-height: 66px; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 3px 16px; }
  .brand img { width: 145px; }
  .main-nav { order: 3; width: 100%; height: 42px; overflow-x: auto; }
  .main-nav a { padding: 0 10px; }
  .account-nav { margin-left: auto; }
  .account-nav > a:not(.button), .account-nav form { display: none; }
  .search-band-inner { min-height: 330px; padding-block: 40px 28px; }
  .search-band h1 { font-size: 34px; }
  .document-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-columns, .detail-layout { grid-template-columns: 1fr; }
  .sidebar-list { width: 100%; }
  .ranking-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .detail-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .detail-sidebar > .ad-slot { grid-column: 1 / -1; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-header { align-items: stretch; flex-direction: column; }
  .compact-search { grid-template-columns: minmax(0, 1fr) 80px; }
  .upload-config { grid-template-columns: 1fr; gap: 0; }
  .batch-options-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .header-inner { gap: 2px 10px; }
  .brand img { width: 134px; }
  .account-nav .button { min-height: 34px; padding-inline: 9px; }
  .main-nav { scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .search-band-inner { min-height: 320px; padding-block: 34px 25px; }
  .hero-eyebrow { margin-bottom: 6px; }
  .search-band h1 { font-size: 30px; }
  .search-band p { margin-bottom: 20px; font-size: 15px; }
  .hero-search { grid-template-columns: minmax(0, 1fr) 78px; }
  .hero-search input { height: 50px; padding-inline: 13px; }
  .hero-search .button { height: 50px; padding-inline: 10px; }
  .quick-categories { max-height: 68px; overflow: hidden; }
  .collection-stats { margin-top: 18px; gap: 18px; }
  .collection-stats span { display: flex; flex-direction: column; }
  .page-stack { padding-block: 28px 42px; gap: 36px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 21px; }
  .section-heading > a { padding-top: 3px; white-space: nowrap; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .document-card-body { padding: 12px; }
  .document-card h3 { min-height: 40px; font-size: 14px; }
  .document-card p { min-height: 39px; }
  .cover-placeholder { width: calc(100% - 18px); height: calc(100% - 18px); margin: 9px; padding-inline: 12px; }
  .cover-title { font-size: 13px; }
  .manual-label { font-size: 8px; }
  .document-meta { flex-direction: column; gap: 2px; }
  .ranking-list { display: block; }
  .category-grid, .intro-columns, .detail-sidebar { grid-template-columns: 1fr; }
  .category-group { min-height: auto; }
  .list-header { padding-top: 2px; }
  .list-header h1 { font-size: 23px; }
  .sort-tabs { overflow-x: auto; }
  .sort-tabs a { white-space: nowrap; }
  .sort-tabs span { display: none; }
  .document-header { padding: 17px; }
  .file-badge { width: 46px; height: 54px; }
  .document-title-block h1 { font-size: 21px; }
  .product-intro, .preview-section, .text-excerpt { padding: 17px; }
  .preview-pages { padding: 8px; }
  .detail-sidebar > .ad-slot { grid-column: auto; }
  .checkbox-grid > div { grid-template-columns: repeat(2, 1fr); }
  .form-page { padding: 18px; }
  .footer-inner { padding-block: 27px; align-items: center; }
  .footer-links, .footer-records { justify-content: center; }
  .reader-toolbar { right: 12px; bottom: 12px; }
}
