:root {
  --primary: #3d5a80;
  --primary-dark: #2f4761;
  --bg-start: #f6f4ef;
  --bg-end: #e9eef4;
  --radius: 12px;
  --radius-sm: 10px;
  --text: #2b2f36;
  --text-muted: #667085;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Header / nav */
header.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 10px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  margin-right: 16px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-links a:last-child {
  margin-right: 0;
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-btn {
  border: 1px solid #d5dbe3;
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
}

.lang-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Card */
.card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: 0 6px 24px rgba(61, 90, 128, 0.1);
  margin-top: 12px;
}

h1 {
  font-size: 1.55rem;
  margin: 0 0 8px;
  color: #1f2d3d;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 8px;
  color: #1f2d3d;
}

.subtitle {
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 22px;
}

textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #d8dee5;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  background: #fbfbfa;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.15);
  background: #fff;
}

button {
  font-family: inherit;
}

button.primary {
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

button.primary:hover:not(:disabled) {
  opacity: 0.92;
}

button.primary:active:not(:disabled) {
  transform: translateY(1px);
}

button.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

a.secondary,
button.secondary {
  display: inline-block;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}

.warning-text {
  color: #c0392b;
  font-size: 0.88rem;
  margin-top: 10px;
  display: none;
}

.warning-text.show {
  display: block;
}

/* Loading dots */
.loading-row {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-row.show {
  display: flex;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d8dee5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Progress bar */
.progress-bar-track {
  height: 8px;
  background: #e5e9ee;
  border-radius: 6px;
  overflow: hidden;
  margin: 4px 0 22px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Steps */
.task-title {
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: #1f2d3d;
}

.step-list {
  margin-top: 18px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #f8f9fb;
  margin-bottom: 10px;
  transition: background 0.2s ease;
}

.step-item.done {
  background: #eaf3ec;
}

.step-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.step-main {
  flex: 1;
}

.step-text {
  line-height: 1.5;
  color: var(--text);
}

.step-text.done {
  text-decoration: line-through;
  color: #94a0ad;
}

.step-points {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  align-self: center;
}

/* Congrats */
.congrats {
  text-align: center;
  padding: 20px 4px 6px;
}

.congrats-emoji {
  font-size: 2.6rem;
  margin-bottom: 6px;
}

.congrats h2 {
  color: var(--primary);
}

.congrats p {
  color: var(--text-muted);
  margin-bottom: 22px;
}

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.actions-row.center {
  justify-content: center;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}

.stat-box {
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  padding: 22px 14px;
  text-align: center;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 6px;
}

/* Task list on points page */
.section-label {
  font-size: 1rem;
  font-weight: 600;
  margin: 30px 0 12px;
  color: #1f2d3d;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: #f8f9fb;
  text-decoration: none;
  color: inherit;
}

.task-list-item:hover {
  background: #f0f2f5;
}

.task-list-title {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: #dfe7ee;
  color: var(--primary);
}

.badge.completed {
  background: #dff0e3;
  color: #2f7a43;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0 4px;
  line-height: 1.6;
}

footer.note {
  text-align: center;
  color: #9aa4b0;
  font-size: 0.8rem;
  margin-top: 26px;
}
