:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #f1f5f3;
  --ink: #16211d;
  --muted: #62716b;
  --line: #dce4df;
  --green: #1f8a5b;
  --green-dark: #116140;
  --teal: #0b7c86;
  --red: #b8443f;
  --blue: #315f9a;
  --shadow: 0 18px 42px rgba(22, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #10241d;
  color: #f7fbf9;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #27b36d;
  color: white;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #adc5ba;
  font-size: 12px;
}

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

.nav-item,
.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item {
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #d9e6e0;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.11);
  color: white;
}

.nav-item.locked,
.nav-item:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.nav-item.locked:hover,
.nav-item:disabled:hover {
  background: transparent;
  color: #d9e6e0;
}

.nav-item svg,
.icon-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
}

.mini-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.panel-label,
.eyebrow,
label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-panel .panel-label {
  color: #adc5ba;
}

.metric-row {
  margin: 14px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-row strong {
  font-size: 34px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #27b36d;
}

.mini-panel small {
  display: block;
  margin-top: 8px;
  color: #c2d4cc;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar,
.section-head,
.filters,
.content-grid,
.draft-total,
.slot-card,
.draft-item {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.18;
}

h2 {
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.identity-label {
  color: #64748b;
}

.identity-name {
  font-weight: 600;
  color: var(--ink);
}

.identity-switcher[hidden] {
  display: none;
}

/* 移动端专属元素：桌面端默认隐藏 */
.hamburger-btn { display: none !important; }
.export-btn-mobile { display: none !important; }

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.primary-button {
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--green-dark);
}

.secondary-button,
.danger-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.secondary-button {
  color: var(--blue);
  background: #eef4fb;
}

.danger-button {
  color: var(--red);
  background: #fff0ef;
}

.secondary-button:disabled,
.danger-button:disabled,
.primary-button:disabled {
  color: var(--muted);
  background: var(--panel-soft);
  cursor: not-allowed;
}

.filters {
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  min-width: 160px;
  flex: 1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
}

.content-grid {
  align-items: flex-start;
  gap: 18px;
  margin-top: 18px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.calendar-panel,
.detail-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.calendar-panel {
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px;
}

.detail-panel {
  width: 390px;
  padding: 18px;
  position: sticky;
  top: 18px;
}

.list-panel {
  margin-top: 18px;
  padding: 18px;
}

.section-head {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.legend {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  min-width: 250px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.legend strong {
  color: var(--ink);
}

.dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.available {
  background: var(--green);
}

.dot.unavailable {
  background: var(--red);
}

.week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(84px, 1fr));
  gap: 8px;
}

.week-row {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.day-cell {
  min-height: 148px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.day-cell:hover,
.day-cell.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.12);
}

.day-cell.muted {
  opacity: 0.42;
  background: #f8faf9;
}

.day-num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
}

.status-pill,
.capacity-pill {
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.capacity-pill {
  color: var(--muted);
  background: #eef2f0;
}

.status-available {
  background: var(--green);
}

.status-unavailable {
  background: var(--red);
}

.day-meta {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9efec;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.slot-chip-list {
  display: grid;
  gap: 5px;
}

.slot-chip {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--ink);
}

.slot-chip b,
.slot-chip em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-chip b {
  font-size: 12px;
}

.slot-chip em {
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.slot-chip.available {
  border-color: rgba(31, 138, 91, 0.34);
  background: #eefaf3;
}

.slot-chip.available em {
  color: var(--green-dark);
}

.slot-chip.unavailable {
  border-color: rgba(184, 68, 63, 0.34);
  background: #fff0ef;
}

.slot-chip.unavailable b,
.slot-chip.unavailable em {
  color: var(--red);
}

.slot-list,
.draft-list,
.resource-list {
  display: grid;
  gap: 10px;
}

.slot-card,
.draft-item {
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.slot-card.unavailable {
  border-color: rgba(184, 68, 63, 0.28);
  background: #fffafa;
}

.slot-card.unavailable .slot-icon,
.slot-card.unavailable .slot-main {
  opacity: 0.62;
}

.slot-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
}

.slot-main {
  min-width: 0;
  flex: 1;
}

.slot-main strong,
.draft-item strong {
  display: block;
  font-size: 14px;
}

.slot-main span,
.draft-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.slot-price {
  margin-top: 10px;
  color: var(--green-dark);
  font-weight: 800;
}

.resource-actions {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.reserve-button,
.bid-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green-dark);
  background: #f2fbf6;
  font-weight: 800;
}

.bid-button {
  border-color: var(--blue);
  color: var(--blue);
  background: #f2f6fc;
}

.reserve-button:not(:disabled),
.bid-button:not(:disabled) {
  cursor: pointer;
}

.bid-button:not(:disabled):hover,
.bid-button:not(:disabled):focus-visible,
.slot-card.unavailable .bid-button:not(:disabled) {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(49, 95, 154, 0.18);
}

.bid-button:not(:disabled):focus-visible {
  outline: 3px solid rgba(49, 95, 154, 0.2);
  outline-offset: 2px;
}

.reserve-button:disabled,
.bid-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel-soft);
  cursor: not-allowed;
}

.draft {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.draft-item {
  align-items: center;
}

.bid-note,
.bid-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.bid-note {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.bid-note span,
.bid-item span {
  color: var(--muted);
  font-size: 12px;
}

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

.bid-actions {
  margin-top: 12px;
}

.approval-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.approval-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.approval-summary strong,
.approval-summary span {
  display: block;
}

.approval-summary strong {
  font-size: 24px;
}

.approval-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-list {
  display: grid;
  gap: 18px;
}

.approval-section {
  display: grid;
  gap: 10px;
}

.approval-list-inner {
  display: grid;
  gap: 12px;
}

.permission-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.permission-note strong {
  flex: 0 0 auto;
}

.permission-note span {
  color: var(--muted);
  font-size: 12px;
}

.approval-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-item.pending {
  border-left-color: var(--blue);
}

.approval-item.feasible {
  border-left-color: var(--green);
}

.approval-item.follow {
  border-left-color: var(--teal);
}

.approval-item.approved {
  border-left-color: var(--green);
}

.approval-item.rejected {
  border-left-color: var(--red);
}

.approval-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.approval-status.pending {
  color: var(--blue);
  background: #eef4fb;
}

.approval-status.feasible {
  color: var(--green-dark);
  background: #eefaf3;
}

.approval-status.follow {
  color: var(--teal);
  background: #edf8f8;
}

.approval-status.approved {
  color: var(--green-dark);
  background: #eefaf3;
}

.approval-status.rejected {
  color: var(--red);
  background: #fff0ef;
}

.approval-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.approval-detail-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.approval-detail-grid .wide {
  grid-column: 1 / -1;
}

.approval-detail-grid span,
.approval-hint {
  color: var(--muted);
  font-size: 12px;
}

.approval-detail-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.approval-hint {
  margin-top: 10px;
}

.audit-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.audit-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.audit-item strong,
.audit-item span,
.audit-item p {
  display: block;
}

.audit-item strong {
  font-size: 13px;
}

.audit-item span,
.audit-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.draft-main {
  flex: 1;
  min-width: 0;
}

.draft-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.draft-row-head button {
  margin-left: auto;
}

.draft-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.draft-fields label {
  min-width: 0;
}

.draft-fields .wide {
  grid-column: 1 / -1;
}

.schedule-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.form-title {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
}

.form-title strong {
  font-size: 15px;
}

.form-title span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-form label {
  min-width: 0;
}

.schedule-form .wide {
  grid-column: 1 / -1;
}

.schedule-submit {
  justify-self: start;
}

.draft-total {
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.draft-total span {
  color: var(--muted);
}

.draft-total strong {
  font-size: 22px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfc;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #16211d;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 3; flex-direction: row; align-items: center; padding: 10px 14px; gap: 12px; }
  .brand { flex-shrink: 0; }
  .brand strong { font-size: 14px; }
  .brand span { font-size: 10px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 6px; font-size: 14px; }
  .nav-list { display: flex; overflow-x: auto; gap: 4px; flex: 1; -webkit-overflow-scrolling: touch; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; min-height: 34px; padding: 0 10px; gap: 6px; font-size: 13px; }
  .nav-item svg { width: 16px; height: 16px; }
  .mini-panel { display: none; }
  .content-grid { flex-direction: column; }
  .detail-panel { position: static; width: 100%; }
  .workspace { padding: 16px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .top-actions { flex-wrap: wrap; }
  .schedule-form { grid-template-columns: 1fr 1fr; }
  .schedule-form .wide { grid-column: 1 / -1; }
}

/* ============== 手机端 (≤768px) ============== */
@media (max-width: 768px) {
  /* ---- 隐藏桌面侧边栏 ---- */
  .sidebar { display: none; }

  /* ---- 顶部汉堡菜单 ---- */
  .hamburger-btn { display: inline-flex !important; }

  /* ---- 移动端头部 ---- */
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
  }
  .topbar > div:first-of-type { flex: 1; min-width: 0; }

  h1 { font-size: 18px; line-height: 1.25; }
  .eyebrow { font-size: 11px; margin-bottom: 4px; }

  /* ---- 操作区换行 ---- */
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    order: 2;
  }
  .top-actions .primary-button,
  .top-actions .secondary-button { flex: 1; }
  .identity-switcher { font-size: 13px; width: 100%; justify-content: flex-start; }

  /* ---- 导出按钮独占一行 ---- */
  .export-btn-desktop { display: none !important; }
  .export-btn-mobile { display: flex !important; width: 100%; order: 3; }

  /* ---- 筛选区域纵向排列 ---- */
  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }
  .filters label { min-width: 0; flex: none; }

  /* ---- 工作区 ---- */
  .workspace { padding: 10px; }

  /* ---- 日历：2列卡片 ---- */
  .week-row { display: none; }
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    min-width: 0 !important;
  }
  .day-cell {
    min-height: auto;
    min-width: 160px;
    padding: 10px;
    border-radius: 10px;
  }
  .day-cell.muted { display: none; }
  .day-num { font-size: 15px; }
  .day-num .capacity-pill { font-size: 11px; padding: 2px 6px; }
  .day-meta { margin-top: 8px; gap: 4px; font-size: 13px; }
  .slot-chip b { font-size: 13px; }
  .slot-chip em { font-size: 11px; }

  .calendar-panel { padding: 10px; }
  .section-head { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }

  /* ---- 桌面详情面板隐藏（改用 bottom sheet） ---- */
  .detail-panel { display: none; }

  /* ---- 全局字号 ---- */
  body { font-size: 14px; }
  h2 { font-size: 16px; }
  input, select, textarea { font-size: 14px !important; min-height: 44px; }

  /* ---- 按钮 100% 宽 ---- */
  .resource-actions {
    flex: 1 0 100%;
    display: flex;
    gap: 8px;
  }
  .resource-actions button { flex: 1; width: 100%; }

  .approval-actions button {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    min-height: 40px;
  }

  .primary-button,
  .secondary-button,
  .danger-button { font-size: 14px; min-height: 40px; }
  .icon-button { width: 40px; height: 40px; }
  .icon-button svg { width: 18px; height: 18px; }

  /* ---- 列表面板 ---- */
  .list-panel { padding: 10px; }
  .slot-card { flex-wrap: wrap; }
  .draft-item { flex-wrap: wrap; }
  .draft-row-head { flex-wrap: wrap; gap: 6px; }
  .permission-note { flex-wrap: wrap; }

  /* ---- 排期表单全单列 ---- */
  .schedule-form,
  .draft-fields,
  .approval-fields { grid-template-columns: 1fr; }
  .approval-detail-grid { grid-template-columns: 1fr; gap: 6px; }
  .approval-summary { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .approval-summary strong { font-size: 18px; }
  .approval-summary span { font-size: 11px; }
  .approval-summary div { padding: 8px; }

  .approval-status { font-size: 12px; padding: 4px 8px; }

  /* ---- Modal 全宽 ---- */
  .modal-backdrop { padding: 12px; }
  .modal { max-width: 100%; border-radius: 12px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; gap: 10px; }
  .modal-tab { padding: 8px 16px; font-size: 14px; }

  /* ---- Toast ---- */
  .toast { right: 10px; bottom: 10px; left: 10px; max-width: none; font-size: 14px; }

  .legend { min-width: 0; font-size: 13px; }
  .legend span { min-height: 32px; }

  .section-head p { font-size: 13px; }
}

/* ============== 移动端组件 ============== */

/* 汉堡按钮（桌面隐藏） */
.hamburger-btn { display: none !important; }

/* 遮罩层 */
.mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 25, 0.5);
  z-index: 2000;
  transition: opacity 0.25s;
}
.mobile-overlay[hidden] { display: none; opacity: 0; }

/* 抽屉导航 */
.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; max-width: 85vw;
  background: #10241d;
  color: #f7fbf9;
  z-index: 2100;
  transform: translateX(0);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.mobile-drawer[hidden] { display: flex; transform: translateX(-100%); }

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-drawer-head strong { font-size: 16px; }
.mobile-drawer-head .icon-button { background: rgba(255,255,255,0.1); color: #f7fbf9; }

.mobile-nav-list {
  display: grid;
  gap: 4px;
  padding: 12px;
  flex: 1;
  overflow-y: auto;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #d9e6e0;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.mobile-nav-item.active,
.mobile-nav-item:active { background: rgba(255,255,255,0.11); color: #fff; }
.mobile-nav-item svg { width: 20px; height: 20px; }

/* 底部抽屉 (Bottom Sheet) */
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 85vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 2100;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(0);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.bottom-sheet[hidden] { display: flex; transform: translateY(100%); }

.bottom-sheet-handle {
  width: 36px; height: 4px;
  background: #d0d7d3;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.bottom-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--panel-soft);
  flex-shrink: 0;
}
.bottom-sheet-head h2 { font-size: 16px; margin: 0; }
.bottom-sheet-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.bottom-sheet-body {
  padding: 12px 16px 24px;
  flex: 1;
  overflow-y: auto;
}

/* ============== 登录 Modal ============== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 25, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--panel-soft);
}

.modal-tabs {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d0d7d3;
}

.modal-tab {
  padding: 8px 20px;
  font-size: 14px;
  font-family: inherit;
  border: none;
  background: #fff;
  cursor: pointer;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
}

.modal-tab + .modal-tab {
  border-left: 1px solid #d0d7d3;
}

.modal-tab.active {
  background: var(--accent, #2f8f6e);
  color: #fff;
}

.modal-head h2 {
  font-size: 18px;
  margin: 0;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.modal-body label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #475569;
}

.modal-body input {
  border: 1px solid #d0d7d3;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-body input:focus {
  border-color: var(--accent, #2f8f6e);
  box-shadow: 0 0 0 3px rgba(47, 143, 110, 0.15);
}

.modal-body .primary-button {
  margin-top: 4px;
  justify-content: center;
}

.modal-hint {
  font-size: 12px;
  color: #6b7780;
  margin: 4px 0 0;
}

.modal-hint code {
  background: var(--panel-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.modal-hint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #4b5563;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #d0d7d3;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.secondary-button:hover { background: var(--panel-soft); }

