:root {
  color-scheme: light;
  --ink: #22313f;
  --muted: #6f7c87;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --line: rgba(45, 49, 66, .12);
  --green: #42b883;
  --blue: #4b8fe8;
  --pink: #f07795;
  --yellow: #ffc95c;
  --violet: #8067dc;
  font-family: ui-rounded, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

button, .button, input, textarea { font: inherit; }
button, .button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  background: var(--green);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(66, 184, 131, .18);
}
button:hover, .button:hover { transform: translateY(-1px); }
.ghost { background: #7d8b98; box-shadow: 0 8px 18px rgba(125, 139, 152, .14); }
input, textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  outline: 0;
}
input:focus, textarea:focus { border-color: rgba(75, 143, 232, .65); box-shadow: 0 0 0 4px rgba(75, 143, 232, .12); }
textarea { resize: vertical; }

.lock {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 12%, rgba(190, 226, 241, .55), transparent 28%),
    linear-gradient(180deg, #d8eef6 0%, #5ea7c8 38%, #0f4f76 72%, #083754 100%);
}
.lock::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .3), transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, .28), transparent 46%);
}
.gate {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  box-shadow: 0 24px 70px rgba(5, 38, 61, .28), inset 0 1px 0 rgba(255, 255, 255, .24);
  backdrop-filter: blur(18px);
}
.gate h1 { margin: 0; font-size: 38px; }
.gate p { margin: 0; color: rgba(255, 255, 255, .78); line-height: 1.7; }
.gate .gate-subtitle { color: rgba(255, 255, 255, .92); }
.gate input {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .86);
}
.gate button {
  background: #eef8fb;
  color: #0f4f76;
  box-shadow: 0 10px 22px rgba(5, 38, 61, .18);
}
.badge {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
  font-weight: 900;
}
.wave {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -54px;
  height: 170px;
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: 240px 100%;
  animation: wave-arrive 1.6s ease-out both, wave-drift 9s ease-in-out 1.6s infinite;
}
.wave-1 {
  opacity: .46;
  background-image: radial-gradient(90px 56px at 50% 0, transparent 58%, rgba(126, 198, 221, .78) 60%);
}
.wave-2 {
  bottom: -70px;
  opacity: .52;
  background-size: 190px 100%;
  animation-delay: .08s, 1.7s;
  background-image: radial-gradient(76px 48px at 50% 0, transparent 58%, rgba(255, 255, 255, .72) 60%);
}
.wave-3 {
  bottom: -82px;
  opacity: .4;
  background-size: 280px 100%;
  animation-delay: .14s, 1.75s;
  background-image: radial-gradient(110px 64px at 50% 0, transparent 58%, rgba(4, 55, 84, .86) 60%);
}
@keyframes wave-arrive {
  0% { transform: translate3d(0, 54px, 0); }
  50% { transform: translate3d(-12px, -8px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes wave-drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-18px, 6px, 0); }
}

.topbar {
  min-height: auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 42px clamp(18px, 6vw, 86px) 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  max-width: none;
  margin: 10px 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}
.topbar p { color: var(--muted); font-size: 19px; line-height: 1.8; }
.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2c62aa !important;
  font-weight: 900;
}
.scoreboard span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.scoreboard strong { display: block; margin-top: 3px; font-size: 28px; }

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 22px clamp(18px, 6vw, 86px) 24px;
}
.dashboard-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scoreboard article {
  min-height: 92px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(34, 49, 63, .06);
}
.scoreboard article:nth-child(1) { border-top: 6px solid var(--blue); }
.scoreboard article:nth-child(2) { border-top: 6px solid var(--green); }
.scoreboard article:nth-child(3) { border-top: 6px solid var(--yellow); }
.scoreboard article:nth-child(4) { border-top: 6px solid var(--pink); }

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px clamp(18px, 6vw, 86px);
  background: rgba(245, 247, 251, .9);
  backdrop-filter: blur(14px);
  border-block: 1px solid var(--line);
}
.tabs button {
  min-width: 86px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  white-space: nowrap;
}
.tabs .active { background: #22313f; color: #fff; box-shadow: none; }
.tab { display: none; padding: 28px clamp(18px, 6vw, 86px) 72px; }
.tab.active { display: block; }
.grid { display: grid; gap: 18px; }
.two { grid-template-columns: minmax(280px, .9fr) minmax(280px, 1.1fr); }
.main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(34, 49, 63, .06);
}
.panel h2 { margin: 0 0 16px; font-size: 24px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 2px; }
form { display: grid; gap: 13px; }
.list { display: grid; gap: 12px; }
.item {
  border: 2px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  line-height: 1.65;
}
.item.warn { border-left-color: var(--pink); background: #fff7f9; }
.item.good { border-left-color: var(--green); background: #f3fff8; }
.item strong { font-size: 17px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.lead { color: var(--ink); font-size: 18px; line-height: 1.8; }
.empty-banner {
  margin: 0 clamp(18px, 6vw, 86px) 20px;
  padding: 14px 16px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #eef4ff;
  color: #2c62aa;
}
.panel .empty-banner { margin: 0; }
.action-panel {
  border-color: rgba(66, 184, 131, .35);
  background: #f7fffb;
}
.action-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}
.action-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
}
.must-do-panel {
  border-color: rgba(240, 119, 149, .28);
  background: #fffafa;
}
.must-do-card {
  border-left: 7px solid var(--blue);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}
.must-do-card.red { border-left-color: var(--pink); }
.must-do-card.yellow { border-left-color: var(--yellow); }
.must-do-card.green { border-left-color: var(--green); }
.must-do-card p { margin: 0 0 6px; color: var(--muted); font-weight: 800; }
.must-do-card h3 { margin: 0 0 14px; font-size: clamp(22px, 3vw, 34px); }
.must-do-card span { display: block; margin-top: 6px; color: var(--muted); line-height: 1.7; }
.must-do-card h3, .must-do-card span, .goal-card p { overflow-wrap: anywhere; }
.goal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.goal-card {
  min-height: 250px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 6px solid #9aa6b2;
  border-radius: 8px;
  background: #fff;
}
.goal-card.green { border-top-color: var(--green); }
.goal-card.yellow { border-top-color: var(--yellow); }
.goal-card.red { border-top-color: var(--pink); }
.goal-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}
.goal-card h3 { margin: 0; font-size: 18px; }
.goal-card header span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2c62aa;
  font-size: 12px;
  font-weight: 900;
}
.goal-card p { margin: 8px 0; color: var(--muted); line-height: 1.55; }
.today-goal-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.today-goal-actions article {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.today-goal-actions strong { display: block; margin-bottom: 8px; font-size: 18px; }
.today-goal-actions span { color: var(--muted); line-height: 1.55; }
pre { white-space: pre-wrap; margin: 0; line-height: 1.8; }
.category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.category-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.category-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.category-card header span { color: var(--muted); font-size: 13px; }
.category-card ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink); }
.ratio {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}
.ratio span { display: block; height: 100%; min-width: 2px; }
.month-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.month-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.month-summary span { display: block; color: var(--muted); font-size: 12px; }
.month-summary strong { display: block; margin-top: 4px; font-size: 20px; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.month-list { display: grid; gap: 14px; }
.month-block summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}
.month-block .calendar { margin-top: 14px; }
.day {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.day strong { font-size: 22px; }
.day em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day.high { border-left: 6px solid var(--green); }
.day.normal { border-left: 6px solid var(--blue); }
.day.low { border-left: 6px solid var(--yellow); }
.day.uncontrolled { border-left: 6px solid var(--pink); }
.day.none { color: var(--muted); background: #f0f3f7; }
.mini-bars {
  display: flex;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe6ee;
}
.mini-bars i {
  display: block;
  height: 100%;
  min-width: 2px;
}
.mini-bars.empty i { display: none; }
.day-tip {
  position: absolute;
  z-index: 20;
  width: min(340px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(34, 49, 63, .18);
  line-height: 1.55;
}
.day-tip p { margin: 6px 0 0; color: var(--muted); }
.detail { display: grid; gap: 12px; margin-top: 16px; }
.detail section, details {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.detail h3 { margin: 14px 0 0; }
.detail section h3:first-child { margin-top: 0; }
.detail h4 { margin: 8px 0 0; color: var(--muted); }
.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-head strong { font-size: 34px; }
#dateSelect { max-width: 220px; }
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.project-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid #9aa6b2;
  border-radius: 8px;
  background: #fff;
}
.project-card.green { border-left-color: var(--green); }
.project-card.yellow { border-left-color: var(--yellow); }
.project-card.red { border-left-color: var(--pink); }
.project-card h3 { margin: 0 0 10px; }
.project-card p { margin: 8px 0; color: var(--muted); }
.week-dots { display: flex; gap: 6px; margin: 12px 0; }
.week-dots span {
  width: 22px;
  height: 8px;
  border-radius: 999px;
  background: #dfe6ee;
}
.week-dots .done { background: var(--green); }
.output {
  margin: 8px 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #eefaf4;
  color: #17603e;
  font-weight: 700;
}

@media (max-width: 880px) {
  .topbar, .two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; padding-top: 24px; }
  .topbar h1 { font-size: 48px; }
  .scoreboard, .dashboard-cards, .main-grid, .category-list, .month-summary, .projects, .goal-grid, .today-goal-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { grid-template-columns: 1fr; }
  .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .topbar h1 { font-size: 42px; }
  .scoreboard, .dashboard-cards, .main-grid, .category-list, .month-summary, .projects, .goal-grid, .today-goal-actions { grid-template-columns: 1fr; }
}
