:root {
  color-scheme: light;
  --ink: #10142b;
  --muted: #556074;
  --line: #dbe1eb;
  --paper: #f3f5f9;
  --blue: #174aa1;
  --tint: #eaf2ff;
  --danger: #a22c2c;
  --white: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 1rem; line-height: 1.55 }
h1, h2, h3, p, fieldset { margin: 0 }
h1, h2, h3 { line-height: 1.28 }
a { color: var(--blue); text-underline-offset: .24em }
button, input, select, textarea { color: inherit; font: inherit }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .55 }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .file-label:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.admin-wrap { width: min(1360px, calc(100% - 40px)); margin-inline: auto }
.admin-header { background: var(--white); border-bottom: 1px solid var(--line) }
.admin-bar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px }
.admin-brand { display: flex; align-items: center; color: var(--ink); font: 800 1.65rem/1 system-ui, sans-serif; text-decoration: none; letter-spacing: -.075em }
.admin-brand span { width: 6px; height: 6px; margin-left: 2px; align-self: start; border-radius: 100%; background: #3e9fff }
.admin-brand strong { padding-left: 14px; margin-left: 13px; border-left: 1px solid var(--line); font: 700 .9375rem/1.35 "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: normal }
.admin-top-links { display: flex; gap: 18px; font-size: .9375rem }
.admin-tabs { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap }
.admin-tabs button { padding: 9px 15px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-weight: 650; color: var(--muted) }
.admin-tabs [aria-pressed="true"] { background: var(--white); border-color: var(--line); color: var(--ink) }
.admin-status { min-height: 24px; margin-top: 10px; margin-bottom: 7px; color: var(--blue); font-size: .9375rem }
.status-error { color: var(--danger) !important }

.admin-catalog { display: grid; grid-template-columns: minmax(220px, 288px) minmax(0, 1fr); align-items: start; gap: 18px; padding-bottom: 40px }
.admin-list-panel, .admin-editor { background: var(--white); border: 1px solid var(--line); border-radius: 13px }
.admin-list-panel { position: sticky; top: 18px; padding: 14px; min-width: 0 }
.admin-list-head, .editor-head, .editor-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap }
.admin-list-head h1 { font-size: 1.25rem }
.list-search { margin-block: 14px 8px }
.entry-list { display: grid; gap: 3px; max-height: min(62vh, 620px); overflow: auto; padding: 3px }
.entry-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 67px; border: 1px solid transparent; border-radius: 9px; padding: 8px; background: transparent; text-align: left; overflow-wrap: anywhere }
.entry-button:hover, .entry-button[aria-current="true"] { background: var(--tint); border-color: #cadcf9 }
.entry-thumb { flex: 0 0 51px; width: 51px; height: 45px; object-fit: cover; border-radius: 5px; background: var(--paper) }
.entry-copy { min-width: 0 }
.entry-copy strong, .entry-copy small { display: block }
.entry-copy strong { font-size: .9375rem; line-height: 1.35 }
.entry-copy small { margin-top: 4px; color: var(--muted); font-size: .8125rem }
.list-empty { color: var(--muted); font-size: .9375rem; padding: 9px 0 }

.admin-editor { min-width: 0; padding: clamp(16px, 2.4vw, 32px) }
.admin-editor fieldset { min-inline-size: 0; padding: 0; border: 0 }
.editor-head { position: sticky; z-index: 1; top: 0; margin-top: -8px; padding: 9px 0 16px; border-bottom: 1px solid var(--line); background: var(--white) }
.editor-title { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 11px }
.editor-title h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); overflow-wrap: anywhere }
.entry-state { flex: none; font-size: .8125rem; padding: 3px 7px; border-radius: 5px; background: var(--paper); color: var(--muted) }
.editor-actions, .photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.editor-feedback { flex: 1 0 100%; color: var(--blue); font-size: .9rem }
.editor-feedback:empty { display: none }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-block: 20px }
.editor-fields .wide-field { grid-column: 1 / -1 }
label { display: grid; gap: 5px; min-width: 0; font-size: .9rem; font-weight: 650 }
input:not([type="file"]), textarea, select { width: 100%; min-height: 42px; border: 1px solid var(--line); background: var(--white); padding: 8px 10px; border-radius: 7px; font-weight: 400 }
textarea { resize: vertical }
.button-primary, .button-secondary, .button-small, .file-label {
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
}
.button-primary { background: var(--blue); border-color: var(--blue); color: var(--white) }
.button-primary:hover { background: #123c86 }
.button-secondary:hover, .button-small:not(:disabled):hover, .file-label:hover { background: var(--paper) }
.button-small { min-height: 32px; padding: 4px 8px; font-size: .8125rem }
.button-remove { color: var(--danger) }
.editor-section { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px }
.editor-section-head { margin-bottom: 12px }
.editor-section-head h3 { font-size: 1.13rem }
.spec-list-edit { display: grid; gap: 10px }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.35fr) auto; gap: 10px; align-items: end }
.spec-row button { min-height: 42px }
.file-label { position: relative; cursor: pointer }
.file-label input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr)); gap: 12px }
.photo-card { min-width: 0; display: grid; align-content: start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px }
.photo-preview { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 5px; background: var(--paper) }
.photo-image { width: 100%; height: 100%; object-fit: cover; display: block }
.photo-cover { position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 4px; background: var(--ink); color: var(--white); font-size: .8125rem }
.photo-actions { gap: 5px }
.photo-card label { font-size: .8125rem }
.photo-card input, .photo-card select { font-size: .875rem; min-height: 36px }

.single-panel { max-width: 920px; margin-bottom: 40px }
.single-panel h1, .admin-login h1 { font-size: clamp(1.55rem, 3vw, 2.25rem); margin-bottom: 16px }
#home-content { display: grid; gap: 16px }
.inquiry-entry { padding-block: 15px; border-top: 1px solid var(--line); overflow-wrap: anywhere }
.inquiry-entry h2 { font-size: 1.0625rem }
.inquiry-meta { margin-top: 5px; color: var(--muted); font-size: .875rem }
.inquiry-details { margin-top: 8px; white-space: pre-wrap }
.admin-login { width: min(100%, 480px); margin: clamp(42px, 10vh, 112px) auto; padding: clamp(22px, 5vw, 42px) }
.admin-login p { color: var(--muted); margin-bottom: 22px }

@media (max-width: 840px) {
  .admin-catalog { grid-template-columns: minmax(0, 1fr) }
  .admin-list-panel { position: static }
  .entry-list { max-height: 246px; grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 560px) {
  .admin-wrap { width: calc(100% - 24px) }
  .admin-bar { min-height: 60px }
  .admin-top-links { gap: 9px; font-size: .8125rem }
  .admin-tabs { gap: 3px; margin-top: 12px }
  .admin-tabs button { padding-inline: 9px }
  .entry-list, .editor-fields, .spec-row { grid-template-columns: minmax(0, 1fr) }
  .editor-head { margin-top: -6px }
}
.editor-translations { margin-top: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px }
.editor-translations summary { min-height: 32px; align-content: center; cursor: pointer; font-weight: 600 }
.editor-translations > label, .editor-translations[open] > .editor-fields { margin-top: 10px }
.spec-row > .editor-translations { grid-column: 1 / -1 }
