:root {
  --bg: #f7f3ed;
  --ink: #2b2622;
  --ink-soft: #4b4238;
  --muted: #93887b;
  --muted-light: #b2a698;
  --line: #efe6da;
  --card: #ffffff;
  --coral: #ff7a45;
  --coral-deep: #e8652f;
  --coral-soft: #fff0e8;
  --green: #2e8b6b;
  --amber: #c2861c;
  --red: #c65a5a;
  --violet: #6d5bd0;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(74, 57, 40, 0.06);
  --shadow-soft: 0 6px 18px rgba(74, 57, 40, 0.045);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 214, 184, 0.55), transparent 42%),
    radial-gradient(circle at 92% 6%, rgba(255, 236, 214, 0.6), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button,
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

a {
  color: var(--coral-deep);
}

svg {
  display: block;
}

.app {
  min-height: 100vh;
}

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  color: var(--muted);
  font-size: 14px;
}

.boot-mark,
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ee6a3c, #ffb26c);
  box-shadow: 0 14px 28px rgba(238, 106, 60, 0.28);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
}

/* -------------------------------- 顶栏 --------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: var(--safe-top);
  background: rgba(247, 243, 237, 0.86);
  border-bottom: 1px solid rgba(239, 230, 218, 0.7);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 10px 20px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ee6a3c, #ffb26c);
  box-shadow: 0 6px 14px rgba(238, 106, 60, 0.24);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
  margin-left: 10px;
}

.brand-name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.brand-sub {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #7a6f63;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8cec1;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 139, 107, 0.12);
}

.status-dot.offline {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(194, 134, 28, 0.12);
}

.status-dot.checking {
  background: var(--muted-light);
  animation: pulse 1.2s ease-in-out infinite;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f2e6d8;
  border-radius: 50%;
  background: #fff;
  color: var(--coral-deep);
  font-size: 14px;
  font-weight: 800;
}

/* -------------------------------- 布局 --------------------------------- */

.content {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 20px calc(112px + var(--safe-bottom));
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 2px 18px;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.page-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

/* -------------------------------- 主卡片 -------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 22px;
  border-radius: 26px;
  background: linear-gradient(135deg, #ee6a3c 0%, #ff8a52 58%, #ffb26c 100%);
  box-shadow: 0 18px 40px rgba(238, 106, 60, 0.24);
  color: #fff;
}

.hero-decoration {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.hero-decoration.d1 {
  top: -90px;
  right: -46px;
  width: 210px;
  height: 210px;
}

.hero-decoration.d2 {
  right: 52px;
  bottom: -84px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-decoration.d3 {
  top: 76px;
  right: 150px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.16);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-date {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.hero-greeting {
  margin-top: 17px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.hero-title {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.hero-sub {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.55;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.35s ease;
}

.progress-text {
  flex: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* -------------------------------- 周日期 -------------------------------- */

.week-card {
  margin-top: 14px;
  padding: 13px 14px 12px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 10px;
}

.week-range {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f6f1ea;
  color: #6e6459;
  font-size: 20px;
  line-height: 1;
}

.nav-btn:active {
  background: #eee7de;
}

.today-mini {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-size: 11px;
  font-weight: 700;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 0 7px;
  border-radius: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.day:active {
  transform: scale(0.96);
}

.day-label {
  color: #a3978a;
  font-size: 10px;
  line-height: 1.2;
}

.day-num {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.day-dot {
  width: 5px;
  height: 5px;
  margin-top: 5px;
  border-radius: 50%;
  background: #e1d8cc;
}

.day-selected {
  background: #2b2622;
  box-shadow: 0 7px 16px rgba(43, 38, 34, 0.18);
}

.day-selected .day-label {
  color: rgba(255, 255, 255, 0.62);
}

.day-selected .day-num {
  color: #fff;
}

.day-future .day-num {
  color: #bdb2a5;
}

.dot-done {
  background: var(--green);
}

.dot-doing {
  background: #e0a42c;
}

.dot-future {
  background: #e9e1d6;
}

.dot-none {
  background: #e1d8cc;
}

.day-selected .day-dot {
  background: #ffb08b;
}

/* -------------------------------- 清单 --------------------------------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 3px 12px;
}

.section-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.section-title {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.section-sub {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.role-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: #7a6f63;
  font-size: 11px;
  font-weight: 600;
}

.role-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

.hint-banner {
  margin-bottom: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  background: #fff4e9;
  color: #a46b34;
  font-size: 12px;
  line-height: 1.5;
}

/* -------------------------------- 任务卡 -------------------------------- */

.task-card {
  margin-bottom: 12px;
  padding: 17px 17px 14px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-card:active {
  transform: scale(0.995);
}

.task-main {
  display: flex;
  align-items: flex-start;
}

.task-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 19px;
  font-weight: 800;
}

.task-content {
  flex: 1;
  min-width: 0;
  margin-left: 13px;
}

.task-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #332d27;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-meta {
  margin-top: 6px;
  color: #b4a99b;
  font-size: 11px;
}

.task-note {
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f9f4ed;
  color: #7c7164;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.note-mark {
  margin-right: 2px;
  color: #d9c7b2;
  font-weight: 700;
}

.task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed #f0e8de;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* -------------------------------- 按钮 --------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--coral);
  box-shadow: 0 7px 16px rgba(255, 122, 69, 0.22);
  color: #fff;
}

.btn-soft {
  background: var(--coral-soft);
  color: var(--coral-deep);
}

.btn-ghost {
  background: #f5f0e9;
  color: #6e6459;
}

.btn-danger {
  background: #fbeaea;
  color: var(--red);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 48px;
  padding: 0 24px;
  font-size: 15px;
}

.btn-sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-disabled,
.btn:disabled {
  opacity: 0.45;
  transform: none;
}

/* -------------------------------- 状态 --------------------------------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.tone-pending {
  background: #f3eee7;
  color: #95897b;
}

.tone-submitted {
  background: #fcf1dc;
  color: var(--amber);
}

.tone-confirmed {
  background: #e8f4ef;
  color: var(--green);
}

.tone-rejected {
  background: #fbeaea;
  color: var(--red);
}

.tone-note {
  background: #efedfb;
  color: var(--violet);
}

/* -------------------------------- 空状态 -------------------------------- */

.add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 56px;
  margin-top: 4px;
  border: 1px dashed #dccfbe;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  color: #a68f76;
  font-size: 13px;
  font-weight: 600;
}

.add-plus {
  color: var(--coral);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.footnote {
  margin-top: 20px;
  padding: 0 8px;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  display: flex;
  align-items: center;
  padding: 17px;
  border-radius: 22px;
  background: var(--card);
}

.sk-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: #f0eae2;
  animation: pulse 1.2s ease-in-out infinite;
}

.sk-lines {
  flex: 1;
  margin-left: 13px;
}

.sk-line {
  height: 14px;
  border-radius: 6px;
  background: #f3ede5;
  animation: pulse 1.2s ease-in-out infinite;
}

.sk-w1 {
  width: 46%;
  margin-bottom: 9px;
}

.sk-w2 {
  width: 72%;
  height: 11px;
}

.empty-card {
  padding: 32px 22px 28px;
  border-radius: 22px;
  background: var(--card);
  text-align: center;
}

.empty-illustration {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fff3e9;
}

.empty-paper {
  position: absolute;
  top: 21px;
  left: 29px;
  width: 38px;
  height: 45px;
  border: 2px solid #ffb28b;
  border-radius: 5px;
  background: #fff;
}

.empty-paper::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 7px;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: #ffd7c2;
  box-shadow: 0 9px 0 #ffd7c2, 0 18px 0 #ffd7c2;
}

.empty-check {
  position: absolute;
  right: 13px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.empty-title {
  color: #5f554a;
  font-size: 16px;
  font-weight: 700;
}

.empty-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.error-card {
  padding: 34px 22px;
  border-radius: 22px;
  background: var(--card);
  text-align: center;
}

.error-title {
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
}

.error-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.retry-btn {
  margin-top: 17px;
}

.loading-card {
  padding: 20px;
  border-radius: 22px;
  background: var(--card);
}

.sk-block {
  height: 34px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #f3ede5;
  animation: pulse 1.2s ease-in-out infinite;
}

.sk-block.sk-small {
  width: 56%;
  margin-bottom: 0;
}

/* -------------------------------- 历史页 -------------------------------- */

.history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 2px 16px;
}

.period-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: #efe8de;
}

.period-tab {
  min-width: 50px;
  height: 30px;
  border-radius: 999px;
  color: #8c8074;
  font-size: 12px;
  font-weight: 700;
}

.period-tab.active {
  background: #fff;
  box-shadow: 0 2px 7px rgba(74, 57, 40, 0.1);
  color: var(--ink);
}

.offline-note {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff4e9;
  color: #a46b34;
  font-size: 12px;
}

.stats-card {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 15px;
  border-radius: 26px;
  background: #2b2622;
  box-shadow: 0 16px 36px rgba(43, 38, 34, 0.2);
  color: #fff;
}

.stats-glow {
  position: absolute;
  top: -100px;
  right: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 82, 0.55), transparent 66%);
  pointer-events: none;
}

.stats-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.stats-main {
  flex: 1;
  min-width: 0;
}

.stats-rate {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stats-percent {
  margin-left: 2px;
  font-size: 21px;
  font-weight: 700;
}

.stats-label {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.stats-divider {
  width: 1px;
  height: 64px;
  margin: 0 22px;
  background: rgba(255, 255, 255, 0.12);
}

.stats-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: none;
}

.stat-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.stat-value {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-unit {
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 500;
}

.stat-label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}

.stats-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}

.chart-card {
  margin-top: 14px;
  padding: 18px 16px 14px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px;
}

.card-title {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 800;
}

.card-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-solid {
  background: var(--coral);
}

.dot-light {
  background: #f6c9a8;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 170px;
  margin-top: 17px;
  padding: 0 3px;
}

.bar-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
}

.bar-track {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  max-width: 22px;
  height: 150px;
  overflow: hidden;
  border-radius: 6px 6px 3px 3px;
  background: #f6f1ea;
}

.bar-submitted {
  width: 100%;
  background: #f6c9a8;
}

.bar-confirmed {
  width: 100%;
  background: linear-gradient(180deg, #ff8a52, #ee6a3c);
}

.bar-empty {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e9e1d6;
}

.bar-label {
  height: 14px;
  margin-top: 5px;
  color: #b0a597;
  font-size: 9px;
  line-height: 14px;
  white-space: nowrap;
}

.bar-label-today {
  color: var(--coral-deep);
  font-weight: 700;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 3px 10px;
}

.list-title {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.list-tip {
  color: var(--muted);
  font-size: 11px;
}

.empty-note {
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.day-list {
  overflow: hidden;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 15px;
  border-bottom: 1px solid #f4ede4;
  text-align: left;
}

.day-row:last-child {
  border-bottom: 0;
}

.day-row:active {
  background: #fbf8f3;
}

.day-info {
  flex: 1;
  min-width: 0;
}

.day-date {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.day-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.day-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.mini-bar {
  width: 44px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e9e0;
}

.mini-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--coral);
}

.mini-percent {
  width: 30px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------- 设置页 -------------------------------- */

.settings-head {
  margin: 2px 3px 16px;
}

.card {
  margin-bottom: 13px;
  padding: 17px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.section-label {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.role-segment {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.role-option {
  flex: 1;
  padding: 12px 13px;
  border: 1px solid #efe6da;
  border-radius: 15px;
  background: #fbf8f3;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.role-option.active {
  border-color: #ffc6ad;
  background: var(--coral-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 69, 0.12);
}

.role-name {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.role-option.active .role-name {
  color: var(--coral-deep);
}

.role-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.identity-hint {
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.55;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-hint {
  color: var(--muted-light);
  font-size: 10px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f5eee5;
}

.name-row:last-of-type {
  border-bottom: 0;
}

.name-label {
  flex: none;
  width: 38px;
  color: var(--muted);
  font-size: 12px;
}

.name-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #ede4d9;
  border-radius: 10px;
  outline: none;
  background: #fbf7f1;
  color: var(--ink);
  font-size: 14px;
}

.name-input:focus {
  border-color: #ffc6ad;
  background: #fff;
}

.save-name-btn {
  margin-top: 12px;
}

.template-card {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid #f1e9df;
  border-radius: 16px;
  background: #fcfaf6;
}

.template-inactive {
  opacity: 0.62;
}

.template-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
}

.template-info {
  flex: 1;
  min-width: 0;
}

.template-title {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.template-sub {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e6ded4;
  transition: background 0.18s ease;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(74, 57, 40, 0.2);
  transition: transform 0.18s ease;
}

.switch-on {
  background: var(--green);
}

.switch-on .switch-knob {
  transform: translateX(18px);
}

.switch-saving {
  opacity: 0.5;
}

.weekday-chips {
  display: flex;
  gap: 5px;
  margin-top: 11px;
}

.weekday-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  height: 27px;
  border-radius: 8px;
  background: #f3eee7;
  color: #a3978a;
  font-size: 10px;
  font-weight: 600;
}

.weekday-chip.active {
  background: #ffe3d5;
  color: var(--coral-deep);
}

.chip-saving {
  opacity: 0.5;
}

.template-foot {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 10px;
}

.schedule-hint {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed #f0e8de;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.5;
}

.conn-box {
  padding: 11px 12px;
  border-radius: 12px;
  background: #fbf7f1;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8cec1;
}

.conn-dot.dot-online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 139, 107, 0.12);
}

.conn-dot.dot-offline {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(194, 134, 28, 0.12);
}

.conn-dot.dot-checking {
  animation: pulse 1.2s ease-in-out infinite;
}

.conn-text {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.conn-api {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conn-desc {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.conn-error {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fdf1f1;
  color: var(--red);
  font-size: 10px;
  line-height: 1.5;
  word-break: break-word;
}

.conn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.about-card {
  background: linear-gradient(160deg, #fffdfa, #fbf4ea);
}

.about-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.version {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 500;
}

.about-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

/* -------------------------------- 底部导航 ------------------------------- */

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 253, 250, 0.94);
  border-top: 1px solid rgba(239, 230, 218, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 6px 12px 7px;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  border-radius: 12px;
  color: #a3978a;
  font-size: 10px;
  font-weight: 600;
}

.tab-item img {
  width: 23px;
  height: 23px;
  opacity: 0.72;
}

.tab-item.active {
  color: var(--coral-deep);
}

.tab-item.active img {
  opacity: 1;
}

.tab-item:active {
  background: #fbf6ef;
}

/* -------------------------------- 弹层 --------------------------------- */

.modal-root:empty {
  display: none;
}

.sheet-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  background: rgba(43, 38, 34, 0.46);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade-in 0.18s ease;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 901;
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  padding: 14px 22px calc(26px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  background: #fffdfa;
  box-shadow: 0 -14px 40px rgba(43, 38, 34, 0.18);
  transform: translateX(-50%);
  animation: slide-up 0.24s ease;
  -webkit-overflow-scrolling: touch;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #e7ded2;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f4efe8;
  color: #8e8377;
  font-size: 21px;
  line-height: 1;
}

.sheet-task-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-right: 42px;
}

.sheet-task-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 20px;
  font-weight: 800;
}

.sheet-task-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.sheet-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.sheet-task-schedule {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sheet-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.task-meta-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f8f3ec;
  color: #83776a;
  font-size: 12px;
}

.meta-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb08b;
}

.sheet-note {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  background: #fff6ec;
}

.sheet-note-label {
  color: #b07b4e;
  font-size: 10px;
  font-weight: 700;
}

.sheet-note-text {
  margin-top: 4px;
  color: #6f5b47;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.sheet-section-title {
  margin: 20px 0 3px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.timeline {
  margin-top: 13px;
  padding-left: 2px;
}

.timeline-item {
  position: relative;
  display: flex;
  padding-bottom: 15px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: -2px;
  left: 4px;
  width: 1px;
  background: #efe7dc;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  margin-right: 11px;
  border-radius: 50%;
  background: #d8cec1;
}

.timeline-dot.dot-confirmed {
  background: var(--green);
}

.timeline-dot.dot-submitted {
  background: #e0a42c;
}

.timeline-dot.dot-rejected {
  background: var(--red);
}

.timeline-dot.dot-note {
  background: var(--violet);
}

.timeline-body {
  flex: 1;
  min-width: 0;
}

.timeline-text {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.timeline-note {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f8f3ec;
  color: #7a6f63;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.timeline-time {
  margin-top: 2px;
  color: #b0a597;
  font-size: 10px;
}

.timeline-empty {
  padding: 14px 0 4px;
  color: #a79c8f;
  font-size: 12px;
}

.note-input,
.text-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ede4d9;
  border-radius: 13px;
  outline: none;
  background: #fbf7f1;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.note-input {
  min-height: 86px;
  resize: vertical;
}

.text-input {
  height: 44px;
}

.note-input:focus,
.text-input:focus {
  border-color: #ffc6ad;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.08);
}

.field-label {
  margin: 18px 0 7px;
  color: #6e6459;
  font-size: 12px;
  font-weight: 700;
}

.save-note-btn {
  margin-top: 10px;
}

.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f1e9df;
}

.sheet-actions .btn {
  min-width: 96px;
  min-height: 40px;
}

.add-sheet-title {
  margin-top: 2px;
}

.add-submit {
  margin-top: 20px;
}

/* -------------------------------- 口令页 -------------------------------- */

.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 20px calc(28px + var(--safe-bottom));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 24px;
  border-radius: 28px;
  background: #fffdfa;
  box-shadow: 0 24px 60px rgba(74, 57, 40, 0.12);
  text-align: center;
}

.auth-logo {
  margin: 0 auto 17px;
}

.auth-title {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.auth-text {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-label {
  display: block;
  margin: 22px 0 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #ede4d9;
  border-radius: 13px;
  outline: none;
  background: #fbf7f1;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 1px;
}

.auth-input:focus {
  border-color: #ffc6ad;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.08);
}

.auth-error {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fdf1f1;
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}

.auth-submit {
  width: 100%;
  margin-top: 15px;
}

.auth-hint {
  margin: 18px 0 0;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.65;
}

/* -------------------------------- 对话框 -------------------------------- */

.dialog-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(43, 38, 34, 0.46);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade-in 0.15s ease;
}

.dialog-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}


.dialog-card {
  width: 100%;
  max-width: 330px;
  padding: 24px 22px 18px;
  border-radius: 22px;
  background: #fffdfa;
  box-shadow: 0 24px 60px rgba(43, 38, 34, 0.24);
  animation: pop-in 0.18s ease;
}

.dialog-title {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.dialog-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 19px;
}

.dialog-actions .btn {
  flex: 1;
  min-height: 42px;
}

/* -------------------------------- 提示条 -------------------------------- */

.toast {
  position: fixed;
  top: calc(74px + var(--safe-top));
  left: 50%;
  z-index: 1100;
  max-width: min(86vw, 420px);
  padding: 10px 17px;
  border-radius: 999px;
  background: rgba(43, 38, 34, 0.92);
  box-shadow: 0 10px 26px rgba(43, 38, 34, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  word-break: break-word;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.toast-error {
  background: rgba(168, 66, 66, 0.96);
}

/* -------------------------------- 动效 --------------------------------- */

@keyframes pulse {
  0% { opacity: 0.55; }
  50% { opacity: 1; }
  100% { opacity: 0.55; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* -------------------------------- 大屏 --------------------------------- */

@media (min-width: 820px) {
  body {
    font-size: 17px;
  }

  .topbar-inner {
    padding: 12px 28px;
  }

  .content {
    padding: 24px 28px calc(126px + var(--safe-bottom));
  }

  .hero {
    padding: 28px 30px;
    border-radius: 30px;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-greeting,
  .hero-sub {
    font-size: 14px;
  }

  .hero-date {
    font-size: 13px;
  }

  .hero-decoration.d1 {
    width: 280px;
    height: 280px;
  }

  .week-card {
    margin-top: 16px;
    padding: 16px 18px 14px;
  }

  .day {
    padding: 10px 0 9px;
  }

  .day-num {
    font-size: 18px;
  }

  .task-card {
    padding: 20px 21px 16px;
  }

  .task-icon {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 21px;
  }

  .task-title {
    font-size: 17px;
  }

  .task-sub,
  .task-meta,
  .task-note {
    font-size: 13px;
  }

  .btn {
    min-height: 40px;
    padding: 0 19px;
    font-size: 14px;
  }

  .btn-sm {
    min-height: 32px;
    font-size: 12px;
  }

  .sheet {
    bottom: 18px;
    border-radius: 28px;
    max-height: 86vh;
    padding-left: 30px;
    padding-right: 30px;
    box-shadow: 0 30px 80px rgba(43, 38, 34, 0.24);
  }

  .auth-card {
    padding: 36px 34px 30px;
  }

  .stats-rate {
    font-size: 56px;
  }

  .chart {
    height: 190px;
  }

  .bar-track {
    height: 170px;
  }

  .card {
    padding: 20px;
  }

  .role-option {
    padding: 14px 16px;
  }
}

@media (min-width: 1180px) {
  .content,
  .topbar-inner,
  .tabbar-inner,
  .sheet {
    max-width: 920px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------- 打印 --------------------------------- */

@media print {
  .topbar,
  .tabbar,
  .toast,
  .modal-root {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .content {
    max-width: none;
    padding: 0;
  }
}
