:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #e3e8ef;
  --line-strong: #d0d7e2;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --primary-soft: #e7f6f4;
  --accent: #b45309;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --ok: #16824c;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 36px;
  padding: 8px 13px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: var(--primary-strong);
  color: #fff;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

button.danger:hover:not(:disabled) {
  color: #fff;
}

button.ghost {
  background: #fff;
  color: var(--danger);
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
}

input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.14);
  border-color: var(--primary);
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 38%),
    #f5f7fb;
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 420px;
  gap: 22px;
  align-items: stretch;
}

.login-brand,
.login-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.login-brand {
  min-height: 460px;
  display: grid;
  align-content: space-between;
  padding: 30px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(145deg, #111827, #164e4a 120%);
}

.brand-lockup,
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8f7f5;
  color: var(--primary-strong);
  font-weight: 900;
}

.brand-lockup h1,
.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.brand-lockup p,
.brand p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.brand p {
  color: #b7c3cf;
}

.login-panel-copy span,
.login-card-head span,
.section-title span,
.page-kicker,
.modal-eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-panel-copy h2 {
  margin: 10px 0 12px;
  max-width: 520px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 34px;
  background: var(--panel);
}

.login-card-head h3 {
  margin: 6px 0 0;
  font-size: 30px;
}

.login-card label,
.form-grid label {
  display: grid;
  gap: 7px;
}

.login-card label span,
.form-grid label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-submit {
  min-height: 44px;
  margin-top: 2px;
}

.login-message {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 20px 18px;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  min-height: 40px;
  text-align: left;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.11);
  color: #e8edf3;
}

.nav button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.session-card {
  margin-top: auto;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: var(--sidebar-soft);
}

.session-card span,
.session-card small {
  color: #c7d2de;
  font-size: 12px;
}

.session-card strong {
  color: #fff;
  font-size: 15px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.dot[data-ok="true"] {
  background: var(--ok);
}

.session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.session-actions button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.main {
  min-width: 0;
  width: 100%;
  max-width: 1680px;
  padding: 26px 30px 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 16px;
}

.panel,
.log-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.3;
}

.section-title small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.section-title.compact {
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid.narrow,
.order-panel .form-grid {
  grid-template-columns: 1fr;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.booking-layout.has-selection {
  grid-template-columns: minmax(0, 1fr) 410px;
}

.ticket-catalog {
  min-height: 260px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.item-card {
  position: relative;
  min-height: 116px;
  text-align: left;
  display: grid;
  gap: 8px;
  align-content: start;
  border-radius: 13px;
  padding: 14px 14px 40px;
  background: #fff;
  border-color: #dfe7ef;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.item-card:hover:not(:disabled) {
  background: #fbfefd;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
}

.item-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.item-card strong {
  font-size: 15px;
  line-height: 1.38;
}

.item-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.card-price {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--accent);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.order-panel {
  position: sticky;
  top: 20px;
}

.order-panel .section-title {
  display: grid;
  gap: 4px;
}

.order-panel .actions {
  justify-content: stretch;
}

.order-panel .actions button {
  flex: 1;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar input {
  max-width: 460px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 960px;
}

th,
td {
  border-bottom: 1px solid #edf1f5;
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  color: var(--muted);
  font-weight: 800;
  background: #f8fafc;
  z-index: 1;
}

tbody tr:hover {
  background: #fbfcfe;
}

td small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  min-height: 30px;
  padding: 5px 9px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 16px;
}

.money-input {
  min-width: 90px;
}

.compact-table {
  max-height: 360px;
}

.positive {
  color: var(--ok);
}

.negative {
  color: var(--danger);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 22px;
}

.log-panel {
  margin-top: 16px;
  padding: 14px;
  box-shadow: none;
}

.log {
  display: grid;
  gap: 5px;
  max-height: 126px;
  overflow: auto;
}

.log-row {
  font-size: 12px;
  color: var(--muted);
}

.log-row.ok {
  color: var(--ok);
}

.log-row.error {
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 15, 24, 0.58);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.modal-card {
  width: min(540px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(216, 224, 234, 0.95);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.qr-modal-card {
  width: min(760px, 100%);
}

.refund-modal-card {
  width: min(580px, 100%);
}

.confirm-modal-card {
  width: min(460px, 100%);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-heading h3 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.25;
}

.danger-text {
  color: var(--danger);
}

.soft-button {
  min-height: 34px;
  background: #f8fafc;
  border-color: var(--line);
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.confirm-message {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-box img {
  width: 150px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-order-info {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #dfe7ef;
  border-radius: 14px;
  background: #f8fafc;
}

.qr-order-info:empty {
  display: none;
}

.qr-order-info dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 20px;
  margin: 0;
}

.qr-order-info div,
.refund-order-info div {
  min-width: 0;
}

.qr-order-info dt,
.refund-order-info dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.qr-order-info dd {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.qr-stage {
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.84), #fff);
}

.qr-artwork {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.qr-artwork img {
  max-width: min(300px, 100%);
  height: auto;
  display: block;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.refund-form {
  display: grid;
  gap: 14px;
}

.password-form {
  display: grid;
  gap: 14px;
}

.password-form label {
  display: grid;
  gap: 7px;
}

.password-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.refund-order-info {
  padding: 16px;
  border: 1px solid #f0d4d1;
  border-radius: 14px;
  background: var(--danger-soft);
}

.refund-product {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
}

.refund-order-info dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.refund-order-info dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.refund-quantity {
  display: grid;
  gap: 7px;
}

.refund-quantity span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.refund-quantity input {
  min-height: 46px;
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .booking-layout.has-selection {
    grid-template-columns: 1fr;
  }

  .order-panel {
    position: static;
  }
}

@media (max-width: 920px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 260px;
  }

  .sidebar {
    min-height: auto;
  }

  .session-card {
    margin-top: 0;
  }

  .admin-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .login-view {
    padding: 16px;
  }

  .login-card,
  .login-brand,
  .modal-card {
    padding: 18px;
    border-radius: 14px;
  }

  .item-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .modal-heading {
    display: grid;
  }

  .section-title small {
    text-align: left;
  }

  .session-actions,
  .qr-order-info dl,
  .refund-order-info dl {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
