:root {
  --bg: #0b1f3b;
  --bg-soft: #102a52;
  --card: #132c55;
  --card-soft: #0f2748;
  --text: #e8eefc;
  --muted: #9db0d0;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ff8a34;
  --accent-2: #3dd6c6;
  --danger: #ff5c6c;
  --ok: #5ad18b;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #1c4b8f 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 31, 59, 0.86);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted);
}

.pill--muted {
  opacity: 0.85;
}

.pill--wait {
  color: #ffd28a;
  background: rgba(255, 138, 52, 0.12);
}

.pill--ok {
  color: #b8ffd5;
  background: rgba(90, 209, 139, 0.12);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card--hero {
  border: none;
  background: linear-gradient(135deg, rgba(61, 214, 198, 0.15), rgba(255, 138, 52, 0.12));
}

.card--soft {
  background: var(--card-soft);
}

.card--inner {
  margin: 0;
  box-shadow: none;
  border: 1px solid var(--line);
}

.banner-tip__text {
  margin: 0 0 8px;
  line-height: 1.5;
}

.progress-caption {
  margin: 0 0 6px;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  min-width: 0;
  transition: width 0.25s ease;
}

.err-detail {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  color: #ffb4bc;
}

.hero__title {
  margin: 0 0 8px;
  font-size: 22px;
}

.hero__sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.hero-metric__avatar {
  flex-shrink: 0;
}

.hero-metric__avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.avatar-row {
  margin: 0 0 12px;
}

.avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.hero-metric__value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.hero-metric__value--sm {
  font-size: 24px;
  color: var(--text);
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section__title {
  margin: 0 0 8px;
  font-size: 16px;
}

.muted,
.form__meta {
  color: var(--muted);
  font-size: 13px;
}

.link {
  color: var(--accent-2);
}

.form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field__label {
  font-size: 13px;
  color: var(--muted);
}

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 12px 12px;
  font-size: 15px;
  outline: none;
}

.input:focus {
  border-color: rgba(61, 214, 198, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.12);
}

.input--area {
  min-height: 96px;
  resize: vertical;
}

.input--inline {
  flex: 1;
  min-width: 0;
}

.input--tiny {
  width: 72px;
  padding: 8px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.btn--primary {
  background: linear-gradient(135deg, #ff8a34, #ff6a1a);
  color: #1a0b06;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
}

.btn--block {
  width: 100%;
}

.btn--small {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
}

.flash {
  margin: 8px 16px 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.flash--ok {
  color: var(--ok);
}

.flash--bad {
  color: var(--danger);
}

.grid {
  display: grid;
  gap: 10px;
}

.grid--2 {
  grid-template-columns: 1fr 1fr;
}

.stat__label {
  color: var(--muted);
  font-size: 13px;
}

.stat__value {
  font-size: 26px;
  font-weight: 700;
}

.stat__value--accent {
  color: var(--accent);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.list-item:first-of-type {
  border-top: none;
}

.list-item--stack {
  flex-direction: column;
  align-items: stretch;
}

.list-item__title {
  font-weight: 600;
}

.list-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shortcut {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 10px;
  align-items: center;
}

.shortcut__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 138, 52, 0.15);
  color: var(--accent);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(11, 31, 59, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.theme-child .tabbar {
  grid-template-columns: repeat(4, 1fr);
}

.tabbar__item {
  text-align: center;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 10px;
}

.tabbar__item.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.task-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.task-row:first-of-type {
  border-top: none;
}

.task-row__title {
  font-weight: 600;
}

.task-row__side {
  display: flex;
  align-items: center;
}

.hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.hint--bad {
  color: #ffc7cd;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.row-compact {
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.text-pos {
  color: var(--ok);
  font-weight: 600;
}

.text-neg {
  color: var(--danger);
  font-weight: 600;
}

.menu-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.chev {
  color: var(--muted);
}

.footnote {
  padding: 0 16px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent-2);
  font-size: 12px;
}

.clock-card__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.clock-card__title {
  margin: 0 0 6px;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.medal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.medal {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.medal__glyph {
  font-size: 22px;
  color: var(--accent);
}

.medal__name {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.cal-cell {
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}

.cal-cell.is-on {
  background: linear-gradient(180deg, #2f6fbf, #1b4f96);
  color: #fff;
}

.bars-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.bars {
  display: grid;
  gap: 6px;
  align-items: end;
  height: 140px;
  min-width: 100%;
}

.bar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}

.bar__fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent-2), rgba(61, 214, 198, 0.2));
  min-height: 4px;
}

.bar__label {
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.segmented a {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.segmented a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.impersonate-bar {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 138, 52, 0.35);
  background: rgba(255, 138, 52, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pre-wrap {
  white-space: pre-wrap;
  line-height: 1.5;
}

.form__section {
  margin: 8px 0;
  font-size: 14px;
  color: var(--muted);
}
