/* ============ 设计系统 ============
   底色 #F4F6F4 · 主色 暖薄荷绿 #6FA98B · 文字 深炭灰 #363B37
   点缀 浅橙 #E5A663 · 无重阴影 · 细浅灰分割线 · 圆角卡片 */

:root {
  --bg: #F4F6F4;
  --card: #FFFFFF;
  --line: #E7EAE7;
  --divider: #ECEEEB;
  --mint: #6FA98B;
  --mint-dark: #5E978A;
  --mint-bg: #E9F2EC;
  --mint-text: #3E7A5F;
  --text: #363B37;
  --text-2: #8A918C;
  --orange: #E5A663;
  --orange-bg: #FBF1E4;
  --danger: #C97B72;
  --danger-bg: #F9EDEC;
  --radius: 12px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: var(--text); }

/* ============ 通用 ============ */

.btn {
  border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 14px;
  transition: background .15s;
}
.btn-primary { background: var(--mint); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--mint-dark); }
.btn-primary:disabled { background: #B9CCC1; cursor: default; }
.btn-ghost {
  background: var(--card); color: var(--text-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #F7F9F7; color: var(--text); }
.btn-danger-ghost {
  background: transparent; color: var(--danger);
  border: 1px solid #EAD4D1;
}
.btn-danger-ghost:hover { background: var(--danger-bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(54, 59, 55, .03);
}

.card + .card { margin-top: 12px; }

.card-title {
  font-size: 15px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .sub { font-size: 12px; font-weight: 400; color: var(--text-2); }

.divider { border: none; border-top: 1px solid var(--divider); margin: 12px 0; }

/* 表单 */
.field { margin-bottom: 14px; }
.field-label {
  font-size: 12.5px; color: var(--text-2); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.field-label .num {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--mint-bg); color: var(--mint-text);
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.input, select.input, textarea.input {
  width: 100%; height: 44px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; padding: 0 12px; font-size: 14px;
  outline: none; transition: border-color .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: none; }
.input:focus { border-color: var(--mint); }

/* 芯片（可点选） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; color: var(--text); transition: all .12s;
}
.chip:hover { border-color: var(--mint); }
.chip.on { background: var(--mint-bg); border-color: var(--mint); color: var(--mint-text); font-weight: 500; }

/* 三档分段选择 */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius-sm); padding: 9px 4px; font-size: 13px;
  color: var(--text); transition: all .12s;
}
.seg button.on { background: var(--mint-bg); border-color: var(--mint); color: var(--mint-text); font-weight: 500; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--text-2);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  background: #FAFBFA; white-space: nowrap;
}
.tbl th:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }

/* 标签 */
.tag {
  display: inline-block; border-radius: 6px;
  font-size: 11.5px; padding: 1px 8px;
}
.tag-mint { background: var(--mint-bg); color: var(--mint-text); }
.tag-orange { background: var(--orange-bg); color: #B07830; }
.tag-gray { background: #F0F2F0; color: var(--text-2); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }

/* ============ 登录 ============ */

.login-layer {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 320px; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 36px 28px 28px;
}
.login-icon { margin-bottom: 12px; }
.login-card h1 { font-size: 19px; font-weight: 600; }
.login-sub { font-size: 13px; color: var(--text-2); margin: 6px 0 20px; }
.login-card input {
  width: 100%; height: 44px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 12px; text-align: center; outline: none; background: #fff;
}
.login-card input:focus { border-color: var(--mint); }
.login-err { font-size: 12.5px; color: var(--danger); margin-top: 10px; min-height: 18px; }

/* ============ 顶栏 / 导航 ============ */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #f4f6f4;
  border-bottom: 1px solid var(--divider);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.child-select {
  height: 34px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; padding: 0 10px; font-size: 13px; color: var(--mint-text);
  outline: none;
}

.main {
  max-width: 1080px; margin: 0 auto;
  padding: 16px 16px calc(76px + env(safe-area-inset-bottom));
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; gap: 4px;
  background: #fff;
  border-top: 1px solid var(--divider);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  border: none; background: transparent; color: var(--text-2);
  font-size: 11.5px; padding: 5px 18px; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 72px; transition: all .12s;
}
.tab-ico { font-size: 17px; line-height: 1.2; font-weight: 500; }
.tab.on { color: var(--mint-text); background: var(--mint-bg); }

/* ============ 打卡页 ============ */

.editing-banner {
  background: var(--orange-bg); color: #B07830;
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 12.5px; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.editing-banner button {
  border: none; background: none; color: #B07830; font-size: 12.5px;
  text-decoration: underline;
}

.today-hint { font-size: 12.5px; color: var(--text-2); margin-top: 10px; }

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

/* ============ 本周页 ============ */

.week-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.week-nav .arrow {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  font-size: 16px; color: var(--text-2);
}
.week-nav .arrow:hover { border-color: var(--mint); color: var(--mint-text); }
.week-title { text-align: center; }
.week-title .wk-no { font-size: 15px; font-weight: 600; }
.week-title .wk-no em { font-style: normal; color: var(--orange); }
.week-title .wk-span { font-size: 12px; color: var(--text-2); }

.date-group-title {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin: 14px 0 8px; display: flex; justify-content: space-between; align-items: baseline;
}
.date-group-title .cnt { font-weight: 400; font-size: 12px; }

.rec-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid var(--divider);
}
.rec-card:last-child { border-bottom: none; }
.rec-main { flex: 1; min-width: 0; }
.rec-name { font-size: 14px; font-weight: 500; }
.rec-note { font-size: 12.5px; color: var(--text-2); margin-top: 2px; word-break: break-all; }
.rec-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.rec-ops { display: flex; flex-direction: column; gap: 6px; }
.rec-ops button {
  border: none; background: none; color: var(--text-2); font-size: 12px;
  padding: 2px 4px;
}
.rec-ops button:hover { color: var(--mint-text); }
.rec-ops .del:hover { color: var(--danger); }

.fix-row { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--divider); }
.fix-row:last-child { border-bottom: none; }
.fix-row .t { color: var(--text-2); width: 96px; flex-shrink: 0; }

/* ============ 总结页 ============ */

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; text-align: center;
}
.stat-box .v { font-size: 20px; font-weight: 600; color: var(--mint-text); }
.stat-box .v em { font-style: normal; color: var(--orange); }
.stat-box .k { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

.sug-item {
  padding: 8px 0; font-size: 13px; line-height: 1.7;
  border-bottom: 1px solid var(--divider); word-break: break-all;
}
.sug-item:last-child { border-bottom: none; }
.sug-item b { color: var(--mint-text); font-weight: 600; }

.trend-bar {
  height: 6px; border-radius: 3px; background: var(--divider);
  min-width: 60px; position: relative; overflow: hidden;
}
.trend-bar i {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--mint); border-radius: 3px;
}

/* ============ 管理页 ============ */

.child-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--divider);
}
.child-row:last-child { border-bottom: none; }
.child-row .info b { font-size: 14px; }
.child-row .info span { font-size: 12px; color: var(--text-2); margin-left: 8px; }
.child-row .ops { display: flex; gap: 8px; }

.lib-cat { margin-bottom: 14px; }
.lib-cat-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.lib-cat-head b { font-size: 13px; }
.lib-cat-head button {
  border: none; background: none; color: var(--text-2); font-size: 12px;
}
.lib-cat-head button:hover { color: var(--danger); }
.lib-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F7F9F7; border-radius: 8px;
  padding: 4px 10px; margin: 0 6px 6px 0; font-size: 13px;
}
.lib-item button {
  border: none; background: none; color: var(--text-2);
  font-size: 12px; padding: 0; line-height: 1;
}
.lib-item button:hover { color: var(--danger); }
.lib-add {
  display: flex; gap: 8px; margin-top: 8px;
}
.lib-add input {
  flex: 1; height: 36px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none;
}
.lib-add input:focus { border-color: var(--mint); }

.fix-edit-row { display: flex; gap: 8px; margin-bottom: 8px; }
.fix-edit-row input {
  height: 38px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; font-size: 13px; outline: none;
}
.fix-edit-row .t { width: 110px; flex-shrink: 0; }
.fix-edit-row .p { flex: 1; }
.fix-edit-row .x {
  width: 38px; flex-shrink: 0; border: none; background: none;
  color: var(--text-2); font-size: 15px;
}
.fix-edit-row .x:hover { color: var(--danger); }

.about-block { font-size: 12.5px; color: var(--text-2); line-height: 1.8; }

/* ============ Toast ============ */

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--text); color: #fff;
  border-radius: 999px; padding: 8px 20px;
  font-size: 13px; z-index: 200;
  max-width: 86%; text-align: center;
}

.empty-tip { text-align: center; color: var(--text-2); font-size: 13px; padding: 18px 0; }

/* ============ 电脑端（>768px）：多列布局 ============ */

@media (min-width: 769px) {
  .main { padding-bottom: 100px; }
  .cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .cols-2 > .card + .card { margin-top: 0; }
  .cols-left { display: grid; grid-template-columns: 7fr 5fr; gap: 12px; align-items: start; }
  .cols-left > .card + .card { margin-top: 0; }
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
  .tabbar { bottom: 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.97); }
}
