:root {
  --bg: #f2f4fb;
  --card: #ffffff;
  --line: #e5e7ef;
  --text: #21253d;
  --muted: #6b7280;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #059669;
  --purple: #7c3aed;
}

:root[data-theme="dark"] {
  --bg: #0b1224;
  --card: #111b31;
  --line: #253656;
  --text: #e5e7eb;
  --muted: #9ba6bb;
  --brand: #4f8cff;
  --brand-hover: #3f7cf5;
  --danger: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px 24px 40px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 5% 0%, #dde4ff 0%, transparent 38%),
    radial-gradient(circle at 95% 8%, #efe7ff 0%, transparent 35%),
    var(--bg);
  color: var(--text);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% 0%, #172d5b 0%, transparent 45%),
    radial-gradient(circle at 90% 5%, #351f67 0%, transparent 40%),
    var(--bg);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 10px;
}

.layout {
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

/* 管理页专属样式，避免影响用户端页面 */
.admin-page .layout {
  max-width: 1320px;
}

.admin-page .metrics {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-page .metric {
  border: 1px solid #dbe3ff;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.admin-page .metric .label {
  color: #64748b;
  font-size: 13px;
}

.admin-page .metric .value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
}

.admin-page table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.admin-page th,
.admin-page td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.admin-page th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-page tbody tr:hover {
  background: #f8fbff;
}

.admin-page tbody tr:last-child td {
  border-bottom: none;
}

.admin-page td.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-page td.actions button {
  white-space: nowrap;
}

.top-nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  backdrop-filter: blur(8px);
}

.nav-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, #2a57e6, #a21cef);
  box-shadow: 0 10px 22px rgba(90, 72, 235, 0.35);
}

.brand-cn {
  display: block;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #2862ef, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.nav-actions {
  align-items: center;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
}

.nav-auth-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.auth-inner-card {
  box-shadow: none;
  background: rgba(37, 99, 235, 0.03);
}

.landing-intro {
  display: grid;
  gap: 14px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid #dbe3ff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.95));
  color: #fff;
}

.hero-content h1 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.22;
}

.hero-badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #e8ecff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.hero-desc {
  margin: 0 0 16px;
  max-width: 56ch;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.18);
}

.hero-panel ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
}

.member-section {
  display: grid;
  gap: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.stat-dot {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-block;
}

.stat-dot.blue {
  background: rgba(37, 99, 235, 0.1);
}

.stat-dot.purple {
  background: rgba(124, 58, 237, 0.1);
}

.stat-dot.pink {
  background: rgba(236, 72, 153, 0.1);
}

.stat-dot.yellow {
  background: rgba(234, 179, 8, 0.1);
}

.stat-value {
  margin-top: 8px;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
}

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

.quick-btn {
  border: none;
  border-radius: 16px;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  padding: 24px 18px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(88, 80, 236, 0.28);
}

.quick-blue {
  background: linear-gradient(90deg, #2563eb, #a21cef);
}

.quick-pink {
  background: linear-gradient(90deg, #9333ea, #db0073);
}

.member-panels {
  display: grid;
  gap: 12px;
}

.editor-panel {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.68), #fff);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reminder-shell {
  padding: 18px;
}

.shell-head {
  justify-content: space-between;
  align-items: center;
}

.view-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
}

.view-switch button {
  background: transparent;
  color: #475569;
  border-radius: 10px;
  padding: 8px 12px;
}

.view-switch button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.list-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.type-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.type-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #334155;
}

.type-chip.active {
  border-color: #60a5fa;
  color: #1d4ed8;
  background: #eff6ff;
}

.calendar-view {
  border: 1px solid #dbe3ff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #f8fbff;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 6px;
}

.calendar-week span {
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.day-cell {
  border: 1px solid #dbe2ef;
  background: #fff;
  border-radius: 10px;
  min-height: 64px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
}

.day-cell.empty {
  border: none;
  background: transparent;
  cursor: default;
}

.day-cell.today {
  border-color: #60a5fa;
}

.day-cell.selected {
  box-shadow: inset 0 0 0 2px #2563eb;
}

.day-num {
  font-weight: 700;
}

.day-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}

.day-share-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
}

.calendar-day-list {
  margin-top: 10px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
}

.calendar-day-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.calendar-add-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.calendar-add-btn:hover {
  background: #dbeafe;
}

.calendar-reminder {
  margin: 4px 0;
  align-items: center;
}

.share-mini-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

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

.empty-block {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
}

.reminder-item {
  display: grid;
  grid-template-columns: 5px 1fr;
  border: 1px solid #e7d5f1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.reminder-item .accent {
  background: #9ca3af;
}

.reminder-item.tone-birthday {
  background: #fdf2f8;
  border-color: #f3c4df;
}

.reminder-item.tone-birthday .accent {
  background: #ec4899;
}

.reminder-item.tone-anniversary {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.reminder-item.tone-anniversary .accent {
  background: #6366f1;
}

.reminder-item.tone-meeting {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.reminder-item.tone-meeting .accent {
  background: #3b82f6;
}

.reminder-item.tone-custom {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.reminder-item.tone-custom .accent {
  background: #64748b;
}

.reminder-main {
  padding: 14px;
}

.reminder-head {
  justify-content: space-between;
  align-items: flex-start;
}

.title-row {
  align-items: center;
}

.share-badge {
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.meta-chip {
  font-size: 12px;
  border: 1px solid #dbe2ef;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: #475569;
}

.shared-chip {
  border-color: #e9d5ff;
  background: #faf5ff;
  color: #6d28d9;
}

.tiny-row {
  align-items: center;
}

.desc {
  margin: 8px 0 0;
  color: #475569;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

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

.feedback {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 12px;
  padding: 10px 12px;
}

.feedback.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.feedback.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 16px;
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.28);
}

.modal-form {
  display: grid;
  gap: 10px;
}

.floating-nav {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.floating-nav button {
  width: 110px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}

.floating-nav button.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
}

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

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--brand-hover);
}

button.secondary {
  background: #334155;
}

button.secondary:hover {
  background: #1f2937;
}

button.ghost {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--line);
}

button.ghost:hover {
  background: #edf2f7;
}

button.warning {
  background: #ea580c;
}

button.warning:hover {
  background: #c2410c;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #b91c1c;
}

button.success {
  background: var(--success);
}

button.success:hover {
  background: #047857;
}

.mini {
  padding: 6px 10px;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary {
  background: #fff;
  color: #1d4ed8;
}

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

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

.chip {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: #eef2ff;
  background: rgba(255, 255, 255, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

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

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

.status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-block;
}

.status-approved {
  background: #d1fae5;
  color: #065f46;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-rejected,
.status-blocked {
  background: #fee2e2;
  color: #991b1b;
}

.status-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-completed {
  background: #e0e7ff;
  color: #4338ca;
}

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

:root[data-theme="dark"] .brand-cn {
  background: linear-gradient(135deg, #6ea6ff, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
}

:root[data-theme="dark"] .brand-sub,
:root[data-theme="dark"] .hint {
  color: #a6b4cb;
}

:root[data-theme="dark"] .user-pill,
:root[data-theme="dark"] .meta-chip,
:root[data-theme="dark"] .type-chip {
  background: #17253f;
  border-color: #31466b;
  color: #cbd5e1;
}

:root[data-theme="dark"] .shared-chip,
:root[data-theme="dark"] .share-badge,
:root[data-theme="dark"] .share-mini-badge,
:root[data-theme="dark"] .day-share-tag {
  background: #2a2145;
  border-color: #4b3a73;
  color: #d8b4fe;
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .editor-panel,
:root[data-theme="dark"] .calendar-view {
  background: #111b31;
  border-color: #253656;
}

:root[data-theme="dark"] .reminder-item {
  border-color: #2f3f5f;
}

:root[data-theme="dark"] .reminder-item.tone-birthday {
  background: #2c1b33;
}

:root[data-theme="dark"] .reminder-item.tone-anniversary {
  background: #1a2342;
}

:root[data-theme="dark"] .reminder-item.tone-meeting {
  background: #15263e;
}

:root[data-theme="dark"] .reminder-item.tone-custom {
  background: #1b263a;
}

:root[data-theme="dark"] .view-switch {
  background: #1c2a45;
}

:root[data-theme="dark"] .view-switch button {
  color: #cbd5e1;
}

:root[data-theme="dark"] .view-switch button.active {
  background: #0f172a;
  color: #93c5fd;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #0f1a32;
  border-color: #30405f;
  color: #e2e8f0;
}

:root[data-theme="dark"] .day-cell {
  background: #0f1a32;
  border-color: #31466b;
}

:root[data-theme="dark"] .feedback {
  background: #10203f;
  border-color: #2e4a82;
  color: #93c5fd;
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(2, 6, 23, 0.68);
}

:root[data-theme="dark"] .calendar-add-btn {
  background: #17253f;
  color: #93c5fd;
  border-color: #31466b;
}

:root[data-theme="dark"] .admin-page .metric {
  background: #0f1a32;
  border-color: #31466b;
}

:root[data-theme="dark"] .admin-page .metric .value {
  color: #e2e8f0;
}

:root[data-theme="dark"] .admin-page tbody tr:hover {
  background: #17253f;
}

:root[data-theme="dark"] .admin-page th,
:root[data-theme="dark"] .admin-page td {
  border-bottom-color: #2f456e;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 1080px) {
  .hero,
  .stats-grid,
  .quick-grid,
  .grid-2,
  .pagination,
  .calendar-week,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .brand-cn {
    font-size: 30px;
  }

  .list-toolbar,
  .shell-head,
  .calendar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .floating-nav {
    right: 10px;
    bottom: 10px;
  }

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

  .admin-page table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .admin-page th,
  .admin-page td {
    min-width: 110px;
  }
}

@media (max-width: 640px) {
  .admin-page .metrics {
    grid-template-columns: 1fr;
  }
}
