:root {
  color-scheme: light;
  /* 干净的浅灰背景 */
  --bg: #f4f5f7;
  --sidebar: #ffffff;
  --panel: #ffffff;
  /* 卡片内部元素的浅色底 */
  --panel-soft: #f8f9fa;
  --border: rgba(0, 0, 0, 0.06);
  --text: #1c1c1e;
  --muted: #8e8e93;

  /* 现代 iOS 风格高饱和度点缀色 */
  --purple: #af52de;
  --cyan: #5ac8fa;
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;

  /* 极其柔和的弥散阴影 */
  --shadow: 0 8px 24px rgba(149, 157, 165, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);

  /* 大圆角便当盒风格 */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* 苹果系标准无衬线字体栈 */
  font-family:
    -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* 核心：手机端双栏布局 */
.app-shell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ================= 侧边栏 ================= */
.sidebar {
  padding: 16px 6px;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

.brand-card {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  width: 100%;
}

.brand-card > div:not(.brand-mark) {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #007aff, #5ac8fa);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 12px 2px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  transition: all 0.2s ease;
}

.nav-item i {
  font-size: 22px;
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.nav-item:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.nav-item.is-active {
  color: var(--blue);
  background: rgba(0, 122, 255, 0.08);
}

/* ================= 右侧内容区 ================= */
.dashboard {
  padding: 16px 12px 24px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
  /* 更加丝滑的苹果风弹性过渡动画 */
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.page-head {
  margin-bottom: 24px;
  padding-left: 4px;
}

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

.page-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 18px;
  color: var(--blue);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* 两张功能卡在手机端纵向排列 */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.panel-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  width: 100%;
  overflow: hidden;
}

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

.eyebrow {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.card-action {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--blue);
  background: rgba(0, 122, 255, 0.08);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-action:hover {
  background: rgba(0, 122, 255, 0.15);
  transform: scale(1.05);
}

.simple-list,
.metric-stack {
  display: grid;
  gap: 12px;
}

.list-item,
.metric-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  width: 100%;
  overflow: hidden;
}

.list-item:hover,
.metric-item:hover {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.list-icon,
.metric-icon {
  display: none;
}

.list-main,
.metric-main {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.list-main strong,
.metric-main strong {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.item-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.tone-purple {
  color: #af52de;
  background: rgba(175, 82, 222, 0.1);
}
.tone-blue {
  color: #007aff;
  background: rgba(0, 122, 255, 0.1);
}
.tone-green {
  color: #34c759;
  background: rgba(52, 199, 89, 0.1);
}
.tone-orange {
  color: #ff9500;
  background: rgba(255, 149, 0, 0.1);
}
.tone-red {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
}
.tone-gray {
  color: #8e8e93;
  background: rgba(142, 142, 147, 0.1);
}

.list-main p,
.metric-main p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.item-meta span {
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 6px;
  background: #ebebeb;
  font-weight: 500;
  white-space: nowrap;
}

.item-progress {
  margin-top: 10px;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
}

.item-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.list-side,
.metric-side {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  align-self: flex-start;
  margin-top: 0;
}

.list-side.is-positive,
.metric-side.is-positive {
  color: var(--green);
}

.list-side.is-negative,
.metric-side.is-negative {
  color: var(--red);
}
