:root {
  --brand: #f05a1a;
  --brand-dark: #c83f09;
  --brand-soft: #fff1e8;
  --brand-line: #ffd2bd;
  --ink: #1d1d1f;
  --muted: #86868b;
  --line: #d2d2d7;
  --surface: #ffffff;
  --page: #f5f5f7;
  --success: #198754;
  --danger: #b42318;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* 苹果风格毛玻璃悬浮提示框 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  font-weight: 700;
  font-size: 16px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.panel {
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}

.hero {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

/* 标题+右侧极小logo布局，强制不换行 */
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.14;
  font-weight: 700;
  flex-shrink: 1;
}

/* 标题右侧极小logo，缩到最小12px */
.hero-logo {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.date-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
}

.checked-tag {
  background: var(--success);
  color: white;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}

.deadline-row {
  margin-top: 8px;
  border-color: var(--line);
  background: var(--page);
  color: var(--muted);
}

.content {
  padding: 20px;
}

.field {
  margin: 0 0 20px;
}

.label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select {
  min-height: 48px;
  padding: 0 16px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

textarea {
  min-height: 80px;
  padding: 12px 16px;
  line-height: 1.5;
  resize: vertical;
}

select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(240, 90, 26, 0.1);
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.check-card:hover {
  border-color: var(--brand-line);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.check-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-ui {
  display: grid;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: #fff;
  background: #fff;
  transition: all 0.2s ease;
}

.checkbox-ui svg {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.check-card input:checked + .checkbox-ui {
  border-color: var(--brand);
  background: var(--brand);
}

.check-card input:checked + .checkbox-ui svg {
  opacity: 1;
}

.check-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* 练习内容布局，标题和描述各占一行 */
.check-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.check-desc {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.actions {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(240, 90, 26, 0.24);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  background: var(--brand-dark);
  box-shadow: 0 6px 20px rgba(200, 63, 9, 0.28);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.message {
  display: none;
  min-height: 48px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.message.show {
  display: flex;
}

.message.success {
  border: 1px solid rgba(25, 135, 84, 0.24);
  background: #ecf8f1;
  color: var(--success);
}

.message.error {
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: #fff0ee;
  color: var(--danger);
}

.footer-note {
  margin: 24px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 360px) {
  .app-shell {
    padding: 16px 12px 24px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .content {
    padding: 16px;
  }
}

/* 周报页面专属样式 */
.weekly-panel {
  padding: 20px;
}

.weekly-range {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.star-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--brand-line);
  border-radius: 16px;
  background: var(--brand-soft);
  text-align: center;
  margin-bottom: 20px;
}

.star-label {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 700;
}

.star-name {
  color: var(--brand);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.star-detail {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.weekly-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.weekly-list {
  display: grid;
  gap: 10px;
}

.weekly-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: transform 0.2s ease;
}

.weekly-row:hover {
  transform: translateX(4px);
  border-color: var(--brand-line);
}

.weekly-row strong {
  font-size: 15px;
  font-weight: 600;
}

.weekly-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.weekly-count {
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--page);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
