:root {
  color-scheme: light;
  --paper: #f9f6f1;
  --card: #fffcf8;
  --ink: #32242a;
  --muted: #71636a;
  --wine: #81394c;
  --wine-dark: #632337;
  --line: #e7ddd7;
  --rose: #f4e6e8;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --body: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 4px; }
[data-icon] { display: inline-flex; flex: none; align-items: center; justify-content: center; }
[data-icon] svg { width: 1.08em; height: 1.08em; }
.wrap { width: min(1152px, calc(100% - 80px)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 4; inset: 8px auto auto 8px; transform: translateY(-160%); padding: 10px 14px; background: white; }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand img { display: block; }
.brand span { display: grid; gap: 4px; font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: .045em; }
.brand small { font-family: Georgia, serif; color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .16em; }
nav { display: flex; gap: 35px; align-self: stretch; white-space: nowrap; }
nav a { display: grid; align-content: center; color: var(--muted); position: relative; font-size: 14px; }
nav a:hover, nav a.nav-current { color: var(--wine); }
nav a.nav-current::after { content: ""; height: 2px; background: var(--wine); position: absolute; inset: auto 0 -1px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; min-height: 42px; border: 1px solid transparent; border-radius: 7px; font-weight: 650; white-space: nowrap; font-size: 14px; transition: background-color .16s ease, border-color .16s ease; }
.primary { background: var(--wine); color: #fffaf7; border-color: var(--wine); }
.primary:hover { background: var(--wine-dark); border-color: var(--wine-dark); }
.outline { color: var(--wine); background: transparent; border-color: #d9c4c5; }
.outline:hover { background: #f4e7e8; border-color: #c8a8ae; }
button:disabled { cursor: default; opacity: .54; }
.hero { display: grid; grid-template-columns: 1.07fr 1fr; overflow: hidden; min-height: 388px; margin-block: 34px 46px; border: 1px solid #e8d7d5; border-radius: 16px; background: #f4e9e5; }
.hero-content { padding: clamp(27px, 3vw, 43px) clamp(30px, 4.25vw, 64px); align-self: center; }
.kicker { display: flex; align-items: center; gap: 9px; color: var(--wine); font-size: 13px; font-weight: 650; letter-spacing: .12em; margin-bottom: 19px; }
.kicker span { width: 20px; height: 1px; background: var(--wine); }
.hero h1 { font: 800 clamp(38px, 4.55vw, 67px)/1.17 var(--serif); letter-spacing: -.075em; }
.hero em { font-style: normal; color: var(--wine); }
.hero-description { margin-top: 21px; color: #65535a; font-size: 15px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 25px; }
.hero-actions .button { padding-inline: 15px; }
.hero-photo { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 55% 52%; display: block; }
.main-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); align-items: start; gap: 30px; }
#catalog, #guide { scroll-margin-top: 20px; min-width: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 17px; }
.section-heading h2, .guide-card h2, .dialog-head h2 { font-family: var(--serif); font-size: 29px; line-height: 1.26; letter-spacing: -.025em; }
.section-heading p { color: var(--muted); font-size: 13px; }
.search { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 9px; min-height: 55px; padding: 5px 5px 5px 15px; gap: 7px; }
.search > [data-icon] { font-size: 19px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 8px 5px; font-size: 14px; }
.search input:focus-visible { outline-offset: -2px; }
.search .button { min-height: 43px; padding-inline: 22px; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-block: 17px 14px; }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid transparent; padding: 7px 11px; min-height: 36px; border-radius: 6px; background: transparent; font-size: 13px; color: var(--muted); white-space: nowrap; }
.filters button:hover { background: #f4ece7; color: var(--wine); }
.filters button[aria-pressed="true"] { background: var(--rose); border-color: #ecd8dd; color: var(--wine-dark); font-weight: 700; }
.sort { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.sort select { border: 0; background: transparent; padding: 5px 3px; }
.empty, .loading { min-height: 231px; padding: 29px 18px; background: var(--card); border: 1px dashed #e0d1cd; border-radius: 11px; text-align: center; }
.empty { display: flex; align-items: center; flex-direction: column; justify-content: center; }
.empty-mark, .guide-icon, .source-mark { display: grid; place-items: center; background: var(--rose); color: var(--wine); border-radius: 9px; width: 42px; height: 42px; font-size: 22px; }
.empty h3 { margin-top: 12px; font-family: var(--serif); font-size: 20px; }
.empty p, .loading { color: var(--muted); font-size: 14px; line-height: 1.75; }
.empty p { margin-top: 5px; }
.empty .button { margin-top: 16px; min-height: 38px; padding-block: 7px; }
.guide-card { background: #f3eae4; border: 1px solid #e8d9d1; border-radius: 12px; padding: 21px; }
.guide-icon { background: #eeddde; width: 38px; height: 38px; font-size: 19px; }
.guide-card h2 { font-size: 21px; margin-top: 13px; }
.guide-card ol { margin: 18px 0 16px; padding: 0; list-style: none; display: grid; gap: 14px; }
.guide-card li { display: flex; gap: 9px; align-items: start; font-size: 13px; }
.guide-card li > span { display: grid; place-items: center; color: var(--wine); background: #eadade; border-radius: 50%; flex: 0 0 21px; height: 21px; font: 600 12px Georgia, serif; }
.guide-card strong { line-height: 21px; font-weight: 650; }
.guide-card li p { font-size: 12px; line-height: 1.65; color: var(--muted); margin-top: 1px; }
.guide-link { display: inline-flex; align-items: center; gap: 6px; border-top: 1px solid #e2d3cb; padding-top: 15px; width: 100%; font-size: 13px; font-weight: 650; color: var(--wine); }
.guide-link:hover { text-decoration: underline; }
.source-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.source-card { display: flex; align-items: flex-start; gap: 13px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 16px; }
.source-card:hover { border-color: #d9bbb9; }
.source-mark { flex: none; background: #f4e8e9; }
.source-card-body { flex: 1; min-width: 0; }
.source-card h3 { font-family: var(--serif); font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.source-card h3 a:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 4px; }
.source-card-desc { margin: 5px 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin-top: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.tag { border-radius: 4px; padding: 3px 6px; background: var(--rose); color: var(--wine-dark); font-size: 11px; font-weight: 650; white-space: nowrap; }
.card-button { align-self: center; min-height: 39px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 52px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 82px; font-size: 13px; color: var(--muted); }
.footer-inner .brand { color: var(--ink); }
.footer-inner .brand span { font-size: 17px; }
.footer-inner > a:last-child { display: inline-flex; gap: 5px; align-items: center; color: var(--wine); white-space: nowrap; }
dialog { border: 1px solid #decfc9; border-radius: 14px; background: var(--card); padding: 26px; color: var(--ink); width: min(560px, calc(100% - 24px)); max-height: calc(100% - 32px); overflow: auto; box-shadow: 0 24px 70px #43273430; }
dialog::backdrop { background: rgba(48, 32, 39, .5); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 18px; overflow-wrap: anywhere; }
.dialog-head h2 { font-size: 27px; }
.dialog-head p { font-size: 13px; line-height: 1.65; color: var(--muted); margin-top: 5px; }
.icon-button { display: grid; place-items: center; border: 0; background: #f4eae7; color: var(--wine); width: 34px; height: 34px; border-radius: 6px; flex: none; }
.icon-button:hover { background: #efdbde; }
.guide-methods { display: grid; gap: 12px; }
.guide-methods section { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #faf1ed; }
.guide-methods h3 { display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--wine-dark); }
.guide-methods p { margin-top: 6px; font-size: 13px; line-height: 1.7; color: var(--muted); }
#guide-dialog .dialog-actions { flex-wrap: wrap; }
.upload-modes { margin-bottom: 10px; }
.drop-zone { min-height: 100px; width: 100%; border: 1px dashed #cfb4b6; border-radius: 8px; background: #faf1ef; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 12px; overflow-wrap: anywhere; color: var(--wine-dark); }
.drop-zone:hover, .drop-zone.dragover { background: #f5e5e6; }
.upload-icon { font-size: 22px; }
.drop-zone strong { font-size: 14px; }
.drop-zone small { font-size: 12px; color: var(--muted); }
.upload-title-field { margin-top: 14px; }
#upload-form label, #auth-form label, .detail-link { display: block; font-size: 13px; font-weight: 650; margin-bottom: 12px; }
#upload-form label small { color: var(--muted); font-weight: 400; }
#upload-form label input:not([type=checkbox]), #upload-form textarea, #auth-form input, .detail-link input {
  display: block; width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; background: #fffdfa; font-size: 14px; font-weight: 400; margin-top: 5px; min-width: 0;
}
#upload-form textarea { resize: vertical; }
#upload-form label.consent { display: flex; align-items: start; gap: 8px; font-weight: 400; line-height: 1.6; }
.consent input { accent-color: var(--wine); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.form-error { color: #962b43; background: #f9e9eb; border-radius: 6px; font-size: 13px; padding: 9px 11px; margin-bottom: 10px; overflow-wrap: anywhere; }
.dialog-head .detail-format { color: var(--wine); font-weight: 650; margin: 0 0 5px; }
.detail-description { font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 14px; }
.import-box { padding: 15px; background: #f6ebe9; border: 1px solid #ecd9d7; border-radius: 8px; margin-bottom: 14px; }
.import-box h3 { font-size: 16px; margin-bottom: 5px; }
.import-box p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.import-actions, .detail-utilities { display: flex; gap: 8px; flex-wrap: wrap; }
.source-qr { padding-top: 12px; margin-top: 14px; border-top: 1px solid var(--line); }
.source-qr summary { width: fit-content; color: var(--wine); font-size: 13px; font-weight: 650; cursor: pointer; }
.source-qr img { display: block; max-width: 100%; height: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.source-qr p { margin: 8px 0 0; }
.detail-link > span { display: flex; align-items: stretch; gap: 6px; margin-top: 5px; }
.detail-link input { margin: 0; }
.auth-modes { margin: 0 0 15px; }
.auth-actions { align-items: center; }
.auth-help { margin-right: auto; padding: 8px 0; border: 0; background: transparent; color: var(--wine); font-size: 13px; }
.auth-help:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-status, .email-verification { border: 1px solid var(--line); border-radius: 8px; background: #faf1ed; }
.auth-status { padding: 9px 11px; color: var(--wine-dark); font-size: 13px; }
#preview { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 13px; }
#preview summary { font-size: 13px; color: var(--wine); cursor: pointer; }
#preview pre, #inspection-code { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 330px; overflow: auto; background: #f4ebe5; padding: 12px; line-height: 1.5; font-size: 12px; }
.toast { position: fixed; z-index: 3; inset: auto max(16px, calc((100vw - 1152px) / 2)) 22px auto; padding: 11px 16px; max-width: calc(100vw - 32px); border-radius: 8px; background: var(--wine-dark); color: white; font-size: 14px; box-shadow: 0 6px 30px #4b223546; }
dialog > .toast { position: sticky; right: auto; bottom: 0; margin-top: 9px; width: fit-content; }
.workspace { padding-top: 31px; min-height: 57vh; }
.workspace-back { display: inline-block; margin-bottom: 13px; color: var(--wine); font-size: 13px; }
.workspace-back:hover, .workspace-row h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.workspace-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-bottom: 22px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.workspace h1 { font: 750 clamp(32px, 4.5vw, 53px)/1.25 var(--serif); letter-spacing: -.055em; }
#workspace-profile { margin-top: 7px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.email-verification { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; padding: 13px 16px; }
.email-verification strong { font-size: 14px; color: var(--wine-dark); }
.email-verification p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.workspace-actions, .workspace-row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
#workspace-admin-link { display: none; }
#workspace-gate h2, .workspace-section-heading h2 { font: 700 24px/1.3 var(--serif); }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.admin-stats > div { display: grid; gap: 7px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.admin-stats span { color: var(--muted); font-size: 13px; }
.admin-stats strong { font: 500 33px/1.12 Georgia, serif; color: var(--wine); }
.workspace-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.workspace-search { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 10px; align-items: stretch; }
.workspace-filter select { height: 100%; min-height: 48px; padding: 8px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.workspace-status { margin: 12px 0; color: var(--muted); font-size: 13px; min-height: 1em; }
.workspace-list { display: grid; gap: 9px; list-style: none; padding: 0; margin: 0; }
.workspace-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; background: var(--card); }
.workspace-row-main { flex: 1 1 260px; min-width: 0; }
.workspace-row h3 { font: 700 19px/1.3 var(--serif); overflow-wrap: anywhere; }
.workspace-row h3 a { color: var(--wine-dark); }
.workspace-row p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace-row-actions .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.status-label { display: inline-block; color: var(--muted); background: #eee8e4; border-radius: 4px; padding: 2px 6px; font-size: 11px; font-weight: 650; }
.status-label[data-tone="ok"] { color: #315c4d; background: #e8efea; }
.status-label[data-tone="alert"] { color: var(--wine-dark); background: var(--rose); }
@media (max-width: 900px) {
  .header-inner { gap: 17px; }
  nav { gap: 17px; }
  .wrap { width: calc(100% - 48px); }
  .hero { margin-block: 24px 34px; min-height: 342px; }
  .hero-content { padding: 26px; }
  .main-columns { grid-template-columns: minmax(0, 1fr) 220px; gap: 19px; }
  .guide-card { padding: 16px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .header-inner { height: 62px; gap: 12px; }
  .header-inner .brand img { width: 34px; height: 34px; }
  .brand span { font-size: 17px; }
  nav { display: none; }
  .header-actions { gap: 5px; }
  .header-actions .button { min-height: 38px; padding: 6px 8px; font-size: 12px; }
  .header-actions [data-upload] [data-icon] { display: none; }
  .hero { grid-template-columns: 1fr; margin-block: 17px 27px; }
  .hero-content { padding: 24px 21px 23px; }
  .hero h1 { font-size: clamp(36px, 9.5vw, 51px); }
  .kicker { margin-bottom: 12px; }
  .hero-description { margin-top: 13px; font-size: 13px; }
  .hero-actions { margin-top: 16px; gap: 7px; }
  .hero-photo { height: clamp(159px, 47vw, 250px); object-position: center 58%; }
  .main-columns { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading p, .search input { font-size: 12px; }
  .search .button { padding-inline: 12px; }
  .catalog-toolbar { gap: 6px; }
  .filters { gap: 2px; }
  .filters button { padding-inline: 7px; }
  .source-card { padding: 11px; gap: 8px; }
  .source-card h3 { font-size: 17px; }
  .source-mark { width: 33px; height: 33px; font-size: 16px; }
  .card-button { padding-inline: 6px; gap: 3px; font-size: 12px; }
  .footer-inner { flex-wrap: wrap; padding-block: 13px; }
  .footer-inner p { order: 1; width: 100%; }
  .site-footer { margin-top: 33px; }
  dialog { padding: 17px; }
  .workspace { padding-top: 19px; }
  #workspace-admin-link { display: inline-flex; }
  .workspace-header { padding-bottom: 16px; margin-bottom: 16px; }
  .admin-stats { gap: 6px; }
  .admin-stats > div { padding: 10px; }
  .admin-stats span { font-size: 11px; }
  .admin-stats strong { font-size: 26px; }
  .workspace-row { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
