/* ========== 共享 Header/Account/Modal CSS ========== */
/* 从 index/styles.css 提取，供 index + calendar 等页面复用 */

/* --- Toast --- */
.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 9999;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 36px 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  max-width: calc(100vw - 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-close {
  position: absolute;
  top: 0; right: 0;
  width: 32px; height: 100%;
  background: none; border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-close:hover { color: #fff; }
.toast.toast-success { background: rgba(22, 101, 52, 0.92); }
.toast.toast-warning { background: rgba(146, 64, 14, 0.92); }
.toast.toast-error   { background: rgba(185, 28, 28, 0.92); }
.toast.toast-action  { background: rgba(17, 24, 39, 0.95); }

/* --- Logo Row --- */
.logo-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.logo-row h1 { margin: 0; font-size: 20px; font-weight: 600; color: #111; }
.logo-row-left {
  display: flex;
  align-items: flex-start;
}
.logo-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.home-link { color: inherit; text-decoration: none; }
.brand-link { display: inline-flex; align-items: center; }
.brand-logo-img { height: 62px; width: auto; display: block; }
.home-link:hover { text-decoration: none; opacity: 0.88; }

/* --- Map Slogan（logo 右侧，底部与 ONE 齐平） --- */
.map-slogan-group {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: 12px;
  margin-top: 28px;
}
.map-slogan {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  color: #94a3b8;
  user-select: none;
  line-height: 1;
}
.map-slogan-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  flex: 0 0 auto;
}
.map-slogan-icon:hover { transform: scale(1.08); opacity: 0.85; }
.map-slogan-icon img {
  display: block;
  object-fit: contain;
  height: 30px;
  margin-bottom: -4px;
}

/* --- Account Area（logo 行右侧，无边框浮动式） --- */
.account-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 12px;
  transition: background 0.15s;
}
.account-area:hover { background: rgba(0,0,0,0.04); }
.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--avatar-bg, linear-gradient(135deg, #6366f1, #4f46e5));
  flex: 0 0 auto;
  text-transform: uppercase;
}
.account-area-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Account Plan Chip --- */
.account-plan-chip {
  padding: 2px 8px;
  border-radius: 4px;
  border: none;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.account-plan-chip.free {
  background: #f1f5f9;
  color: #64748b;
}
.account-plan-chip.pro {
  background: linear-gradient(135deg, #d4af37, #f5d060);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* --- Account Menu / Backdrop --- */
.account-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2600;
}
.account-backdrop.show { display: block; }
.account-menu {
  position: fixed;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 24px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
  padding: 12px;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.account-row-top { align-items: flex-start; }
.account-email {
  min-width: 0;
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-muted {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}
.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  text-decoration: none;
}
.account-link:hover { background: #f3f4f6; text-decoration: none; }
.account-divider {
  height: 1px;
  background: #eef2f7;
  margin: 10px 0;
}
.account-label {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}

/* --- Locale / Currency Toggle --- */
.toggle-group {
  display: inline-flex;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 40px;
}
.toggle-btn {
  padding: 0 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: #6b7280;
}
.toggle-btn:not(:last-child) { border-right: 1px solid #e5e7eb; }
.toggle-btn.active { background: #111827; color: #fff; }
.toggle-btn:disabled { opacity: 0.35; cursor: default; }

/* 语言切换 3×2 网格 */
.toggle-group-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: auto;
}
.toggle-group-wrap .toggle-btn {
  height: 36px;
  border-right: none;
}
.toggle-group-wrap .toggle-btn:not(:nth-child(3n)) { border-right: 1px solid #e5e7eb; }
.toggle-group-wrap .toggle-btn:nth-child(-n+3) { border-bottom: 1px solid #e5e7eb; }

.account-settings-link {
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: #94a3b8;
  padding: 2px 0;
}
.account-settings-link:hover { color: #64748b; }
.account-settings-view {
  position: fixed;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 24px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
  padding: 12px;
}
.account-settings-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 4px 0;
}
.account-settings-back:hover { color: #334155; }
.account-settings-field {
  padding: 8px 0;
}
.account-settings-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.account-settings-value {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
}
.account-redeem-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-redeem-input {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  color: #0f172a;
  background: rgba(255,255,255,0.95);
}
.account-redeem-input:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.16);
}
.account-redeem-btn {
  flex: 0 0 auto;
}
.account-redeem-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.account-delete-btn {
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: #ef4444;
  padding: 6px 0 2px;
}
.account-delete-btn:hover { color: #dc2626; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 18px;
}
.modal-backdrop.show { display: flex; }
.modal {
  width: 520px;
  max-width: 96vw;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.28);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.modal-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: -4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-field label {
  display: flex;
  align-items: center;
  /* 2026-05-01 fix: min-height 对齐 .label-row（含 currency-seg buttons ~24px）,
     防 Metric label 比 Threshold label-row 矮导致下方 select / input 错位 ~7px */
  min-height: 24px;
  font-size: 12px;
  color: #64748b;
  font-weight: 650;
  margin-bottom: 6px;
}
.form-field input, .form-field select {
  width: 100%;
  height: 40px;
}
.form-field-span2 {
  grid-column: 1 / -1;
}
/* v2.1-P2.7 · label-row（label 左 + 轻量控件右，threshold currency 用） */
.form-field .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 6px;
}
.form-field .label-row label { margin-bottom: 0; }
/* v2.1-P2.7 · metric readonly 静态文本（edit 态替代 disabled select） */
.metric-readonly {
  height: 40px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  background: #f8fafc;
}
/* v2.1-P2.7 · cash threshold currency 切换（Local|USD 轻量 segmented） */
.seg-control {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1px;
}
.seg-control button {
  background: transparent;
  border: none;
  padding: 2px 8px;
  font-size: 10.5px;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.seg-control button.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.seg-control button:disabled { cursor: not-allowed; opacity: 0.5; }
/* v2.1-P2.7 · threshold input + prefix flex 布局（避开 absolute 重叠） */
.threshold-wrap {
  display: flex;
  align-items: stretch;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.threshold-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
/* 2026-05-01 · invalid threshold 边框标红 + 同 focus 强度的 ring */
.threshold-wrap.has-error {
  border-color: #dc2626;
}
.threshold-wrap.has-error:focus-within {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
/* 2026-05-01 · invalid threshold inline error message(threshold input 下方红字,
   替代屏幕顶部 toast——modal 中央用户视线不容易看到顶部 toast) */
.alert-threshold-error {
  margin-top: 4px;
  font-size: 12px;
  color: #dc2626;
  font-weight: 500;
}
/* 2026-05-01 · placeholder 颜色加深一点(默认浏览器灰色太淡用户容易误以为已填) */
.threshold-wrap input.flat::placeholder {
  color: #94a3b8;
  opacity: 1;
}
.threshold-wrap .prefix {
  display: flex;
  align-items: center;
  padding: 0 2px 0 10px;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  flex: 0 0 auto;
  user-select: none;
}
.threshold-wrap input.flat {
  flex: 1 1 auto;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 10px 0 6px !important;
  font-size: 13px;
  color: #0f172a;
  font-family: inherit;
  outline: none !important;
  box-shadow: none !important;
  min-width: 0;
}
.threshold-wrap input.flat:focus { outline: none; }
/* v2.1-P2.7 · Local mode 下双层提示文案 */
.threshold-hints {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.threshold-hints .hint-main {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
}
.threshold-hints .hint-sub {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}
.alert-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-items: center;
}
.alert-mode-row .alert-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.4;
  cursor: pointer;
}
.alert-mode-row .alert-mode-opt.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.alert-mode-row .alert-mode-opt span {
  white-space: nowrap;
}
.alert-mode-row input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #2563eb;
}
.alert-mode-hint {
  margin-top: 4px;
}
.alert-mode-row .pro-badge {
  font-size: 11px;
  background: #2563eb;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}
.btn-primary {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}
.btn-primary:hover { background: #0b1220; }
.btn-secondary {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font-weight: 650;
}
.btn-secondary:hover { background: #f3f4f6; }

/* --- Pro Modal（暗色 + 金色） --- */
.pro-feat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pro-feat-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}
.pro-modal {
  width: 500px;
  background: linear-gradient(160deg, #ffffff 0%, #fefdfb 40%, #fdfaf2 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 2px 16px rgba(212, 175, 55, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 28px 28px 24px;
}
.pro-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.pro-modal-icon { width: 32px; height: 32px; flex: 0 0 auto; }
.pro-modal .modal-title {
  font-size: 17px;
  font-weight: 750;
  color: #78550a;
  letter-spacing: -0.01em;
}
.pro-modal-badge {
  font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: linear-gradient(135deg, #d4af37, #f5d060);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.pro-modal .modal-subtitle {
  font-size: 13px;
  color: #8b7340;
  margin-bottom: 20px;
}
/* 2026-05-01 redesign: Primary feature hero card (feature-specific 触发时高亮) */
.pro-primary-feat {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.10), rgba(245, 208, 96, 0.06));
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.pro-primary-feat-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #d4af37, #f5d060);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
  margin-top: 1px;
}
.pro-primary-feat-body { flex: 1 1 auto; min-width: 0; }
.pro-primary-feat-title {
  font-size: 14px; font-weight: 700; color: #78550a;
  line-height: 1.3; margin-bottom: 3px;
}
.pro-primary-feat-new {
  font-size: 9px; font-weight: 800;
  padding: 1px 5px; border-radius: 3px;
  background: #16a34a; color: #fff;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-left: 6px; vertical-align: 2px;
}
.pro-primary-feat-desc {
  font-size: 12.5px; color: #6b5524;
  line-height: 1.5;
}
.pro-features-divider {
  font-size: 11px; color: #a09080;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0 0 10px;
}

/* Features list - 2026-05-01 改两行布局（title + desc）*/
.pro-modal .pro-feat-list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pro-modal .pro-feat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pro-feat-check { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }
.pro-feat-body { flex: 1 1 auto; min-width: 0; }
.pro-feat-title {
  font-size: 13px;
  font-weight: 650;
  color: #78550a;
  line-height: 1.3;
  margin-bottom: 1px;
}
.pro-feat-desc {
  font-size: 12px;
  color: #8a8276;
  line-height: 1.4;
}
/* 月付/年付 — Option B 并排卡片 */
.pro-plan-cards {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.pro-plan-card {
  flex: 1;
  border: 1px solid #e8e4dc;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pro-plan-card:hover { border-color: rgba(212, 175, 55, 0.35); }
.pro-plan-card.active {
  border-color: #d4af37;
  border-width: 2px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.15);
}
.pro-plan-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a09080;
}
.pro-plan-card.active .pro-plan-label { color: #78550a; }
.pro-plan-price {
  font-size: 13px;
  color: #a09080;
  line-height: 1;
}
.pro-plan-card.active .pro-plan-price { color: #0f172a; }
.pro-plan-current {
  font-size: 28px;
  font-weight: 800;
}
.pro-plan-unit {
  font-size: 12px;
  opacity: 0.7;
}
.pro-plan-original {
  font-size: 14px;
  color: #c0b8a8;
  text-decoration: line-through;
  font-weight: 500;
}
.pro-plan-sub {
  font-size: 11px;
  color: #a09080;
  min-height: 14px;
}
.pro-plan-card.active .pro-plan-sub { color: #8b7340; }
.pro-plan-save {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
  display: none;
}
.pro-plan-card .pro-plan-save:not(:empty) { display: block; }
.pro-compare-link {
  display: block;
  text-align: center;
  font-size: 11px;
  color: #a09080;
  text-decoration: none;
  margin-top: 4px;
  margin-bottom: 4px;
  transition: color 0.15s;
}
.pro-compare-link:hover { color: #78550a; }
.btn-pro-ghost {
  flex: 1; height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid #e0dbd0; background: rgba(255, 255, 255, 0.6);
  color: #8b7340; cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s;
}
.btn-pro-ghost:hover { color: #78550a; border-color: #ccc3b0; background: rgba(255, 255, 255, 0.8); }
.btn-pro-gold {
  flex: 1; height: 42px; padding: 0 20px;
  border-radius: 12px;
  border: 1px solid #d4af37;
  background: linear-gradient(135deg, #d4af37, #f0d060);
  color: #1e2026; cursor: pointer;
  font-size: 13px; font-weight: 750;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
  transition: all 0.15s;
}
.btn-pro-gold:hover { box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4); }

/* wallet_hook 模式：钱包引导，无功能列表 */
.pro-modal-hook .modal-title { font-size: 19px; }
.pro-modal-hook .modal-subtitle {
  font-size: 17px;
  color: #78550a;
  line-height: 1.5;
  margin-bottom: 16px;
}
.pro-hook-desc {
  font-size: 17px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 24px;
}

/* --- btn-danger --- */
.btn-danger {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.btn-danger:hover { background: #dc2626; }

/* 移动端响应式规则统一在 shared/responsive.css */
