/* ============================================================
   乐动天下 · 智慧体育健康运营平台  UI 设计规范
   主色 #0057FE | 中性色体系 | 字号体系 36/20/18/16/14
   ============================================================ */
:root {
  /* 主色 */
  --brand:        #0057FE;
  --brand-hover:  #0043C8;
  --brand-light:  #3D7BFF;
  --brand-50:     #F2F6FF;
  --brand-100:    #E6EEFF;
  --brand-200:    #B9D0FF;

  /* 辅助色 */
  --aux-green:    #12D240;
  --aux-pink:     #F5B6BC;
  --aux-orange:   #FFB15B;
  --aux-purple:   #A867EB;
  --aux-teal:     #1AAD19;
  --tech:         #0057FE;

  /* 中性色 */
  --ink:          #0F0F0F;
  --ink-2:        #5E6678;
  --ink-3:        #666666;
  --ink-4:        #999999;
  --line:         #DEE3EA;
  --line-2:       #EEF1F4;
  --fill:         #F9FAFE;
  --muted:        #5E6678;
  --bg:           #F9FAFE;

  /* 语义色 */
  --success:      #12D240;
  --success-bg:   #E8FBEE;
  --warning:      #FFB15B;
  --warning-bg:   #FFF5E9;
  --danger:       #F5564E;
  --danger-bg:    #FFECEB;
  --info-bg:      #E6EEFF;

  /* 阴影 / 圆角 */
  --shadow-sm:    0 1px 2px rgba(15,15,15,.04);
  --shadow:       0 2px 8px rgba(15,15,15,.06);
  --shadow-md:    0 6px 20px rgba(15,15,15,.08);
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4 { font-weight: 600; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8D8D8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #C6C6C6; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 移动端外壳 ============================ */
/* 无手机边框：页面本身即手机屏幕，铺满视口 */
body:has(.phone-shell) { background: #ffffff; }
.phone-shell {
  width: 100%; margin: 0; min-height: 100vh;
  background: #ffffff; position: relative;
}
.phone-body { padding: 0 0 84px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px; background: #fff;
  border-top: 1px solid var(--line-2); display: flex; z-index: 50;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-4);
}
.tabbar a.active { color: var(--brand); }

/* ============================ 桌面端外壳 ============================ */
.desktop-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px; background: #FFFFFF; color: var(--ink-2);
  padding: 20px 12px; flex-shrink: 0;
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column;
}
.sidebar .logo {
  color: var(--ink); font-weight: 700; font-size: 15px;
  margin: 2px 8px 20px; letter-spacing: .5px;
  display: flex; align-items: center; gap: 9px;
}
.sidebar .logo::before {
  content: ""; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  box-shadow: 0 3px 8px rgba(0,87,254,.28);
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 2px;
  color: var(--ink-2); transition: background .15s, color .15s;
}
.sidebar a:hover { background: var(--fill); color: var(--brand); }
.sidebar a.active {
  background: var(--brand); color: #fff; font-weight: 500;
  box-shadow: 0 3px 10px rgba(0,87,254,.24);
}
.sidebar .group-title {
  font-size: 11px; color: var(--ink-4); padding: 14px 12px 6px; letter-spacing: .6px;
}

.main { flex: 1; padding: 20px 24px 32px; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; gap: 16px;
}
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -.2px; }
.breadcrumb { font-size: 12px; color: var(--ink-4); margin-bottom: 4px; }

/* ============================ 卡片 ============================ */
.card {
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px; font-weight: 600; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px; color: var(--ink);
}
.card-title .dot {
  width: 3px; height: 14px; background: var(--brand);
  border-radius: 2px; display: inline-block;
}

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); font-size: 13.5px; padding: 9px 18px;
  border: 1px solid transparent; cursor: pointer; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit; line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: var(--fill); color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--brand); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #FFDAD7; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================ 标签 ============================ */
.tag {
  display: inline-block; font-size: 11.5px; padding: 2px 9px;
  border-radius: 4px; background: var(--brand-100); color: var(--brand);
  margin-right: 6px; line-height: 1.7; white-space: nowrap;
}
.tag-gray  { background: var(--fill);      color: var(--ink-2); }
.tag-blue  { background: var(--brand-100); color: var(--brand); }
.tag-amber { background: var(--warning-bg);color: #C97A16; }
.tag-red   { background: var(--danger-bg); color: var(--danger); }
.tag-green { background: var(--success-bg);color: #0E9E33; }

/* ============================ 数据 ============================ */
.stat { font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

.progress { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
}

.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--brand-100);
  color: var(--brand); display: inline-flex; align-items: center;
  justify-content: center; font-weight: 600; font-size: 15px; flex-shrink: 0;
}

/* ============================ 列表 ============================ */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.list-row:last-child { border-bottom: none; }

.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ============================ 表格 ============================ */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; color: var(--ink-2); font-weight: 500; padding: 11px 12px;
  background: var(--fill); border-bottom: 1px solid var(--line-2); white-space: nowrap;
  font-size: 12.5px;
}
table.tbl th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
table.tbl th:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
table.tbl tbody tr:hover td, table.tbl tr:hover td { background: var(--brand-50); }

/* ============================ 门户 ============================ */
.demo-note {
  position: fixed; bottom: 12px; right: 16px; background: rgba(15,15,15,.82);
  color: #EEF1F4; font-size: 11px; padding: 6px 12px; border-radius: 999px; z-index: 99;
}

/* ============================ 对话气泡 ============================ */
.bubble {
  max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14px;
  line-height: 1.65; margin-bottom: 10px; white-space: pre-wrap;
}
.bubble.user {
  background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px;
}
.bubble.ai { background: var(--fill); border-bottom-left-radius: 4px; color: var(--ink); }

.plan-card {
  border: 1px solid var(--brand-200); background: var(--brand-50);
  border-radius: var(--radius); padding: 14px; margin: 6px 0 12px; font-size: 13px;
}

/* ============================ 图标 ============================ */
.icon {
  width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.icon-lg { width: 26px; height: 26px; }

/* ============================ 表单控件 ============================ */
.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 12px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,87,254,.1); }
.field-label { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }

.switch {
  position: relative; display: inline-block; width: 38px; height: 21px;
}
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; background: #D8D8D8; border-radius: 999px;
  transition: background .2s; cursor: pointer;
}
.switch i::after {
  content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(15,15,15,.2);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(17px); }

/* ============================ 提示条 ============================ */
.alert-bar {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.7;
}
.alert-bar.info    { background: var(--info-bg);    color: #0043C8; }
.alert-bar.success { background: var(--success-bg); color: #0E9E33; }
.alert-bar.warning { background: var(--warning-bg); color: #C97A16; }
.alert-bar.danger  { background: var(--danger-bg);  color: var(--danger); }

/* ============================ 时间线 ============================ */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 1px; background: var(--line-2);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -19px; top: 4px; width: 9px; height: 9px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand-200);
}
.timeline-item.done::before { border-color: var(--brand); background: var(--brand); }

/* ============================ 空状态 ============================ */
.empty { text-align: center; padding: 40px 16px; color: var(--ink-4); font-size: 13px; }
