:root {
  color-scheme: light;
  --ink: #231e34;
  --muted: #635d72;
  --line: #e8e3ed;
  --surface: #fff;
  --page: #f8f7fb;
  --accent: #6542a6;
  --accent-deep: #4e3186;
  --tint: #f2ecfb;
  --danger: #a53b54;
  font: 15px/1.55 Inter, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 4vw, 2rem); }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
a { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, button, select, textarea { font: inherit; }
input, textarea, select {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  padding: .62rem .72rem;
  width: 100%;
  min-width: 0;
}
textarea { resize: vertical; min-height: 75px; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  padding: .48rem .78rem;
  min-height: 2.45rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
}
.primary { color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-deep); }
.secondary { background: var(--surface); color: var(--accent-deep); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: var(--tint); }
.danger { background: var(--surface); border-color: var(--line); color: var(--danger); }
.danger:hover:not(:disabled) { background: #fff1f3; }
.small { min-height: 2rem; padding: .3rem .55rem; font-size: .83rem; }
.login {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 75% 4%, #eee5fc, transparent 50%), var(--page);
}
.login-card { width: min(100%, 390px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.85rem; display: grid; gap: 1rem; box-shadow: 0 15px 60px #310e5812; }
.brand-mark { width: 2.38rem; height: 2.38rem; border-radius: 11px; display: inline-grid; place-items: center; color: white; background: var(--accent); font-weight: 700; }
.brand { display: flex; gap: .75rem; align-items: center; font-weight: 760; font-size: 1.05rem; white-space: nowrap; }
.boot { padding: 2rem; text-align: center; color: var(--muted); }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 4.45rem; max-width: 91rem; margin-inline: auto; padding: .7rem 1.5rem; display: flex; justify-content: space-between; gap: .7rem; align-items: center; }
.top-actions, .editor-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .48rem; }
.shell { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(1.1rem, 3vw, 2.5rem); align-items: start; max-width: 91rem; margin-inline: auto; padding: 1.75rem 1.5rem 3rem; }
.navigation { display: grid; gap: .32rem; position: sticky; top: .9rem; }
.navigation button { border-radius: 9px; padding: .65rem .82rem; border: 0; background: transparent; text-align: left; color: var(--muted); font-weight: 640; }
.navigation button:hover, .navigation button[aria-current="page"] { color: var(--accent-deep); background: var(--tint); }
.editor-toolbar { position: sticky; top: 0; z-index: 2; background: var(--page); padding: .6rem 0 .5rem; }
.editor-header { min-height: 4rem; display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .8rem; }
.editor-header p, .revision, .muted { color: var(--muted); font-size: .88rem; }
.editor-actions { margin-top: .18rem; }
.revision { margin-right: .2rem; }
.revision.dirty { color: var(--accent-deep); font-weight: 700; }
.status { overflow-wrap: anywhere; color: var(--accent-deep); margin-block: .25rem .75rem; }
.status:empty { display: none; }
.status.error { color: var(--danger); }
.editor-toolbar .status { margin-bottom: 0; }
.panel, .list-panel, .setting-group { padding: clamp(.85rem, 2vw, 1.35rem); border-radius: 13px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.panel + .panel, .setting-group + .setting-group { margin-top: .9rem; }
.panel-header, .section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: .85rem; }
.section-header { border-top: 1px solid var(--line); margin-top: 1.15rem; padding-top: 1rem; }
.field { display: grid; gap: .35rem; min-width: 0; font-weight: 630; font-size: .88rem; }
.field input, .field select, .field textarea { font-weight: 400; }
.fields { display: grid; gap: .72rem; }
.two { grid-template-columns: 1fr 1fr; }
.span { grid-column: 1 / -1; }
.staff-layout { display: grid; gap: .9rem; grid-template-columns: minmax(190px, .53fr) minmax(0, 1.6fr); align-items: start; }
.list-panel { position: sticky; top: .9rem; }
.staff-list { padding: .08rem 0; margin: .6rem 0 0; list-style: none; max-height: 62vh; overflow-y: auto; }
.staff-list button { width: 100%; text-align: left; background: var(--surface); color: var(--ink); border: 0; padding: .59rem .52rem; border-radius: 7px; display: flex; align-items: baseline; gap: .35rem; justify-content: space-between; overflow-wrap: anywhere; }
.staff-list button:hover, .staff-list button[aria-current="true"] { background: var(--tint); color: var(--accent-deep); }
.staff-list button small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.service, .gallery-item { border: 1px solid var(--line); border-radius: 9px; padding: .75rem; margin-bottom: .65rem; }
.service .actions, .gallery-item .actions { margin-top: .65rem; }
.gallery-grid, .library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: .66rem; }
.gallery-item { margin-bottom: 0; }
.gallery-extra { margin-top: .65rem; font-size: .84rem; }
.media-thumb { width: 100%; display: block; height: 106px; object-fit: contain; background: #f1eef7; border-radius: 7px; margin-bottom: .5rem; }
.media-tile .media-thumb { height: 124px; }
.media-label { font-size: .86rem; overflow-wrap: anywhere; margin-bottom: .45rem; }
.upload-slot { position: relative; display: inline-flex; }
.upload-slot input { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; padding: 0; }
.upload-slot:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.upload-slot label { cursor: pointer; }
.setting-group { display: grid; gap: .9rem; }
.settings-search { max-width: 27rem; margin-bottom: .88rem; }
.setting-row { display: grid; grid-template-columns: minmax(7rem, .42fr) minmax(0, 1fr) auto; align-items: start; gap: .55rem; }
.setting-row label { font-size: .9rem; font-weight: 640; padding-top: .45rem; }
.setting-row label.button { padding-top: .25rem; }
.setting-row .actions { align-self: start; }
.setting-row input[type="checkbox"] { margin-top: .55rem; }
.setting-row .media-thumb { width: 128px; margin: .42rem 0 0; }
.subtext { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.intro-preview { width: 100%; min-height: 270px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.intro-controls { margin-bottom: .7rem; }
.intro-field { margin: .4rem 0; }
.intro-editor { font-family: ui-monospace, Menlo, Consolas, monospace; min-height: 270px; }
details summary { cursor: pointer; margin-bottom: .55rem; color: var(--accent-deep); font-weight: 650; }
.picker { padding: 1rem; width: min(92vw, 750px); max-height: 83vh; border: 1px solid var(--line); border-radius: 13px; }
.picker::backdrop { background: #231e3477; }
.picker header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; padding: 1rem; }
  .navigation { display: flex; flex-wrap: wrap; position: static; }
}
@media (max-width: 625px) {
  .staff-layout, .two { grid-template-columns: 1fr; }
  .editor-header { gap: .28rem; min-height: 0; }
  .editor-header p { display: none; }
  .list-panel { position: static; }
  .staff-list { max-height: 145px; }
  .setting-row { grid-template-columns: minmax(0, 1fr) auto; }
  .setting-row > label { grid-column: 1 / -1; padding-top: 0; }
  .topbar-inner { padding-inline: 1rem; }
}
