:root {
  color-scheme: light;
  --bg: #f4efe6;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --text: #1f2937;
  --subtle: #6b7280;
  --accent: #ff6b35;
  --accent-strong: #ea580c;
  --line: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 45%),
    linear-gradient(180deg, #fff7ed 0%, var(--bg) 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
}

.view-active {
  display: block;
}

.glass-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.welcome-view {
  display: grid;
  place-items: center;
}

.welcome-card {
  width: min(100%, 540px);
  padding: 32px 24px;
  border-radius: 32px;
  text-align: center;
}

.brand-text {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-weight: 700;
}

.welcome-card h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  line-height: 1.15;
}

.welcome-message,
.hero-subtitle,
.modal-hint {
  color: var(--subtle);
  line-height: 1.7;
}

.welcome-message {
  margin: 18px 0 8px;
  font-size: 1.08rem;
}

.hero-subtitle {
  margin: 0 0 24px;
}

.task-view {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.top-bar,
.side-header,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-bar-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.top-bar-center p,
.side-header h2,
.comment-board-title {
  margin: 0;
}

.icon-button,
.ghost-button,
.secondary-button,
.feedback-chip,
.rating-button,
.tab-button {
  border: 1px solid rgba(255, 107, 53, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
}

.icon-button,
.ghost-button,
.secondary-button,
.tab-button {
  padding: 10px 14px;
}

.primary-button {
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.26);
  cursor: pointer;
}

.pending-feedback {
  border-radius: 22px;
  padding: 14px 16px;
}

.pending-feedback p {
  margin: 0 0 10px;
  line-height: 1.7;
}

.pending-feedback-title {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 1rem;
}

.feedback-grid,
.rating-buttons,
.auth-tabs {
  display: grid;
  gap: 10px;
}

.feedback-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feedback-chip,
.rating-button {
  padding: 12px 14px;
  font-weight: 600;
}

.task-stage {
  min-height: 0;
  display: grid;
  place-items: center;
}

.task-card {
  width: min(100%, 480px);
  height: min(100%, 72vh);
  border-radius: 30px;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  transform: translateX(0) translateY(0);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.task-card.anim-next {
  transform: translateY(-14px);
  opacity: 0.85;
}

.task-card.anim-prev {
  transform: translateY(14px);
  opacity: 0.85;
}

.task-card.anim-left {
  transform: translateX(-18px);
}

.task-card.anim-right {
  transform: translateX(18px);
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.star-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.progress-text {
  color: var(--subtle);
  font-size: 0.92rem;
}

.task-card-body {
  display: grid;
  align-content: center;
  gap: 16px;
}

.task-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.25;
}

.task-description,
.task-duration,
.hint {
  margin: 0;
  text-align: center;
  color: var(--subtle);
  line-height: 1.7;
}

.task-duration {
  font-weight: 700;
}

.button-group {
  display: grid;
  gap: 12px;
}

.side-view {
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.side-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}

.profile-card,
.timeline-card,
.comments-card {
  border-radius: 24px;
  padding: 18px;
}

.profile-card h3,
.timeline-card h3,
.comments-card h3 {
  margin: 0 0 12px;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.radar-item,
.timeline-item,
.comment-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.radar-item {
  padding: 12px;
}

.radar-label,
.radar-value,
.timeline-time,
.comment-meta {
  display: block;
}

.radar-label,
.timeline-time,
.comment-meta {
  color: var(--subtle);
  font-size: 0.9rem;
}

.radar-value {
  margin-top: 6px;
  font-weight: 700;
  font-size: 1.1rem;
}

.timeline-list,
.comments-list {
  display: grid;
  gap: 12px;
}

.timeline-group {
  display: grid;
  gap: 10px;
}

.timeline-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 107, 53, 0.08);
  color: var(--accent-strong);
  font-weight: 600;
}

.timeline-group-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--accent-strong);
}

.timeline-item,
.comment-item {
  padding: 14px;
}

.timeline-title,
.comment-content {
  margin: 6px 0 0;
  line-height: 1.6;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.comment-form textarea,
.auth-form textarea,
.auth-form input {
  width: 100%;
  border: 1px solid rgba(107, 114, 128, 0.24);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.comment-form textarea,
.auth-form textarea {
  min-height: 100px;
  resize: vertical;
}

.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.comment-action {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.comment-action.is-active {
  border-color: rgba(234, 88, 12, 0.32);
  background: rgba(255, 107, 53, 0.08);
  color: var(--accent-strong);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
}

.modal-card {
  position: relative;
  width: min(100vw - 24px, 520px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 28px;
  padding: 22px;
}

.auth-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0 14px;
}

.tab-button-active {
  background: rgba(255, 107, 53, 0.12);
  color: var(--accent-strong);
  border-color: rgba(255, 107, 53, 0.26);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--subtle);
}

.floating-logout {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  color: #fff;
  background: rgba(31, 41, 55, 0.9);
  cursor: pointer;
}

.celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.celebration-burst {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.95) 0%, rgba(255, 107, 53, 0.05) 72%);
  animation: celebrate-burst 0.7s ease-out forwards;
}

@keyframes celebrate-burst {
  from {
    transform: scale(0.5);
    opacity: 0.85;
  }
  to {
    transform: scale(12);
    opacity: 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.92);
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .view {
    padding: 24px 24px 30px;
  }

  .task-card {
    height: min(100%, 68vh);
  }

  .side-body {
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: start;
  }

  .comments-card {
    max-width: 760px;
  }
}
