:root {
  color-scheme: light;
  --ink: #2b3945;
  --muted: #56636c;
  --blue: #4a6783;
  --blue-dark: #395570;
  --line: #e0ddd6;
  --paper: #faf7f0;
  --lift: 0 14px 42px #34333818;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: #ded5ca;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid #527eaa; outline-offset: 4px; }

.wrap { width: min(1224px, calc(100% - 110px)); margin-inline: auto; }
.icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.wallpaper {
  position: fixed;
  z-index: -1;
  inset: 0 -28vw 0 0;
  pointer-events: none;
  background: #e1d7cb url("/wallpaper.webp") left 20% / cover no-repeat;
}
.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0 28vw 0 0;
  background:
    linear-gradient(90deg, #fbf3e6f5 0%, #fbf3e6e8 23%, #fbf3e6b3 39%, #fbf3e619 55%, transparent 72%),
    linear-gradient(0deg, #e6ddd168, transparent 44%);
}
.site-header {
  background: #fcf8f0e6;
  border-bottom: 1px solid #fff9;
  backdrop-filter: blur(12px);
}
.nav-inner { height: 68px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #293d50; font-size: 19px; font-weight: 800; letter-spacing: .035em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff8eb; background: var(--blue); border-radius: 11px; flex: none; box-shadow: 0 4px 10px #4e6b8529; }
.brand-mark .icon { width: 21px; height: 21px; }
.brand-light { color: #5c7489; }
.nav-items { display: flex; align-items: center; gap: 26px; font-weight: 650; font-size: 13px; }
.nav-items a { display: inline-flex; align-items: center; gap: 7px; }
.nav-items .icon { width: 16px; height: 16px; }
.nav-collection:hover { color: #53799a; }
.nav-official { border: 1px solid var(--blue); background: var(--blue); color: #fff; padding: 8px 13px; border-radius: 9px; white-space: nowrap; }
.nav-official:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.hero { min-height: clamp(354px, 44vh, 478px); display: flex; align-items: center; padding-block: 52px 61px; }
.hero-content { width: min(100%, 562px); padding-left: 10px; }
.hero h1 { font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", serif; font-size: clamp(54px, 6vw, 89px); font-weight: 900; letter-spacing: -.065em; line-height: 1.16; color: #2d3e4f; }
.hero h1 span { margin-left: .09em; color: #4c6984; }
.hero p { font-size: clamp(15px, 1.36vw, 19px); font-weight: 500; margin-top: 19px; color: #475562; letter-spacing: .08em; }
.hero-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 31px; }
.search { display: flex; align-items: center; gap: 13px; background: #fffdf9f0; border: 1px solid #fff; padding: 6px 6px 6px 17px; border-radius: 14px; box-shadow: 0 8px 30px #484a4823; }
.search:focus-within { border-color: #8ba4bc; box-shadow: 0 0 0 3px #96adc14d, 0 8px 30px #484a4823; }
.search .icon { color: #5d748b; width: 22px; height: 22px; }
.search input { width: 0; flex: 1; border: 0; background: transparent; outline: 0; color: var(--ink); padding-block: 10px; font-size: 14px; }
.search input::placeholder { color: #697783; opacity: 1; }
.search button { min-width: 68px; min-height: 40px; border: 0; border-radius: 9px; color: #395570; background: #e8eef3; font-size: 14px; font-weight: 650; letter-spacing: .09em; }
.search button:hover { background: #dce6ee; }
.button.hero-official {
  align-self: center;
  min-height: 44px;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid #3e5871;
  border-radius: 11px;
  background: linear-gradient(155deg, #58768f, #415d77);
  box-shadow: 0 5px 15px #364d632d, inset 0 1px #ffffff31;
  font-size: 14px;
  white-space: nowrap;
}
.hero-official .icon { width: 16px; height: 16px; }
.button.hero-official:hover { background: var(--blue-dark); }
.hero-links { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 19px; margin-top: 13px; }
.hero-note, .hero-request { display: inline-flex; align-items: center; gap: 6px; }
.hero-note { color: #445565; font-size: 12px; }
.hero-links .icon { width: 15px; height: 15px; }
.hero-request { padding: 6px 9px; border: 1px solid #8097aa66; border-radius: 8px; background: #fffaf2dd; color: #385572; font-size: 13px; font-weight: 650; }
.hero-request:hover { background: #fffdf8; border-color: var(--blue); }

.library {
  padding: 25px 25px 26px;
  border: 1px solid #fff9;
  border-radius: 24px;
  background: #f8f5edc9;
  box-shadow: var(--lift);
  backdrop-filter: blur(14px);
  scroll-margin-top: 18px;
}
.library-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 14px; }
.library-heading h2 { font-size: 26px; letter-spacing: .035em; }
.resource-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 19px; }
.filter { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; font-size: 13px; font-weight: 600; border: 1px solid #e0dcd5; border-radius: 9px; color: #4d5c69; background: #fffcf6a8; }
.filter .icon { width: 15px; height: 15px; }
.filter:hover { border-color: #8ea5b7; }
.filter.is-active { color: #fff; background: var(--blue); border-color: var(--blue); }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.resource-card { min-width: 0; border-radius: 15px; border: 1px solid #fff7; background: #fffdf8; box-shadow: 0 4px 12px #33333810; transition: box-shadow .2s, transform .2s; }
.resource-card:hover { box-shadow: 0 10px 22px #34374426; transform: translateY(-3px); }
.card-link { display: flex; flex-direction: column; height: 100%; border-radius: inherit; }
.card-image { aspect-ratio: 2.1; overflow: hidden; border-radius: 14px 14px 0 0; background: #e5ded2; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .26s; }
.resource-card:hover .card-image img { transform: scale(1.035); }
.card-body { position: relative; padding: 15px 16px 17px; flex: 1; min-width: 0; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-category { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; overflow-wrap: anywhere; border-radius: 6px; padding: 4px 8px; color: #405b73; background: #e9eff4; font-weight: 650; font-size: 11px; line-height: 1.35; }
.card-downloads { display: inline-flex; align-items: center; gap: 4px; color: #586674; font-size: 11px; white-space: nowrap; }
.card-downloads .icon { width: 13px; height: 13px; }
.card-body h3 { font-size: 17px; line-height: 1.5; margin-top: 9px; padding-right: 33px; overflow-wrap: anywhere; }
.card-body p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.65; padding-right: 35px; overflow-wrap: anywhere; }
.card-arrow { position: absolute; right: 15px; bottom: 16px; display: grid; place-items: center; width: 30px; height: 30px; color: #526c84; background: #edf1f3; border-radius: 9px; }
.card-arrow .icon { width: 15px; height: 15px; }
.resource-card:hover .card-arrow { color: #fff; background: var(--blue); }
.empty { text-align: center; padding: 31px 14px; color: var(--muted); }
.empty .icon { width: 29px; height: 29px; color: var(--blue); margin-bottom: 9px; }
.empty h3 { color: var(--ink); }
.empty p { margin-top: 7px; font-size: 14px; }
.empty a { display: inline-block; color: var(--blue-dark); margin-top: 12px; text-decoration: underline; }

.site-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding: 23px 4px; font-size: 12px; color: #475866; }
.site-footer a { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 5px 8px; background: #fbf5ebe8; }
.site-footer .icon { width: 15px; height: 15px; }
.site-footer a:hover { color: #244968; background: #fff9ef; }
.page-main { padding-block: 38px 25px; flex: 1; }
.surface { border: 1px solid #fff9; border-radius: 22px; background: #fbf8f0f2; box-shadow: var(--lift); backdrop-filter: blur(14px); }
.request-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(18px, 5vw, 80px); margin-top: 21px; padding: clamp(20px, 3.2vw, 36px); scroll-margin-top: 18px; }
.request-intro h2 { margin-top: 12px; font-size: clamp(22px, 2.6vw, 28px); }
.request-intro p { margin-top: 8px; color: var(--muted); line-height: 1.75; }
.request-form > .button, .settings-form > .button { justify-self: start; }
.request-form .notice { margin-top: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 17px; padding: 7px 10px; border-radius: 8px; background: #fbf5ebe8; color: #3f5b74; font-weight: 650; font-size: 13px; }
.back-link:hover { background: #fff9ef; }
.detail-intro { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: center; gap: clamp(22px, 4vw, 58px); padding: clamp(18px, 2.6vw, 37px); }
.detail-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 13px; background: #ece7dc; }
.detail-heading { min-width: 0; padding: 8px 0; }
.detail-heading h1 { font-size: clamp(28px, 3.5vw, 46px); line-height: 1.25; margin-top: 11px; overflow-wrap: anywhere; }
.detail-heading p { color: var(--muted); line-height: 1.8; margin-top: 13px; overflow-wrap: anywhere; }
.detail-download { margin-top: 23px; display: flex; gap: 13px; align-items: center; flex-wrap: wrap; }
.detail-download > span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.download-total { display: inline-flex; gap: 5px; align-items: center; }
.download-total .icon { width: 16px; height: 16px; }
.download-unavailable { padding: 9px 11px; border-radius: 8px; background: #eeeae1; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; min-height: 40px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 650; }
.primary { color: #fff; background: var(--blue); }
.primary:hover { background: var(--blue-dark); }
.secondary { color: #445e75; background: #fffaf1; border-color: #d2d7d8; }
.secondary:hover { border-color: #8da2b3; background: #f3f3ef; }
.compact { min-height: 33px; font-size: 13px; padding: 5px 10px; }
.detail-content { margin-top: 19px; padding: clamp(20px, 4vw, 47px); }
.detail-content h2 { font-size: 24px; }
.detail-content figure { margin: 20px 0 0; }
.detail-content img { max-height: 750px; width: auto; border-radius: 12px; }
.detail-text { margin-top: 16px; color: #424d57; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }

.admin-page .wallpaper::after { background: #f3ede379; backdrop-filter: blur(5px); }
.login-main { display: grid; place-items: center; min-height: 430px; }
.login-panel { width: min(100%, 450px); padding: clamp(22px, 4vw, 37px); }
.login-panel .brand-mark { margin-bottom: 13px; }
.login-panel h1, .admin-heading h1 { font-size: 31px; line-height: 1.35; }
.login-panel > p, .admin-heading p { margin-top: 8px; color: var(--muted); line-height: 1.65; }
.login-panel .form-stack, .login-panel > .button { margin-top: 21px; }
.login-panel .button { justify-self: start; }
.notice { border-radius: 8px; padding: 11px 13px; margin: 16px 0 0; background: #e7efe5; color: #365943; overflow-wrap: anywhere; }
.notice.notice-error { background: #f5e2dd; color: #862e22; }
.admin-panel { padding: clamp(19px, 4vw, 37px); }
.admin-heading, .admin-actions { display: flex; align-items: center; justify-content: space-between; gap: 13px; flex-wrap: wrap; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-block: 12px; border-top: 1px solid var(--line); }
.admin-sort { display: flex; gap: 7px; flex-wrap: wrap; }
.admin-list { margin: 0; padding: 0; list-style: none; }
.admin-list li { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line); }
.admin-list img { width: 84px; height: 51px; object-fit: cover; border-radius: 7px; }
.admin-resource-title { min-width: 0; flex: 1; display: grid; gap: 4px; overflow-wrap: anywhere; }
.admin-resource-title span, .preview-link { font-size: 13px; color: var(--muted); }
.preview-link:hover { text-decoration: underline; }
.request-list { list-style: none; margin: 20px 0 0; padding: 0; }
.request-list li { border-top: 1px solid var(--line); padding-block: 15px; overflow-wrap: anywhere; }
.request-list li > div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 15px; flex-wrap: wrap; }
.request-list h2 { font-size: 17px; }
.request-list time, .field-hint { color: var(--muted); font-size: 13px; }
.request-list li p { margin-top: 8px; line-height: 1.7; white-space: pre-wrap; }
.request-list-empty, .settings-form { margin-top: 18px; }
.settings-panel { max-width: 680px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.form-stack, .upload-column, .block-list { display: grid; gap: 16px; align-content: start; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 650; }
label input, label textarea, .edit-block textarea, .upload-panel input[type="url"] {
  width: 100%; background: #fffdf8; color: var(--ink); border: 1px solid #d5d7d6;
  padding: 10px 11px; border-radius: 8px; font-weight: 400; min-width: 0; font-size: 14px;
}
input::placeholder, textarea::placeholder { color: #6a747e; }
input[type="file"] { font-size: 13px; }
input[type="file"]::file-selector-button { border: 0; color: #344c63; background: #ebeff1; border-radius: 5px; padding: 5px 7px; margin-right: 7px; font: inherit; cursor: pointer; }
textarea { resize: vertical; }
.block-editor, .upload-panel { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f6f1e9; }
.block-editor h2, .upload-panel h2 { font-size: 17px; }
.block-editor > p, .upload-panel > p { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 7px; }
.block-list:not(:empty), .block-buttons, .upload-panel label, .upload-preview { margin-top: 12px; }
.block-buttons, .block-actions, .editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-block { border: 1px solid #dedbd4; background: #fcf9f4; border-radius: 9px; padding: 10px; }
.block-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; font-size: 14px; }
.block-actions button { display: grid; place-items: center; width: 30px; height: 30px; color: var(--ink); border: 1px solid #dedbd4; border-radius: 6px; background: #fffcf8; }
.block-actions .icon { width: 14px; height: 14px; }
.edit-block label + label { margin-top: 9px; }
.upload-preview { max-height: 185px; border-radius: 6px; }
.upload-panel > label[for="download-url"] { margin: 0 0 9px; font-size: 17px; }
.editor-actions { margin-top: 23px; justify-content: flex-end; }
.delete-form { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 15px; }
.delete-form button { background: transparent; padding: 5px 0; border: 0; color: #963e34; text-decoration: underline; font-size: 13px; }

@media (max-width: 1050px) {
  .wrap { width: calc(100% - 64px); }
  .hero-content { padding-left: 3px; }
  .card-body { padding-inline: 13px; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .wallpaper { inset: 0; background-position: 42% 54%; }
  .wallpaper::after { inset: 0; background: linear-gradient(90deg, #fbf3e6ee, #fbf3e6ac 48%, #fbf3e61c), linear-gradient(0deg, #f4ead390, transparent 52%); }
  .nav-inner { height: 59px; }
  .nav-items { gap: 14px; }
  .hero { min-height: 345px; padding-block: 46px; }
  .hero-content { width: min(100%, 520px); }
  .hero h1 { font-size: clamp(45px, 10vw, 68px); }
  .hero p { letter-spacing: .015em; }
  .hero-actions { margin-top: 23px; }
  .search { gap: 8px; padding-left: 10px; }
  .search button { min-width: 61px; }
  .library { border-radius: 17px; padding: 17px; }
  .library-heading h2 { font-size: 22px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .detail-intro { grid-template-columns: 1fr; }
  .detail-cover { aspect-ratio: 16 / 9; }
  .editor-grid, .request-panel { grid-template-columns: 1fr; }
}

@media (max-width: 505px) {
  .wrap { width: calc(100% - 28px); }
  .brand { font-size: 16px; gap: 7px; }
  .brand-mark { width: 31px; height: 31px; }
  .nav-collection { display: none !important; }
  .nav-official { font-size: 12px; padding: 7px 9px; }
  .wallpaper { background-position: 46% center; }
  .wallpaper::after { background: linear-gradient(0deg, #f5ecdee0 0%, #f5ecde6e 70%, #f5ecde16 100%); }
  .hero { min-height: 385px; padding-block: 115px 28px; align-items: flex-end; }
  .hero-content { width: 100%; padding: 0; }
  .hero h1, .hero p, .hero-note { text-shadow: 0 1px 11px #fff9ed, 0 0 8px #fff9ed; }
  .hero h1 { font-size: 50px; }
  .hero p { margin-top: 10px; }
  .hero-actions { grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
  .hero-official { justify-self: start; }
  .hero-links { margin-top: 9px; }
  .filter { padding: 6px 8px; font-size: 12px; }
  .filter .icon { width: 13px; height: 13px; }
  .filters { gap: 5px; }
  .library { padding: 14px; }
  .resource-grid { grid-template-columns: 1fr; }
  .page-main { padding-top: 24px; }
  .admin-list li { gap: 8px; }
  .admin-list img { width: 49px; height: 35px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
