:root {
  --kfc-red: #e1251b;
  --kfc-red-dark: #981b1e;
  --kfc-cream: #fffaf6;
  --kenjoy-orange: #d97706;
  --kenjoy-brown: #6f3f24;
  --kpro-green: #205c40;
  --kpro-ink: #17251f;
  --red-950: #6f0b0b;
  --red-900: #8f1010;
  --red-800: #aa1515;
  --red-700: #c61d1d;
  --red-600: #e1251b;
  --red-500: #ef3d33;
  --red-100: #fee9e7;
  --red-50: #fff5f4;
  --ink-950: #161312;
  --ink-800: #302b29;
  --ink-600: #665e5a;
  --ink-500: #857b76;
  --line: #e9e2de;
  --paper: #fffdfb;
  --canvas: #f6f2ef;
  --amber: #f2a900;
  --amber-soft: #fff4d5;
  --green: #18794e;
  --green-soft: #e8f6ef;
  --blue: #2463a9;
  --blue-soft: #eaf2fb;
  --shadow: 0 14px 36px rgba(60, 27, 20, 0.09);
  --shadow-soft: 0 6px 18px rgba(60, 27, 20, 0.07);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  color: var(--ink-950);
  background: var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:where(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(225, 37, 27, 0.34);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--ink-500);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-950);
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: var(--red-600);
  color: white;
}

.btn-dark {
  background: var(--ink-950);
  color: white;
}

.btn-soft {
  background: var(--red-50);
  color: var(--red-700);
  border-color: #f8c7c3;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-danger {
  background: #fff0ef;
  color: var(--red-700);
  border-color: #f5c4bf;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-800);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f0ece9;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 700;
}

.chip.red {
  background: var(--red-100);
  color: var(--red-700);
}

.chip.amber {
  background: var(--amber-soft);
  color: #8a5a00;
}

.chip.green {
  background: var(--green-soft);
  color: var(--green);
}

.chip.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.panel {
  background: var(--paper);
  border: 1px solid rgba(132, 97, 83, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  min-height: 66px;
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3,
.panel-header p {
  margin: 0;
}

.panel-header h2 {
  font-size: 18px;
}

.panel-header h3 {
  font-size: 16px;
}

.panel-body {
  padding: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink-950);
  background: #fff;
  border: 1px solid #d8cfca;
  border-radius: 10px;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(225, 37, 27, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: 360px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  background: var(--ink-950);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
  transform: translateY(22px);
  opacity: 0;
  pointer-events: none;
  transition: all 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(20, 12, 9, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal-backdrop.open,
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 130;
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(27, 13, 9, 0.3);
  transition: all 180ms ease;
}

.modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal-head,
.modal-foot {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  min-height: 0;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  width: min(520px, calc(100vw - 24px));
  overflow: auto;
  background: var(--paper);
  box-shadow: -20px 0 60px rgba(28, 16, 12, 0.2);
  transform: translateX(102%);
  transition: transform 190ms ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 253, 251, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.drawer-head h2 {
  margin: 0;
  font-size: 20px;
}

.drawer-body {
  padding: 20px;
}

.drawer-foot {
  position: sticky;
  bottom: 0;
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 253, 251, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

