:root {
  color-scheme: dark;
  --bg: #0c0c0f;
  --panel: #151416;
  --elevated: #211b16;
  --line: #392e21;
  --text: #f8f1e7;
  --muted: #b9ab9b;
  --accent: #e4b978;
  --purple: #e6b365;
  --blue: #af7a40;
  --teal: #67e2cd;
  --rose: #ff9db4;
  --amber: #f6cb81;
  --radius: 11px;
  --font: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { color: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.verifying-session #app, .verifying-session #modal, .verifying-session #toast { visibility: hidden; }
p, h1, h2, h3 { margin: 0; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background-color: #100f10;
  padding: 11px 13px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #a29280; }
select {
  appearance: none;
  padding-right: 2.35rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.icon { width: 1.2em; height: 1.2em; flex: 0 0 auto; vertical-align: middle; }
.brand { display: inline-flex; align-items: center; gap: 11px; white-space: nowrap; font-size: 1.12rem; font-weight: 820; letter-spacing: -.035em; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 7px; color: var(--accent); background: #1e1712; border: 1px solid #735638; font: italic 700 1.48rem/1 Georgia, serif; }
.brand-recharge { color: var(--accent); }
.topbar { position: relative; z-index: 1; min-height: 68px; display: flex; justify-content: space-between; align-items: center; padding: 12px clamp(16px, 4vw, 56px); gap: 12px; border-bottom: 1px solid var(--line); background: #121113; }
.top-actions, .row-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button {
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 650;
  min-height: 42px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  line-height: 1.25;
  transition: background-color .18s, border-color .18s, transform .18s;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #20160d; background: linear-gradient(120deg, #f2ca91, #c99a59); box-shadow: 0 4px 16px #9f703325; }
.button.secondary { border-color: var(--line); color: var(--text); background: var(--elevated); }
.button.quiet { color: var(--muted); background: transparent; }
.button.danger { border-color: #7b3d58; color: var(--rose); background: #351e32; }
.button.secondary:hover, .button.quiet:hover { color: white; border-color: #715738; background: #2d231a; }
.button.danger:hover { border-color: var(--rose); }
.button.small { min-height: 34px; padding: 6px 9px; }
.button.icon-only { width: 36px; min-height: 36px; padding: 4px; }
.login-layout { min-height: calc(100svh - 69px); display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; isolation: isolate; display: flex; align-items: end; min-height: 500px; padding: clamp(25px, 7vw, 98px); overflow: hidden; background: radial-gradient(ellipse at 22% 18%, #5c301b 0%, transparent 52%), radial-gradient(circle at 88% 30%, #574225 0%, transparent 48%), linear-gradient(135deg, #2e1d19, #151113 70%, #2e2017); }
.login-art::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, #0a0909ed 0%, transparent 74%); }
.login-art-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-art-content { max-width: 500px; }
.login-art-content .icon { width: 42px; height: 42px; color: #e4b978; margin-bottom: 1rem; }
.login-art h1 { font-family: Georgia, 'Songti SC', serif; font-size: clamp(2.35rem, 5.4vw, 5.3rem); line-height: 1.02; letter-spacing: -.065em; }
.login-art p { color: #ded2c3; margin-top: 12px; font-size: clamp(1rem, 2vw, 1.25rem); }
.login-panel { display: grid; align-items: center; justify-items: center; padding: 36px 20px; }
.login-window { width: min(100%, 432px); padding: clamp(21px, 4vw, 38px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 64px #0004; }
.login-window h2 { font-family: Georgia, 'Songti SC', serif; color: var(--text); font-size: clamp(1.65rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.login-window p { margin: 5px 0 23px; color: var(--muted); }
.login-window .primary { width: 100%; margin-top: 5px; }
.login-help { display: inline-block; margin-top: 18px; color: var(--accent); font-size: .9rem; text-underline-offset: .18em; }
.login-help:hover { text-decoration: underline; }
.session-help { display: block; margin-top: 7px; text-decoration: underline; }
.login-notice { margin-bottom: 16px; padding: 9px 12px; border: 1px solid #285d58; border-radius: 8px; color: var(--teal); background: #153732; font-size: .9rem; }
.form-field { display: grid; gap: 6px; color: var(--muted); font-weight: 640; font-size: .9rem; min-width: 0; }
.form-field input, .form-field textarea, .form-field select { font-weight: 430; font-size: 1rem; }
.form-stack { display: grid; gap: 16px; }
.inline-status { color: var(--rose); font-size: .92rem; overflow-wrap: anywhere; }
.inline-status:empty { display: none; }
.shell { width: min(100%, 1536px); margin: 0 auto; display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100svh - 69px); }
.sidebar { padding: 25px 16px; border-right: 1px solid var(--line); background: #100f11; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 7px 8px 21px; margin-bottom: 15px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; width: 41px; height: 41px; flex: 0 0 auto; border-radius: 12px; background: #33251b; color: #f1d4a6; font-weight: 790; }
.side-name { font-weight: 750; font-size: .95rem; }
.side-role { color: var(--muted); font-size: .86rem; }
.sidebar nav { display: grid; gap: 6px; }
.nav-button { display: flex; text-align: left; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 10px 11px; font-size: .9rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.nav-button[aria-current="page"] { color: #f0d4a1; background: #281e16; border-color: #4b3827; }
.nav-button:hover { color: var(--text); background: #211b16; }
.badge-count { margin-left: auto; color: white; background: #98672f; border-radius: 50px; min-width: 22px; padding: 1px 5px; text-align: center; font-size: .78rem; }
.workspace { min-width: 0; padding: clamp(20px, 4vw, 48px); }
.page-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.page-head h1 { font-family: Georgia, 'Songti SC', serif; font-size: clamp(1.85rem, 4.2vw, 3.05rem); letter-spacing: -.045em; line-height: 1.12; }
.page-head p { color: var(--muted); margin-top: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-tools { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.panel-tools .search { flex: 1; position: relative; max-width: 400px; }
.search .icon { position: absolute; top: 13px; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; }
.panel-tools select { width: auto; max-width: 48%; }
.panel-tools .result-count { margin-left: auto; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 16px; vertical-align: middle; font-size: .9rem; }
th { color: var(--muted); background: #1b1715; font-size: .86rem; font-weight: 650; white-space: nowrap; }
tbody tr + tr { border-top: 1px solid var(--line); }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.product-cell strong { overflow-wrap: anywhere; }
.thumbnail { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; background: #2b2119; color: var(--accent); flex: 0 0 auto; }
.product-meta { display: block; color: var(--muted); margin-top: 2px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.category-chips .tag { white-space: normal; overflow-wrap: anywhere; }
.row-actions { flex-wrap: nowrap; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #685036; color: #e8c793; background: #2e241a; border-radius: 30px; padding: 3px 9px; white-space: nowrap; font-size: .85rem; }
.tag.approved, .tag.live { border-color: #285d58; color: var(--teal); background: #153732; }
.tag.pending { border-color: #6a542d; color: var(--amber); background: #35291c; }
.tag.rejected, .tag.conflict { border-color: #704056; color: var(--rose); background: #321f30; }
.empty { min-height: 240px; display: grid; justify-items: center; align-content: center; gap: 9px; padding: 26px; text-align: center; color: var(--muted); }
.empty .icon { font-size: 1.65rem; color: var(--accent); }
.empty h2 { font-size: 1.05rem; color: var(--text); }
.details-panel { padding: clamp(18px, 4vw, 28px); max-width: 760px; }
.details-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.details-list dt { color: var(--muted); font-size: .89rem; }
.details-list dd { margin: 5px 0 0; font-weight: 620; overflow-wrap: anywhere; white-space: pre-wrap; }
.details-list .wide { grid-column: 1 / -1; }
.request-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.request-preview { display: grid; gap: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #110f10; }
.request-preview h3 { font-size: 1rem; }
.modal-form { display: grid; gap: 17px; }
#modal { width: min(650px, calc(100% - 24px)); padding: 0; border: 1px solid #624b35; border-radius: var(--radius); color: var(--text); background: var(--panel); box-shadow: 0 24px 70px #0009; overflow-y: auto; max-height: min(90svh, 850px); }
#modal::backdrop { background: #0c0a08bb; backdrop-filter: blur(5px); }
.dialog-head, .dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 17px clamp(15px, 4vw, 25px); }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.27rem; letter-spacing: -.02em; }
.dialog-head-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.dialog-head-actions .button { min-height: 36px; }
.dialog-body { padding: 21px clamp(15px, 4vw, 25px); overflow-wrap: anywhere; }
.dialog-foot { border-top: 1px solid var(--line); justify-content: end; flex-wrap: wrap; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tag-picker { margin: 0; padding: 8px 12px 12px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.tag-picker legend { padding-inline: 5px; color: var(--muted); font-size: .9rem; font-weight: 640; }
.tag-options { display: flex; flex-wrap: wrap; gap: 7px; max-height: 180px; overflow-y: auto; }
.tag-choice { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #171413; color: var(--muted); font-size: .875rem; cursor: pointer; }
.tag-choice:has(:checked) { color: var(--text); border-color: #735638; background: #2e241a; }
.tag-choice input { width: 1rem; height: 1rem; margin: 0; padding: 0; accent-color: var(--accent); }
.tag-choice span { overflow-wrap: anywhere; }
.table-wrap th:last-child { text-align: right; }
.image-tools { padding: 13px; border: 1px dashed #685238; border-radius: 11px; background: #131012; }
.image-tools:empty { display: none; }
.image-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; }
.image-tools p, .hint { color: var(--muted); font-size: .88rem; }
.images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(111px, 1fr)); gap: 10px; margin-top: 10px; }
.images-grid:empty { display: none; }
.image-tile { min-width: 0; position: relative; background: var(--elevated); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.image-tile img { display: block; width: 100%; height: 90px; object-fit: cover; background-color: #2d211a; }
.image-tile .tag { position: absolute; inset: 6px auto auto 6px; font-size: .74rem; padding: 0 6px; }
.image-actions { display: flex; justify-content: center; padding: 3px 0; }
.image-actions .button { width: 30px; min-height: 29px; }
.image-actions button:disabled { cursor: default; }
.detail-photos { margin-top: 14px; }
.detail-photos img { width: 100%; aspect-ratio: 1.4; height: unset; }
#toast { position: fixed; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 11px 17px; border: 1px solid #715738; border-radius: 11px; color: #fff; background: #2a2018; box-shadow: 0 8px 30px #0006; }
#toast:empty { display: none; }
.load-area { min-height: 40svh; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 20px; color: var(--muted); }
@media (max-width: 980px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .workspace { padding: 25px 18px; }
  th, td { padding: 11px; }
}
@media (max-width: 740px) {
  .shell { display: block; }
  .sidebar { padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-user { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 5px; padding-bottom: 2px; }
  .nav-button { padding: 8px; }
  .nav-button .icon { display: none; }
  .login-layout { display: flex; flex-direction: column; }
  .login-art { min-height: 200px; }
  .login-art-content .icon { display: none; }
  .panel-tools { flex-wrap: wrap; }
  .panel-tools .search { flex: 1 1 170px; }
  .panel-tools .result-count { display: none; }
  .top-actions .store-link { display: none; }
  .topbar.login .store-link { display: inline-flex; }
}
@media (max-width: 400px) {
  .topbar { padding-inline: 12px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .top-actions .button { padding-inline: 8px; }
  .top-actions .icon { display: none; }
  .two-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
