:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --fg: #c9d1d9;
  --fg-muted: #8b949e;
  --accent: #58a6ff;
  --accent-strong: #1f6feb;
  --danger: #f85149;
  --success: #3fb950;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

#header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--fg);
}

#header p {
  margin: 0 0 24px;
  color: var(--fg-muted);
  font-size: 14px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#habits-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

#habits-list li.checked {
  border-color: var(--accent);
  background: rgba(31, 111, 235, 0.12);
}

#habits-list input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

#habits-list .label {
  flex: 1;
  font-size: 17px;
  font-weight: 500;
}

#habits-list .threshold {
  color: var(--fg-muted);
  font-size: 13px;
  margin-top: 2px;
}

#actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button {
  font-family: inherit;
  font-size: 16px;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

button:active {
  opacity: 0.7;
}

button.primary {
  background: var(--accent-strong);
  color: white;
  border-color: var(--accent-strong);
  font-weight: 600;
}

button.secondary {
  background: transparent;
  color: var(--fg-muted);
}

#anchors {
  margin-top: 32px;
  color: var(--fg-muted);
}

#anchors hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-bottom: 16px;
}

.anchor-block {
  margin-bottom: 16px;
}

.anchor-block h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.anchor-block p,
.anchor-block li {
  font-size: 14px;
  color: var(--fg);
}

#week-summary li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

#week-summary li:last-child {
  border-bottom: 0;
}

#done-state, #error-state {
  text-align: center;
  margin-top: 40px;
}

.ok-mark, .err-mark {
  font-size: 48px;
  margin-bottom: 12px;
}

.ok-mark::before { content: "✓"; color: var(--success); }
.err-mark::before { content: "!"; color: var(--danger); }

#error-message {
  color: var(--fg-muted);
  margin-bottom: 20px;
}
