:root {
  --bg: #f3f0e8;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #fffdf9;
  --ink: #17221f;
  --muted: #75817c;
  --line: #e7e1d6;
  --deep: #173936;
  --deep-2: #0f2928;
  --cream: #f7f2e7;
  --orange: #ef7656;
  --green: #4a9b79;
  --blue: #5b7bd5;
  --violet: #9b72c9;
  --gold: #d4a64e;
  --teal: #4ca6a0;
  --rose: #d67592;
  --shadow: 0 20px 60px rgba(28, 45, 39, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(74, 155, 121, 0.3);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.7;
  pointer-events: none;
}

.ambient-one {
  top: -240px;
  right: -180px;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(238, 172, 121, 0.22), rgba(238, 172, 121, 0));
}

.ambient-two {
  bottom: -300px;
  left: 12%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(96, 159, 137, 0.14), rgba(96, 159, 137, 0));
}

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 32px 22px 26px;
  border-right: 1px solid rgba(220, 213, 201, 0.72);
  background: rgba(249, 247, 241, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: var(--deep);
  box-shadow: 0 10px 22px rgba(23, 57, 54, 0.2);
}

.brand-mark span {
  width: 17px;
  height: 17px;
  border: 3px solid #d8e5d9;
  border-top-color: #eba46e;
  border-radius: 50%;
  transform: rotate(-35deg);
}

.brand strong {
  display: block;
  font-family: "STSong", "SimSun", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.desktop-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 46px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: #67736e;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.nav-button.active {
  border-color: rgba(255, 255, 255, 0.65);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 9px 24px rgba(28, 45, 39, 0.08);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: #ede9df;
  color: #67736e;
}

.nav-button.active .nav-icon {
  background: var(--deep);
  color: #fff;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(218, 211, 198, 0.76);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.52);
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(74, 155, 121, 0.12);
}

.sidebar-note.syncing .status-dot,
.sidebar-note.checking .status-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 166, 78, 0.13);
  animation: status-pulse 1.4s ease-in-out infinite;
}

.sidebar-note.offline .status-dot {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(239, 118, 86, 0.12);
}

.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.sidebar-note strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.sidebar-note span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.workspace {
  width: 100%;
  max-width: 1530px;
  margin: 0 auto;
  padding: 27px 34px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #8b948f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.topbar h1 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(222, 215, 203, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #67736e;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.sync-button i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(239, 118, 86, 0.1);
}

.sync-button.synced i {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 155, 121, 0.12);
}

.sync-button.syncing i {
  background: var(--gold);
  animation: status-pulse 1.4s ease-in-out infinite;
}

.date-pill {
  padding: 10px 15px;
  border: 1px solid rgba(222, 215, 203, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #6f7a75;
  font-size: 11px;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.primary-button {
  border: 1px solid var(--deep);
  background: var(--deep);
  color: #fff;
  box-shadow: 0 12px 26px rgba(23, 57, 54, 0.17);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #214843;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: #cdc6b9;
  background: #fbf8f1;
}

.ghost-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #68736f;
}

.danger-button {
  border: 1px solid rgba(193, 91, 90, 0.25);
  background: #fff7f5;
  color: #b34f4e;
}

.mobile-nav {
  display: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid rgba(225, 219, 207, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(35, 52, 46, 0.045);
  backdrop-filter: blur(12px);
}

.hero-card {
  position: relative;
  grid-column: span 7;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(190px, 1fr);
  align-items: center;
  min-height: 350px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgba(22, 58, 54, 0.8);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 65% -20%, rgba(99, 164, 142, 0.3), transparent 45%),
    linear-gradient(145deg, #183e3b 0%, #102d2c 76%);
  color: #fff;
  box-shadow: 0 24px 60px rgba(19, 50, 47, 0.2);
}

.hero-card::after {
  position: absolute;
  right: -45px;
  bottom: -95px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: #8d9994;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card .section-kicker {
  color: rgba(231, 241, 236, 0.63);
}

.section-title {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 21px;
  font-weight: 700;
}

.hero-card .section-title {
  color: #fff;
}

.donut-wrap {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: min(220px, 19vw);
  aspect-ratio: 1;
  min-width: 158px;
  border-radius: 50%;
  background: conic-gradient(#d9dedb 0 100%);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
  transition: background 250ms ease;
}

.donut::before {
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: #173936;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.17);
  content: "";
}

.donut.small {
  width: 158px;
  min-width: 158px;
}

.donut.small::before {
  inset: 22px;
  background: var(--surface-solid);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3vw, 39px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.donut-center span {
  display: block;
  margin-top: 7px;
  color: rgba(236, 244, 240, 0.6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.donut.small .donut-center strong {
  color: var(--ink);
  font-size: 30px;
}

.donut.small .donut-center span {
  color: var(--muted);
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.legend-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  color: rgba(242, 247, 244, 0.82);
  font-size: 11px;
}

.legend-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

.legend-row.light {
  color: #5b6762;
}

.legend-row.light:hover {
  background: #f7f3ea;
}

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

.legend-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.hero-total {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding: 13px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(232, 241, 236, 0.64);
  font-size: 10px;
}

.hero-total strong {
  color: #fff;
  font-size: 12px;
}

.goal-card {
  grid-column: span 5;
  padding: 25px;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.goal-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 21px;
}

.goal-ring {
  width: 144px;
  height: 144px;
}

.goal-ring::before {
  background: var(--surface-solid);
}

.goal-ring .donut-center strong {
  color: var(--ink);
  font-size: 29px;
}

.goal-ring .donut-center span {
  color: var(--muted);
}

.goal-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.goal-row {
  display: grid;
  grid-template-columns: 8px 62px minmax(44px, 1fr) 34px;
  gap: 9px;
  align-items: center;
  font-size: 10px;
}

.goal-row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-row .percent {
  color: #6f7a75;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe7de;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.stat-card {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 126px;
  padding: 20px;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 9px;
  background: var(--cream);
  color: #596761;
  font-size: 12px;
}

.stat-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.stat-number small {
  margin-left: 4px;
  color: var(--muted);
  font-family: "Microsoft YaHei UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0;
}

.stat-foot {
  margin-top: 8px;
  color: #8a938f;
  font-size: 10px;
}

.habit-card {
  grid-column: span 7;
  padding: 24px;
}

.card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.card-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.habit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.habit-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbf8f2;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.habit-item:hover {
  border-color: #d4cec2;
  transform: translateY(-1px);
}

.habit-item.done {
  border-color: rgba(74, 155, 121, 0.22);
  background: #f1f8f3;
}

.habit-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: #eae5db;
  font-family: "STSong", "SimSun", serif;
  font-size: 13px;
  font-weight: 700;
}

.habit-item.done .habit-icon {
  background: var(--green);
  color: #fff;
}

.habit-item strong,
.habit-item span {
  display: block;
}

.habit-item strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.habit-item span {
  color: #8a938f;
  font-size: 10px;
}

.habit-check {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid !important;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #d4cec2;
  border-radius: 50%;
  color: transparent;
  font-size: 9px;
}

.habit-item.done .habit-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.timeline-card {
  grid-column: span 5;
  padding: 24px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 3px;
  border-bottom: 1px solid #eee9df;
}

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

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.timeline-copy {
  min-width: 0;
}

.timeline-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-copy span {
  color: #8a938f;
  font-size: 10px;
}

.timeline-value {
  color: #68736f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.review-card {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 0.75fr 2fr;
  gap: 30px;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(255, 252, 246, 0.92), rgba(249, 245, 235, 0.94)),
    var(--surface-solid);
}

.review-intro {
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.review-intro blockquote {
  margin: 28px 0 0;
  color: #4e5d57;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.5;
}

.review-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.review-field label {
  display: block;
  margin: 0 0 8px 2px;
  color: #5f6b66;
  font-size: 11px;
  font-weight: 700;
}

.review-field textarea {
  width: 100%;
  min-height: 120px;
  padding: 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
}

.saved-indicator {
  min-height: 14px;
  margin-top: 8px;
  color: var(--green);
  font-size: 9px;
  text-align: right;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(225, 219, 207, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
}

.segment-control {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  border-radius: 999px;
  background: #ebe7de;
}

.segment-button {
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6f7a75;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.segment-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(30, 44, 39, 0.09);
}

.toolbar-note {
  color: #89928e;
  font-size: 10px;
}

.stats-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
}

.stats-donut-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) 1fr;
  gap: 22px;
  align-items: center;
  padding: 30px;
  background: var(--deep);
  color: #fff;
}

.stats-donut-panel .section-title {
  color: #fff;
}

.stats-donut-panel .section-kicker {
  color: rgba(235, 244, 239, 0.58);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.summary-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
  padding: 22px;
  background: var(--surface-solid);
}

.summary-cell strong {
  margin: 8px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.summary-cell span {
  color: var(--muted);
  font-size: 10px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
}

.chart-card {
  padding: 25px;
}

.bar-chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 210px;
  padding-top: 16px;
  border-bottom: 1px solid var(--line);
}

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

.bar-value {
  color: #89928e;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.bar {
  width: min(30px, 66%);
  min-height: 4px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #6ba98c, #3f8a6b);
  transition: height 400ms ease;
}

.bar-label {
  margin-top: -1px;
  color: #929b97;
  font-size: 8px;
  white-space: nowrap;
}

.comparison-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.comparison-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee9df;
}

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

.comparison-row span {
  font-size: 10px;
}

.change {
  font-size: 9px;
  font-weight: 700;
}

.change.up {
  color: var(--green);
}

.change.down {
  color: #c36b5e;
}

.heatmap-card {
  padding: 25px;
}

.heatmap-wrap {
  display: block;
}

.heat-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  color: #929b97;
  font-size: 8px;
  text-align: center;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  height: 210px;
}

.heat-cell {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(225, 219, 207, 0.7);
  border-radius: 7px;
  background: #f3efe7;
}

.heat-cell.level-1 {
  background: #dbece2;
}

.heat-cell.level-2 {
  background: #add3bd;
}

.heat-cell.level-3 {
  background: #70ad8b;
}

.heat-cell.level-4 {
  background: #387c60;
}

.heatmap-legend {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  align-items: center;
  margin-top: 11px;
  color: #929b97;
  font-size: 8px;
}

.heatmap-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.record-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #69756f;
  font-size: 10px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--deep);
  background: var(--deep);
  color: #fff;
}

.filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.records-card {
  padding: 1px 23px 14px;
}

.records-head {
  display: grid;
  grid-template-columns: 100px 92px minmax(0, 1fr) 100px 110px 35px;
  gap: 13px;
  padding: 17px 4px 12px;
  border-bottom: 1px solid var(--line);
  color: #8b948f;
  font-size: 9px;
  font-weight: 700;
}

.record-row {
  display: grid;
  grid-template-columns: 100px 92px minmax(0, 1fr) 100px 110px 35px;
  gap: 13px;
  align-items: center;
  min-height: 60px;
  padding: 11px 4px;
  border-bottom: 1px solid #eee9df;
}

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

.record-date {
  color: #7e8984;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3efe7;
  color: #58645f;
  font-size: 9px;
  white-space: nowrap;
}

.record-main {
  min-width: 0;
}

.record-main strong,
.record-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-main strong {
  margin-bottom: 4px;
  font-size: 11px;
}

.record-main span {
  color: #8a938f;
  font-size: 10px;
}

.record-value {
  color: #5d6964;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.delete-record {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9ba29f;
  font-size: 15px;
  cursor: pointer;
}

.delete-record:hover {
  background: #fff1ee;
  color: #bc5f5b;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 30px;
  color: #8b948f;
  font-size: 10px;
  text-align: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.settings-card {
  padding: 26px;
}

.data-settings-card {
  grid-column: 1 / -1;
}

.account-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #faf7f0;
}

.account-banner.connected {
  border-color: rgba(74, 155, 121, 0.22);
  background: #f1f8f3;
}

.account-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--deep);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.account-banner strong,
.account-banner span {
  display: block;
}

.account-banner strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.account-banner span:not(.account-avatar) {
  color: var(--muted);
  font-size: 9px;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.target-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 115px auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #eee9df;
}

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

.target-row label {
  font-size: 11px;
  font-weight: 650;
}

.target-row input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf8f2;
  color: var(--ink);
  font-size: 11px;
  text-align: right;
}

.target-unit {
  color: #8b948f;
  font-size: 9px;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.feature-note {
  padding: 17px;
  border: 1px solid #e8e2d7;
  border-radius: 16px;
  background: #faf7f0;
}

.feature-note + .feature-note {
  margin-top: 10px;
}

.feature-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
}

.feature-note p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.storage-meter {
  margin: 18px 0 3px;
}

.storage-meter-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #7e8984;
  font-size: 9px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 32, 29, 0.42);
  backdrop-filter: blur(8px);
  animation: fade-in 160ms ease;
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 25px;
  background: #fffdf9;
  box-shadow: 0 30px 90px rgba(20, 37, 32, 0.25);
  animation: rise-in 180ms ease;
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(12px);
}

.modal-head h2 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 23px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #68736f;
  font-size: 18px;
  cursor: pointer;
}

.modal-form {
  padding: 22px 24px 25px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin: 0 0 7px 2px;
  color: #5f6b66;
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf8f2;
  color: var(--ink);
  font-size: 11px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.6;
}

.field-hint {
  margin: 7px 1px 0;
  color: #919995;
  font-size: 8px;
  line-height: 1.55;
}

.form-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(193, 91, 90, 0.22);
  border-radius: 11px;
  background: #fff5f2;
  color: #aa4c49;
  font-size: 10px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 24px;
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(20, 40, 36, 0.94);
  color: #fff;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: 180ms ease;
}

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

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes status-pulse {
  0%,
  100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .workspace {
    padding-inline: 24px;
  }

  .hero-card {
    grid-column: span 12;
  }

  .goal-card {
    grid-column: span 5;
  }

  .habit-card {
    grid-column: span 7;
  }

  .timeline-card {
    grid-column: span 12;
  }

  .stat-card {
    grid-column: span 3;
  }

  .goal-layout {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .goal-ring {
    width: 130px;
    height: 130px;
  }

  .record-row,
  .records-head {
    grid-template-columns: 82px 82px minmax(0, 1fr) 80px 90px 30px;
    gap: 9px;
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 20px 20px 110px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 14px;
    bottom: 13px;
    left: 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    background: rgba(250, 248, 242, 0.9);
    box-shadow: 0 16px 45px rgba(22, 43, 37, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-button {
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    padding: 7px 5px;
    font-size: 9px;
  }

  .mobile-nav .nav-icon {
    width: 28px;
    height: 28px;
  }

  .toast {
    bottom: 90px;
  }

  .goal-card {
    grid-column: span 12;
  }

  .habit-card {
    grid-column: span 12;
  }

  .stat-card {
    grid-column: span 6;
  }

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-intro {
    padding: 0 0 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .review-intro blockquote {
    margin-top: 12px;
  }

  .stats-hero,
  .chart-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .data-settings-card {
    grid-column: auto;
  }

  .records-head {
    display: none;
  }

  .records-card {
    padding: 0 17px 12px;
  }

  .record-row {
    grid-template-columns: 82px minmax(0, 1fr) 75px 28px;
    gap: 9px;
    padding: 14px 1px;
  }

  .record-row .category-tag {
    display: none;
  }

  .record-row .record-main {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
  }

  .record-date {
    align-self: start;
    padding-top: 2px;
  }

  .record-value {
    grid-column: 3;
    grid-row: 1 / 3;
    text-align: right;
  }

  .delete-record {
    grid-column: 4;
    grid-row: 1 / 3;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 17px 14px 105px;
  }

  .topbar {
    align-items: flex-end;
    margin-bottom: 17px;
  }

  .topbar-actions .date-pill {
    display: none;
  }

  .sync-button {
    padding-inline: 10px;
  }

  .sync-button span {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions .primary-button {
    min-width: 42px;
    padding: 10px 13px;
    font-size: 0;
  }

  .topbar-actions .primary-button span {
    font-size: 16px;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .hero-card,
  .goal-card,
  .habit-card,
  .timeline-card,
  .review-card,
  .stat-card {
    grid-column: span 12;
  }

  .hero-card {
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: 0;
    padding: 23px;
  }

  .donut {
    width: 196px;
    min-width: 196px;
  }

  .legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .legend-row {
    gap: 7px;
    padding-inline: 8px;
  }

  .goal-layout {
    grid-template-columns: 125px minmax(0, 1fr);
    gap: 14px;
  }

  .goal-ring {
    width: 120px;
    height: 120px;
  }

  .goal-list {
    gap: 7px;
  }

  .goal-row {
    grid-template-columns: 7px 52px minmax(34px, 1fr) 31px;
    gap: 6px;
  }

  .habit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-form {
    grid-template-columns: 1fr;
  }

  .review-field textarea {
    min-height: 92px;
  }

  .page-toolbar {
    align-items: flex-start;
    padding: 10px;
  }

  .stats-donut-panel {
    grid-template-columns: 1fr;
    padding: 25px 20px;
  }

  .stats-summary {
    grid-template-columns: 1fr;
  }

  .summary-cell {
    min-height: 105px;
  }

  .bar-chart {
    gap: 4px;
    height: 170px;
  }

  .target-row {
    grid-template-columns: 9px minmax(0, 1fr) 92px auto;
    gap: 8px;
  }

  .heat-cell {
    border-radius: 3px;
  }

  .heatmap,
  .heat-weekdays {
    gap: 4px;
  }

  .heatmap {
    height: 170px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .modal {
    max-height: calc(100vh - 18px);
    border-radius: 21px;
  }

  .modal-head,
  .modal-form {
    padding-inline: 18px;
  }
}

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