/* 陪谈增值服务预约系统 — 公共样式 */
:root {
  --bg: #f0f3f6;
  --bg-deep: #e4ebf2;
  --surface: #ffffff;
  --ink: #1a2332;
  --ink-muted: #5a6a7e;
  --line: #d0dae6;
  --brand: #0c4a6e;
  --brand-soft: #e0f2fe;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #047857;
  --slot-open: #ecfdf5;
  --slot-busy: #fff7ed;
  --slot-locked: #f1f5f9;
  --slot-final: #fef3c7;
  --shadow: 0 8px 28px rgba(15, 40, 70, 0.08);
  --radius: 10px;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #cfe8f5 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #d5f0ea 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a {
  color: var(--brand);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-top: 0.15rem;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand);
}

.badge.role-c { background: #ede9fe; color: #5b21b6; }
.badge.role-e { background: #ffedd5; color: #9a3412; }
.badge.role-o { background: var(--brand-soft); color: var(--brand); }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand);
}

.panel .hint {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #fef2f2;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.field {
  margin-bottom: 0.9rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.field label .req {
  color: var(--danger);
  margin-left: 0.15rem;
}

.field .tip {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid #99f6e4;
  border-color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

@media (max-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem 0.2rem;
  margin: 0 0 1rem;
}

.fieldset legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
}

.radio-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  cursor: pointer;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-1 { background: #e0e7ff; color: #3730a3; }
.status-2 { background: #dbeafe; color: #1e40af; }
.status-3 { background: #fef3c7; color: #92400e; }
.status-5 { background: #d1fae5; color: #065f46; }
.status-8 { background: #f1f5f9; color: #475569; }
.status-9 { background: #fee2e2; color: #991b1b; }

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 700;
  background: #f8fafc;
}

table.data tr:hover td {
  background: #fafcff;
}

.masked {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 50, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  overflow-y: auto;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(640px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 1.25rem 1.35rem 1.4rem;
}

.modal header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand);
}

.modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 360px;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

.empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.identity-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.identity-bar .field {
  margin: 0;
  flex: 1;
  min-width: 140px;
}