:root {
  --bg-base: #f3f6fb;
  --bg-elevated: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-soft-2: #eef3fb;
  --line: #d7e0ec;
  --line-strong: #c4d0e3;
  --text: #0f172a;
  --text-muted: #5d6b82;
  --primary: #1565c0;
  --primary-strong: #0f4f98;
  --primary-soft: #e9f3ff;
  --success: #057857;
  --success-soft: #eafaf2;
  --warning: #a16207;
  --warning-soft: #fffbeb;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 32px rgba(15, 23, 42, 0.1);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(130% 90% at 12% 0%, #e6f0ff 0%, transparent 58%),
    radial-gradient(120% 100% at 90% 4%, #eafcf5 0%, transparent 46%),
    linear-gradient(180deg, #f7f9fd 0%, #eff4fb 100%);
}

.bg-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(38px);
  opacity: 0.5;
}

.shape-a {
  width: 260px;
  height: 260px;
  left: -70px;
  top: 42px;
  background: #bfdbfe;
}

.shape-b {
  width: 220px;
  height: 220px;
  right: 4%;
  top: 90px;
  background: #c7f9d9;
}

.shape-c {
  width: 220px;
  height: 220px;
  right: -90px;
  bottom: 56px;
  background: #dbeafe;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 12px 26px;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 224, 236, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(3px);
  padding: 16px;
}

.screen {
  animation: fade-in 0.22s ease;
}

.login-shell {
  max-width: 540px;
  margin: 42px auto 0;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.73rem;
  letter-spacing: 0.09em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #cfe5ff;
}

.brand-title {
  margin: 0 0 8px;
  font-size: 1.62rem;
  line-height: 1.3;
}

.brand-sub {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.login-highlight span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.82rem;
  color: #334155;
  background: #f2f6fc;
  border: 1px solid var(--line);
}

.form-grid {
  display: grid;
  gap: 11px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8ea0ba;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #7ab0ef;
  box-shadow: 0 0 0 3px rgba(73, 140, 219, 0.18);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #1b76d2 0%, #145fb0 100%);
  border-color: #1b68be;
  box-shadow: 0 8px 18px rgba(21, 101, 192, 0.24);
}

.btn-soft {
  color: #334155;
  background: #f7f9fc;
  border-color: var(--line);
}

.btn-ghost {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #c9ddf9;
}

.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #e24568 0%, #cb1f46 100%);
  border-color: #be123c;
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.2);
}

a.btn {
  text-decoration: none;
}

.btn-full {
  width: 100%;
}

.demo-accounts {
  margin-top: 13px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.62;
}

.dashboard-grid {
  display: grid;
  gap: 11px;
}

.top-card {
  display: grid;
  gap: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.94));
}

.top-main {
  display: grid;
  gap: 12px;
}

.top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.top-name {
  margin: 0;
  font-size: 1.34rem;
  line-height: 1.2;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.79rem;
  color: #3f4f66;
  background: #f4f7fc;
  border: 1px solid var(--line);
}

.chip-role {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b9ebd2;
}

.chip.unread {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #f8dc8a;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.kpi-item {
  border-radius: var(--radius-md);
  border: 1px solid #d8e4f5;
  background: linear-gradient(180deg, #fafdff 0%, #f1f7ff 100%);
  padding: 12px;
}

.kpi-label {
  margin: 0;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.kpi-value {
  margin: 5px 0 0;
  font-size: 1.14rem;
  font-weight: 700;
}

.tab-wrap {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  background: #f2f6fc;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
}

.tab-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #3c4e67;
  padding: 8px 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #1f78d3 0%, #145daa 100%);
  border-color: #1b68be;
  box-shadow: 0 5px 16px rgba(21, 95, 173, 0.3);
}

.layout {
  display: grid;
  gap: 11px;
}

.panel {
  padding: 16px;
}

.section-title {
  margin: 0;
  font-size: 1.08rem;
}

.section-note {
  margin: 7px 0 12px;
}

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

.session-list {
  display: grid;
  gap: 10px;
}

.session-card {
  border: 1px solid #dce5f2;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 9px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.session-card.cancelled {
  background: #f7f9fc;
  border-color: #d8dee8;
}

.session-head {
  display: flex;
  justify-content: space-between;
  gap: 9px;
}

.session-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.48;
}

.session-sub {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.79rem;
  color: #3c4c63;
  border: 1px solid #d5e0ed;
  background: #f7fafe;
}

.meta-pill.holiday {
  color: var(--warning);
  border-color: #f4d487;
  background: var(--warning-soft);
}

.meta-pill.full {
  color: var(--danger);
  border-color: #f8c1cc;
  background: var(--danger-soft);
}

.session-action .btn {
  min-width: 126px;
}

.manager-row {
  display: grid;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px dashed #d7e1ef;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-actions select {
  min-width: 220px;
  flex: 1;
}

.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #d8e4f2;
  background: var(--bg-soft);
  color: #3b4a5f;
  font-size: 0.82rem;
  padding: 5px 10px;
}

.participant-chip button {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 0.82rem;
  padding: 0;
  cursor: pointer;
}

.session-builder {
  display: grid;
  gap: 10px;
}

.session-row {
  border: 1px solid #d8e2ef;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 11px;
  display: grid;
  gap: 8px;
}

.session-default-name {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #425269;
  border: 1px solid #d4dfed;
  background: var(--bg-soft);
  width: fit-content;
}

.session-grid {
  display: grid;
  gap: 8px;
}

.price-flag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.82rem;
  color: var(--success);
  border: 1px solid #bfe7d3;
  background: var(--success-soft);
}

.summary-grid {
  display: grid;
  gap: 8px;
}

.summary-card {
  border: 1px solid #d8e3f2;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff 0%, #f2f7ff 100%);
  padding: 11px;
}

.summary-value {
  margin: 4px 0 0;
  font-size: 1.17rem;
  font-weight: 700;
}

.notice-list {
  display: grid;
  gap: 8px;
}

.notice-item {
  border: 1px solid #dae4f2;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
}

.notice-item.unread {
  border-color: #f4d27c;
  background: #fffcf1;
}

.notice-title {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.notice-content {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.48;
}

.notice-time {
  margin-top: 5px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-card {
  border: 1px solid #d9e3f1;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.activity-card.cancelled {
  background: #f7f9fc;
  border-color: #d6deeb;
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.activity-title {
  margin: 0;
  font-size: 0.99rem;
}

.activity-sub {
  margin: 0;
  font-size: 0.84rem;
}

.table-wrap {
  border: 1px solid #d7e2ef;
  border-radius: var(--radius-md);
  background: #fff;
  overflow: auto;
}

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

table.matrix th,
table.matrix td {
  border-right: 1px solid #e1e8f2;
  border-bottom: 1px solid #e1e8f2;
  padding: 9px;
  text-align: center;
  font-size: 0.84rem;
  background: #fff;
}

table.matrix tr td:last-child,
table.matrix tr th:last-child {
  border-right: none;
}

table.matrix tr:last-child td {
  border-bottom: none;
}

table.matrix thead th {
  background: #f4f8ff;
  position: sticky;
  top: 0;
  z-index: 3;
}

table.matrix tbody tr:nth-child(2n) td {
  background: #fbfdff;
}

table.matrix th:first-child,
table.matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #f4f8ff;
}

table.matrix tbody tr:nth-child(2n) td:first-child {
  background: #f0f6ff;
}

.empty {
  border: 1px dashed #c7d5ea;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text-muted);
  text-align: center;
  padding: 20px 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(10px);
  background: #0f172a;
  color: #fff;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 0.88rem;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: var(--shadow-md);
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #be123c;
}

.mobile-dock {
  display: none;
}

.dock-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #3e4f68;
  padding: 9px 12px;
  font-weight: 650;
  cursor: pointer;
}

.dock-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #1f78d3 0%, #145daa 100%);
  border-color: #1b68be;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid #86b7ee;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-1px);
  }

  .btn-soft:hover {
    background: #edf2fa;
  }

  .btn-ghost:hover {
    background: #deebff;
  }

  .session-card:hover {
    border-color: #bfd3ef;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
  }
}

@media (max-width: 780px) {
  .layout {
    margin-bottom: 68px;
  }

  .top-actions .btn,
  .inline-actions .btn {
    width: 100%;
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-item:last-child {
    grid-column: 1 / -1;
  }

  .inline-actions select {
    min-width: 100%;
    width: 100%;
  }

  .session-action .btn {
    width: 100%;
  }

  .panel {
    padding: 14px;
  }

  .mobile-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
    border: 1px solid rgba(201, 214, 232, 0.95);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(6px);
  }
}

@media (min-width: 860px) {
  .app-shell {
    padding: 24px 18px 30px;
  }

  .top-main {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

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

  .session-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
