/* 品牌主题：在 Bootstrap 5.3 之上叠加吉卜力手绘风的“家庭成长记录”视觉 */
:root {
  --brand: #5f8d72;
  --brand-dark: #446c57;
  --accent: #e0a85d;
  --sky: #dceff2;
  --cream: #fbf5e8;
  --ink: #3d4a42;
  --muted: #7c8981;
  --line: #e7ddc8;

  --bs-body-bg: #f6f1e6;
  --bs-body-color: #3d4a42;
  --bs-emphasis-color: #3d4a42;
  --bs-secondary-color: #7c8981;
  --bs-border-color: #e7ddc8;

  --bs-primary: #5f8d72;
  --bs-primary-rgb: 95, 141, 114;
  --bs-secondary: #7c8981;
  --bs-secondary-rgb: 124, 137, 129;
  --bs-danger: #c46f63;
  --bs-danger-rgb: 196, 111, 99;
  --bs-warning: #e0a85d;
  --bs-warning-rgb: 224, 168, 93;
  --bs-success: #5f8d72;
  --bs-success-rgb: 95, 141, 114;

  --bs-link-color: #4d8063;
  --bs-link-color-rgb: 77, 128, 99;
  --bs-link-hover-color: #3e6b50;
  --bs-link-hover-color-rgb: 62, 107, 80;

  --bs-border-radius: 18px;
  --bs-border-radius-sm: 12px;
  --bs-border-radius-lg: 24px;
  --bs-focus-ring-color: rgba(95, 141, 114, 0.2);

  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bs-body-font-size: 0.9375rem;
  --bs-body-line-height: 1.65;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(220, 239, 242, .9) 0%, rgba(246, 241, 230, 0) 340px),
    radial-gradient(1100px 500px at 82% -8%, rgba(173, 215, 222, .55), transparent 62%),
    radial-gradient(900px 420px at -6% 6%, rgba(240, 205, 142, .32), transparent 58%),
    radial-gradient(1100px 560px at 50% 112%, rgba(127, 174, 144, .22), transparent 64%),
    var(--bs-body-bg);
  color: var(--bs-body-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* 背景光晕，柔化整页底色 */
body::before {
  z-index: -2;
  background:
    radial-gradient(760px 360px at 8% 6%, rgba(255, 255, 255, .35), transparent 62%),
    radial-gradient(560px 260px at 92% 12%, rgba(255, 245, 222, .35), transparent 58%),
    radial-gradient(900px 440px at 50% 106%, rgba(127, 174, 144, .18), transparent 66%);
}

/* 细密点阵纹理，增加层次但不干扰阅读 */
body::after {
  z-index: -1;
  opacity: .6;
  background-image:
    radial-gradient(rgba(95, 141, 114, .14) 1.1px, transparent 1.1px),
    radial-gradient(rgba(224, 168, 93, .12) 1.3px, transparent 1.3px);
  background-size: 32px 32px, 58px 58px;
  background-position: 0 0, 17px 23px;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, .page-title {
  font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
  color: #3d4a42;
  letter-spacing: .01em;
}

/* 导航栏 */
.navbar {
  background: rgba(255, 253, 247, .92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(75, 92, 80, .06);
}
.navbar-brand { font-weight: 700; font-size: 18px; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; }
.navbar-brand:hover { color: var(--brand-dark); }
.brand-logo { border-radius: 9px; }
.navbar-nav { gap: 6px; }
.navbar .nav-btn {
  --bs-btn-padding-y: .42rem;
  --bs-btn-padding-x: .9rem;
  --bs-btn-font-size: .875rem;
  --bs-btn-font-weight: 500;
  --bs-btn-line-height: 1.5;
  --bs-btn-color: var(--muted);
  --bs-btn-bg: #f7f4ee;
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--brand-dark);
  --bs-btn-hover-bg: #eef5ef;
  --bs-btn-hover-border-color: #cfe0d5;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-bg: #f7f4ee;
  --bs-btn-disabled-border-color: var(--line);
  --bs-btn-border-radius: 999px;
  white-space: nowrap;
}
.navbar .nav-btn.active,
.navbar .nav-btn:active {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
}
.navbar .nav-btn:focus-visible { box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.userbox { font-size: 13px; color: var(--muted); }
.who small { display: block; font-size: 11px; }
.family-switch select { width: auto; }

@media (min-width: 992px) {
  .navbar-nav { align-items: center; }
  .nav-item { display: flex; align-items: center; }
}

.container { max-width: 1180px; }
main.container { padding-top: 24px; padding-bottom: 60px; }
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

/* 卡片：直接复用 Bootstrap .card，这里补充内边距与柔和阴影 */
.card {
  padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x);
  margin-bottom: 1.25rem;
  background: rgba(255, 253, 248, .94);
  border: 1px solid rgba(231, 221, 200, .8);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(75, 92, 80, .08), 0 1px 0 rgba(255, 255, 255, .7) inset;
}

/* 表格 */
.table {
  --bs-table-bg: #fff;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: #faf8f3;
  --bs-table-hover-bg: #f4f7f2;
  font-size: .9rem;
}
.table thead th {
  background: #f6f3ec;
  color: var(--muted);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .02em;
  white-space: nowrap;
  border-bottom-color: var(--line);
  padding-top: .7rem;
  padding-bottom: .7rem;
}
.table td, .table th { vertical-align: middle; }
.table tbody td { padding: .72rem .85rem; }
.table .small { font-size: .8rem; }
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.table-wrap .table { margin-bottom: 0; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; }

/* 徽章状态色 */
.badge { font-weight: 600; background: #eee9e0; color: var(--muted); }
.badge.draft { background: #f1ead9; color: #8a6c31; }
.badge.confirmed, .badge.active { background: #e2f0e7; color: #2f6d47; }
.badge.archived, .badge.revised, .badge.inactive { background: #e8e2dc; color: #6b6259; }
.badge.submitted { background: #e6edf4; color: #3f6687; }
.badge.child { background: #f8e7cf; color: #96651d; }
.badge.parent { background: #e6e4f3; color: #555084; }
.badge.owner { background: #f3dcd8; color: #8c4a3f; }
.badge.readonly { background: #eef0ee; color: #66706a; }
.badge.reading { background: #e2f0e7; color: #2f6d47; }
.badge.read { background: #eee7da; color: #7a6847; }

/* 表单：让裸标签与输入框与 Bootstrap 视觉一致 */
form label { display: block; font-weight: 600; margin: 12px 0 5px; font-size: 14px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 .25rem rgba(79, 124, 100, .14);
}
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.required::after { content: " *"; color: var(--bs-danger); }

/* 提示条 */
.flash-stack { position: sticky; top: 68px; z-index: 15; }
.flash-stack .alert { box-shadow: 0 4px 14px rgba(70, 55, 40, .08); }

/* 网格辅助（Bootstrap 网格之外的紧凑等分栅格） */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 通用小工具 */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hash { font-size: 11px; color: var(--muted); word-break: break-all; }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.divider { border-top: 1px solid var(--line); margin: 18px 0; }
.page-title { font-size: 24px; margin: 0 0 18px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.metric { font-size: 30px; font-weight: 700; }
.metric-label { color: var(--muted); font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #e7e0d2; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #6c5f4e; }
.danger-text { color: var(--bs-danger); }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; padding: 0; font-size: 13px; }
.inline-form { display: inline; }
.highlight { background: #fff5df; }
.signature-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; }
.diff-add { background: #e8f3e9; }
.diff-del { background: #f8e7e6; text-decoration: line-through; }
.print-only { display: none; }

/* 认证 / 欢迎页 */
.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 32px;
  align-items: center;
  max-width: 960px;
  margin: 5vh auto;
  padding: 0 18px;
}
.auth-art img { width: 100%; height: auto; display: block; border-radius: 22px; }
.auth-card { margin: 0; }
.auth-logo { display: block; margin: 0 auto 12px; border-radius: 14px; }

/* 登录验证码 */
.captcha-row {
  display: grid;
  grid-template-columns: 1fr 118px auto;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.captcha-row > input { width: 100%; }
.captcha-img {
  width: 118px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
}
.captcha-refresh { height: 42px; white-space: nowrap; }
@media (max-width: 520px) {
  .captcha-row { grid-template-columns: 1fr 108px; }
  .captcha-refresh { grid-column: 1 / -1; width: 100%; }
  .captcha-img { width: 108px; }
}

/* 周计划编辑与报告 */
.plan-edit-row {
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
  margin-bottom: 10px;
}
.plan-edit-row > div { min-width: 0; }
.plan-edit-row button { height: 38px; }
.report-metrics { gap: 14px; margin-bottom: 10px; }
.report-metrics > div {
  background: #f8f6f1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.report-metrics .metric { font-size: 25px; }

/* 星星评分 */
.star-rating { display: flex; align-items: center; gap: 6px; }
.star-btn {
  width: auto;
  border: none;
  background: none;
  font-size: 30px;
  line-height: 1;
  color: #d8d2c6;
  cursor: pointer;
  padding: 0 2px;
  transition: color .12s ease, transform .12s ease;
}
.star-btn:hover { transform: scale(1.12); }
.star-btn.active { color: #e2a23e; }
.star-hint { margin-left: 8px; }
.review-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
}

/* 周计划日历 */
.week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-current { font-weight: 600; color: var(--ink); font-size: 14px; }
.plan-filters { align-items: flex-end; }
.filter-btn { display: flex; align-items: flex-end; }

.week-card { padding: 0; overflow: hidden; }
.week-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.week-card-head h2 { margin-right: auto; }

.week-calendar { min-width: 880px; border-collapse: separate; border-spacing: 0; }
.week-calendar th, .week-calendar td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px;
}
.week-calendar th { background: #f6f3ec; text-align: center; }
.week-calendar thead th { background: #eef2eb; }
.week-calendar .slot-col { width: 112px; text-align: right; font-weight: 600; color: var(--muted); }
.week-calendar .day-name { display: block; font-size: 14px; color: var(--ink); }
.week-calendar .day-date { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.week-calendar .day-cell { vertical-align: top; min-height: 112px; }
.slot-allday th, .slot-allday td { border-bottom: none; }

.cell-add {
  float: right;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  width: 25px;
  height: 25px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin: -3px -3px 8px 6px;
}
.cell-add:hover { background: #eef5ef; border-color: var(--brand); }

.plan-chip {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
  margin: 0 0 8px;
  box-shadow: 0 1px 2px rgba(70, 55, 40, .05);
}
.plan-chip.cat-exercise { border-left-color: #e0a23e; }
.plan-chip.cat-screen { border-left-color: #7195b5; }
.plan-chip-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.chip-cat { font-size: 11px; color: #fff; background: var(--brand); border-radius: 999px; padding: 1px 7px; }
.cat-exercise .chip-cat { background: #e0a23e; }
.cat-screen .chip-cat { background: #7195b5; }
.chip-time { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip-title { font-weight: 600; margin-top: 5px; }
.chip-target { color: var(--muted); font-size: 12px; margin-top: 3px; }
.chip-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.chip-foot .actual { color: #8a5b2e; font-weight: 600; }
.chip-foot .eval { color: var(--muted); }
.chip-foot .eval.done { color: #2f6d47; }
.chip-foot .eval.miss { color: var(--bs-danger); }

.actual-form { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.actual-form .actual-input { width: 92px; padding: 5px 7px; font-size: 13px; }

/* 目标列表与树形拆解 */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.view-tabs .btn.active {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
}
.goal-list { display: flex; flex-direction: column; gap: 8px; }
.goal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.goal-date { font-size: 12px; color: var(--muted); min-width: 88px; }
.goal-link { flex: 1; font-weight: 600; }
.badge.goal-active { background: #e2f0e7; color: #2f6d47; }
.badge.goal-done { background: #dbe9df; color: #3b604d; }
.badge.goal-archived { background: #e8e2dc; color: #6b6259; }

.goal-tree { list-style: none; margin: 0; padding-left: 0; }
.goal-tree .goal-tree { padding-left: 20px; }
.goal-node { margin: 8px 0; }
.goal-details {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: #fff;
}
.goal-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.goal-summary::-webkit-details-marker { display: none; }
.goal-summary strong { font-size: 15px; }
.goal-node-body { padding: 2px 12px 12px; }
.goal-inline-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.inline-sub { position: relative; }
.inline-sub summary {
  cursor: pointer;
  display: inline-block;
  padding: .28rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  font-size: 13px;
  background: #f7f4ee;
}
.inline-sub summary::-webkit-details-marker { display: none; }
.goal-sub-form {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfaf7;
}
.goal-children {
  list-style: none;
  margin: 10px 0 0 14px;
  padding-left: 16px;
  border-left: 1px dashed var(--line);
}

/* 日记列表与详情 */
.diary-date-head {
  margin: 18px 0 10px;
  font-size: 15px;
  color: var(--brand-dark);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.diary-entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.diary-excerpt {
  white-space: pre-wrap;
  margin: 8px 0 0;
  max-height: 120px;
  overflow: hidden;
}
.diary-content {
  white-space: pre-wrap;
  margin: 14px 0 0;
  line-height: 1.8;
}
.comment-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fdfcf9;
}
.comment-form { margin-top: 14px; }

/* 阅读卡片与状态 */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}
.reading-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.reading-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.badge.reading {
  background: #e2f0e7;
  color: #2f6d47;
}
.badge.read {
  background: #f4e4bc;
  color: #7a5c2e;
}

/* 月计划卡片流 */
.month-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
}
.month-day-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, .88);
  padding: 12px;
  min-height: 92px;
}
.month-day-card.today {
  border-color: #e0a85d;
  background: #fff8e6;
  box-shadow: 0 4px 14px rgba(224, 168, 93, .18);
}
.month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 6px;
}

/* 计划类型选择卡片 */
.radio-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .72);
  cursor: pointer;
  font-weight: 600;
}
.radio-card:hover {
  border-color: var(--brand-soft, #7cb9a8);
  background: #f1f8f5;
}
.radio-card input[type="radio"] {
  width: auto;
}
.radio-card small {
  color: var(--muted);
  font-weight: 400;
}

/* 自定义弹窗（避开 Bootstrap .modal 冲突，改名 dialog） */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 35, 28, .36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1080;
}
.dialog { width: min(620px, 100%); max-height: 90vh; overflow: auto; margin: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-close { font-size: 24px; line-height: 1; color: var(--muted); }
body.modal-open { overflow: hidden; }

/* 响应式 */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; margin: 3vh auto; }
  .auth-art { display: none; }
}
@media (max-width: 991.98px) {
  .navbar-nav { gap: 3px; }
  .navbar .nav-btn { width: 100%; --bs-btn-border-radius: 10px; }
}
@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  main.container { padding: 16px 12px 50px; }
  .page-title { font-size: 21px; }
  .week-nav { width: 100%; order: 3; }
  .week-card-head { align-items: flex-start; }
  .week-card-head h2 { width: 100%; }
}

/* 打印 */
@media print {
  .navbar, .footer, .page-actions, .no-print, .flash-stack, .btn-close,
  body::before, body::after { display: none !important; }
  body { background: #fff; }
  .container { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: none; padding: 0; }
  .print-only { display: block; }
  a { color: #000; }
  table th, table td { border-color: #ccc; }
  .signature-box { min-height: 90px; }
}

/* 吉卜力风格：选择卡片、阅读书架与月计划 */
.radio-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  cursor: pointer;
  font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.radio-card:hover { transform: translateY(-1px); border-color: #b8cfc0; }
.radio-card input { margin: 0; }
.radio-card small { font-weight: 400; color: var(--muted); }
.radio-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 6px 16px rgba(95, 141, 114, .16);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.book-card { margin-bottom: 0; }
.book-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.month-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px;
}
.month-day-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  min-height: 96px;
}
.month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--brand-dark);
}

.footer {
  background: rgba(255, 253, 247, .65);
}

/* ============ 导航与信息层级（易用性优化） ============ */
.nav-ico {
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 5px;
  font-size: 14px;
  line-height: 1;
}
.ico-svg {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.14em;
}
.nav-ico .ico-svg { width: 15px; height: 15px; vertical-align: -0.12em; }
.mobile-tabbar a .tab-ico .ico-svg { width: 20px; height: 20px; vertical-align: -0.12em; }
.dropdown-item .ico-svg { margin-right: 4px; }
.summary-head h2 .ico-svg { margin-right: 5px; }
.navbar .dropdown-menu {
  --bs-dropdown-bg: #fffdf8;
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: #eef5ef;
  --bs-dropdown-link-hover-color: var(--brand-dark);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(75, 92, 80, .14);
}
.nav-divider { border-top: 1px solid var(--line); margin: 6px 0; }
.admin-link {
  color: #8c4a3f !important;
  border-color: #ead5cf !important;
}

/* 移动端底部快捷 Tab */
.mobile-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: rgba(255, 253, 247, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(75, 92, 80, .08);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.mobile-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 2px;
  border-radius: 10px;
}
.mobile-tabbar a .tab-ico { font-size: 19px; line-height: 1.2; }
.mobile-tabbar a.active { color: var(--brand-dark); background: #eef5ef; font-weight: 600; }
@media (max-width: 991.98px) {
  .mobile-tabbar { display: flex; }
  body { padding-bottom: 74px; }
  main.container { padding-bottom: 20px; }
  .sticky-form-actions { bottom: 74px; }
}

/* 首页：标题 + 快速开始 */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head .page-title { margin: 0; }
.quick-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quick-actions .dropdown-menu { min-width: 230px; }

/* 首页摘要卡片 */
.summary-card { margin-bottom: 1.25rem; }
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.summary-head h2 { margin: 0; font-size: 18px; }
.summary-count {
  font-size: 13px;
  color: var(--muted);
  background: #f3efe7;
  border-radius: 999px;
  padding: 2px 10px;
}
.summary-list { list-style: none; margin: 8px 0 0; padding: 0; }
.summary-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.summary-list li:last-child { border-bottom: none; }
.summary-list .s-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-list .s-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 统一列表工具栏 */
.toolbar {
  padding: 14px 16px;
  margin-bottom: 1.25rem;
  position: relative;
}
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-current { font-weight: 600; color: var(--ink); font-size: 14px; white-space: nowrap; }
.toolbar-views { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar-views .btn { --bs-btn-font-size: .82rem; --bs-btn-padding-y: .32rem; --bs-btn-padding-x: .7rem; }
.toolbar-views .btn.active {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
}
.toolbar-spacer { flex: 1; }
.toolbar-toggle {
  --bs-btn-color: var(--brand-dark);
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--line);
  --bs-btn-font-size: .82rem;
}
.toolbar-toggle:hover { --bs-btn-bg: #eef5ef; }
.toolbar-filters {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.toolbar-filters[hidden] { display: none !important; }
@media (max-width: 820px) {
  .toolbar-row { align-items: stretch; flex-direction: column; }
  .toolbar-period { width: 100%; justify-content: space-between; }
  .toolbar-spacer { display: none; }
  .toolbar-toggle { width: 100%; }
}

/* 长表单：锚点导航 + 底部常驻操作条 */
.form-anchors {
  position: sticky;
  top: 68px;
  z-index: 12;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(246, 241, 230, .94);
  backdrop-filter: blur(4px);
  padding: 10px 0;
  margin: 0 0 14px;
}
.form-anchors a {
  font-size: 13px;
  color: var(--muted);
  background: #f7f4ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.form-anchors a:hover { color: var(--brand-dark); background: #eef5ef; }
.form-step-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 0 5px;
  margin-right: 4px;
}
.sticky-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(255, 253, 247, .96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 -8px 24px rgba(75, 92, 80, .1);
  padding: 12px 14px;
  margin: 16px 0 8px;
}

/* 周计划“今天”高亮 */
.week-calendar .today-col { background: #fff8e6; }
.week-calendar .today-col th,
.week-calendar .today-col td { background: #fff8e6; }
.week-calendar thead .today-col th { background: #f7edd2; }
.today-badge {
  display: inline-block;
  background: #e0a85d;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  padding: 0 6px;
  margin-left: 4px;
}

/* 空状态里的行动按钮 */
.empty-action { margin-top: 12px; }
