/* 健身记录 · 2.0 美化版 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f0f4f1;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --green: #16a34a;
  --green-dark: #14532d;
  --orange: #ea8c1e;
  --red: #dc2626;
  --line: #e8ede9;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(20, 83, 45, .08);
}
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
.page { max-width: 600px; margin: 0 auto; padding: 0 14px 56px; }

/* ---------- 顶栏 ---------- */
.app-header {
  margin: 0 -14px 6px; padding: 26px 20px 20px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff; border-radius: 0 0 24px 24px;
  box-shadow: var(--shadow);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.app-header h1 { font-size: 22px; letter-spacing: 1px; }
.app-header .sub { color: rgba(255,255,255,.75); font-size: 12px; margin-top: 4px; }
.ghost-btn {
  padding: 7px 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.12); color: #fff; font-size: 12px; cursor: pointer;
}

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 6px; margin: 14px 0; }
.main-tabs {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 10px 0;
}
.tab {
  flex: 1; padding: 10px 4px; border: none; border-radius: 12px;
  background: var(--card); font-size: 13.5px; color: var(--muted);
  cursor: pointer; box-shadow: var(--shadow); font-weight: 600;
  transition: all .15s;
}
.tab.active { background: var(--ink); color: #fff; }

/* 标签内容区切换 */
.view.hidden { display: none; }

/* ---------- 卡片 & 表单 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
input, textarea {
  width: 100%; padding: 13px; margin-bottom: 12px;
  border: 1.5px solid var(--line); border-radius: 12px; font-size: 15px;
  font-family: inherit; resize: vertical; background: #fafcfa;
  transition: border .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--green); background: #fff; }
button[type="submit"], .card > button {
  width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  letter-spacing: 2px;
}
button:disabled { opacity: .5; }
.msg { margin-top: 10px; font-size: 13px; color: var(--red); min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 0; line-height: 1.9; }

/* ---------- 登录页 ---------- */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(160deg, #0f3d22 0%, #16a34a 60%, #4ade80 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card { width: 100%; max-width: 380px; margin: 0; }
.auth-card h1 { text-align: center; font-size: 26px; }
.auth-card .sub { text-align: center; margin-bottom: 20px; }
.auth-badge {
  width: 64px; height: 64px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; box-shadow: var(--shadow);
}

/* ---------- 记录列表 ---------- */
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-item {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); border-left: 4px solid var(--green);
}
#view-diet .log-item { border-left-color: var(--orange); }
.log-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.who {
  font-size: 12px; font-weight: 700; background: #eef4ef;
  padding: 3px 10px; border-radius: 20px; color: var(--green-dark);
}
.when { font-size: 12px; color: var(--muted); margin-left: auto; }
.log-content { font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.del-btn {
  border: none; background: none; color: #cbd5d1; font-size: 12px;
  cursor: pointer; padding: 2px 4px;
}
.del-btn:active { color: var(--red); }

/* ---------- 总结卡片 ---------- */
.summary-card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 12px;
  border-top: 4px solid var(--green);
}
.summary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.summary-date { font-weight: 800; font-size: 16px; }
.summary-body { display: flex; gap: 16px; align-items: center; }
.score-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); }
.score-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-num b { font-size: 26px; color: var(--ink); }
.score-num span { font-size: 10px; color: var(--muted); }
.stat-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 17px; font-weight: 800; }
.stat .v small { font-size: 11px; font-weight: 400; color: var(--muted); }
.v.burn { color: var(--green); }
.v.eat { color: var(--orange); }
.stat.net { border-top: 1px dashed var(--line); padding-top: 10px; }
.andy-comment {
  margin-top: 14px; background: #f4faf5; border-radius: 12px; padding: 12px 14px;
  font-size: 14px; line-height: 1.8; color: #2d4a35;
}
.andy-comment .tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: var(--green-dark);
  background: #dcf0e1; border-radius: 6px; padding: 2px 8px; margin-bottom: 6px;
}

/* ---------- 方案卡片 ---------- */
.log-item.plan { border-left-color: var(--green); background: linear-gradient(180deg, #fdfffe, #f4faf5); }
