/* 鈹€鈹€鈹€ Tokens & Reset 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color tokens are defined in theme-foundation.css. */
  --text-primary: #edf2f7;
  --text-secondary: #98a6b5;
  --green-dim: #1e6d55;

  --font-serif: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", serif;
  --font-sans:  "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", Arial, sans-serif;
  --font-mono:  Consolas, "SFMono-Regular", "Roboto Mono", "Courier New", monospace;

  color-scheme: dark;

  --z-base: 1;
  --z-header: 5;
  --z-tooltip: 8;
  --z-sidebar: 30;
  --z-slide-indicator: 32;
  --z-drawer-backdrop: 90;
  --z-drawer: 91;
  --z-modal: 100;
  --z-mobile-nav: 1200;
}

html, body { height: 100%; background: radial-gradient(circle at top, rgba(246, 183, 60, 0.08), transparent 28%), var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 14px; line-height: 1.6; }
body { overscroll-behavior-y: contain; }


/* 鈹€鈹€鈹€ Global Feedback 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
.pull-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: var(--z-mobile-nav);
  min-width: 120px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(21, 22, 24, 0.96);
  color: var(--text-dim);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -64px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pull-refresh-indicator.visible {
  opacity: 1;
}

.pull-refresh-indicator.ready {
  border-color: var(--amber-dim);
  color: var(--amber);
}

.pull-refresh-text {
  font-size: 12px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* 鈹€鈹€鈹€ Browser Chrome 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }
/* 鈹€鈹€鈹€ Shell Layout 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
#main-app {
  display: flex;
  min-height: 100vh;
}

.mobile-menu-button {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: var(--z-mobile-nav);
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(21, 22, 24, 0.94);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.18s ease;
}

.mobile-menu-button:hover {
  transform: translateY(-1px);
  border-color: rgba(246, 183, 60, 0.24);
  background: rgba(32, 40, 51, 0.96);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.mobile-menu-button:hover span {
  background: var(--amber);
}

.mobile-menu-button:active {
  transform: scale(0.97);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: var(--z-mobile-nav);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--z-mobile-nav);
  width: min(82vw, 320px);
  height: 100vh;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: none;
  flex-direction: column;
  padding: 24px 0;
  overflow-y: auto;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

/* 鈹€鈹€鈹€ Navigation 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(246, 183, 60, 0.08), transparent 160px),
    var(--bg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.22);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.sidebar-brand {
  margin: 0 16px 18px;
  padding: 18px 16px;
  border: 1px solid rgba(246, 183, 60, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-brand h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.sidebar-brand span {
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.8px;
  font-family: var(--font-mono);
}

.app-version-label {
  display: block;
  margin-top: 4px;
  color: var(--text-mute);
  font-size: 10px;
  font-family: var(--font-mono);
  line-height: 1;
}

.sidebar-nav { flex: 1; padding: 0 12px; }

.nav-section-label {
  font-size: 10px;
  letter-spacing: 1.1px;
  color: var(--text-mute);
  text-transform: uppercase;
  padding: 0 10px;
  margin: 18px 0 8px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  width: 100%;
  text-align: left;
}

.nav-item-sub {
  width: calc(100% - 12px);
  margin-left: 12px;
  padding-left: 14px;
  border-radius: 10px;
  font-size: 12px;
}

.nav-item-sub::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(246, 183, 60, 0.24);
  transform: translateY(-50%);
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.nav-item:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
}

.nav-item:hover::before {
  background: rgba(246, 183, 60, 0.45);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(246, 183, 60, 0.2), rgba(246, 183, 60, 0.06));
  color: var(--amber);
  border-color: rgba(246, 183, 60, 0.28);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: navPulse 2.8s ease-in-out infinite;
}

.nav-item.active::before {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(246, 183, 60, 0.36);
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item:focus-visible {
  outline: none;
  border-color: rgba(246, 183, 60, 0.32);
  box-shadow: 0 0 0 3px rgba(246, 183, 60, 0.12);
}

.nav-item .nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: rgba(246, 183, 60, 0.14);
  color: inherit;
  transform: scale(1.05);
}

@keyframes navPulse {
  0%, 100% { box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16), 0 0 0 0 rgba(246, 183, 60, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
  50% { box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(246, 183, 60, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sidebar-footer {
  padding: 18px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--amber-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
}

.user-info p { font-size: 13px; font-weight: 500; }
.user-info span { font-size: 11px; color: var(--text-dim); }

/* ─── Sidebar Toggle ────────────────────── */
.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 50%;
  z-index: 2;
  width: 24px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.sidebar-toggle:hover {
  border-color: rgba(246, 183, 60, 0.35);
  color: var(--amber);
  background: var(--bg-hover);
}

.sidebar-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.22s ease;
}

/* ─── Collapsed Sidebar ─────────────────── */
.sidebar {
  transition: width 0.22s ease;
}

.sidebar.is-collapsed {
  width: 56px;
}

.sidebar.is-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar.is-collapsed .sidebar-brand {
  margin: 0 8px 12px;
  padding: 8px;
  text-align: center;
}

.sidebar.is-collapsed .brand-copy {
  display: none;
}

.sidebar.is-collapsed .nav-section-label {
  display: none;
}

.sidebar.is-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  font-size: 0;
  border-radius: 12px;
}

.sidebar.is-collapsed .nav-item-sub {
  display: none;
}

.sidebar.is-collapsed .sidebar-footer {
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar.is-collapsed .user-info {
  display: none;
}

.sidebar.is-collapsed .user-badge {
  justify-content: center;
  margin-bottom: 0;
}

.sidebar.is-collapsed .user-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* ─── Main Content Margin ───────────────── */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 32px;
  transition: margin-left 0.22s ease;
}

.main-content.sidebar-collapsed {
  margin-left: 56px;
}

/* 鈹€鈹€鈹€ Header & Filters 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: 42px 32px 48px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% 0%, rgba(106, 168, 255, 0.06), transparent 22%),
    radial-gradient(circle at 20% 0%, rgba(246, 183, 60, 0.05), transparent 24%);
}

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
}

.page-title h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 700;
  color: var(--text);
}

.mobile-back-button {
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
}

.mobile-back-button,
.export-button,
.rule-link-button {
  min-height: 32px;
  border-radius: 999px;
}

.mobile-back-button,
.export-button,
.rule-link-button,
.ui-pill,
.autoscroll-status {
  white-space: nowrap;
}

.mobile-back-button span {
  color: var(--amber);
  font-weight: 700;
  transition: transform 0.16s ease;
}

.mobile-back-button:hover span {
  transform: translateX(-2px);
}

.page-title p {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.page-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.export-button {
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.export-button:hover {
  background: linear-gradient(180deg, rgba(246, 183, 60, 0.26), rgba(246, 183, 60, 0.1));
  border-color: var(--amber);
}

.autoscroll-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.08);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.autoscroll-status.active {
  border-color: var(--amber-dim);
  background: rgba(245, 166, 35, 0.18);
  color: var(--amber);
}

.autoscroll-toggle {
  cursor: pointer;
  font-family: var(--font-sans);
}

.autoscroll-toggle:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
}

.member-picker select {
  font-family: var(--font-sans);
  font-size: 13px;
  min-width: 180px;
}

.month-picker input[type="month"] {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* 鈹€鈹€鈹€ Shared Layout Utilities 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

