:root {
  --text: #0f172a;
  --muted: #475569;
  --line: #e5dcc2;
  --panel: #ffffffcc;
  --brand: #2162b7;
  --brand-2: #1d4f90;
  --ok: #16a34a;
  --gold: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 380px at 90% -8%, #fff6da 0%, transparent 62%),
    radial-gradient(900px 400px at 0% -12%, #f8efd9 0%, transparent 66%),
    repeating-linear-gradient(0deg, #f4eed4 0 28px, #f3ecd1 28px 29px),
    linear-gradient(180deg, #f4eed4 0%, #f2ebd0 100%);
  font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.sakura-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.petal {
  position: absolute;
  top: -8vh;
  width: 12px;
  height: 9px;
  border-radius: 10px 2px 10px 2px;
  background: linear-gradient(135deg, #ffd9e7, #ffb9d2);
  box-shadow: 0 0 10px #ffd6e66e;
  opacity: 0.8;
  animation-name: fall, sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
  transform-origin: center;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid #e7ddbf;
  backdrop-filter: blur(14px);
  background: #f6efd8e0;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--brand-2);
  margin-right: 12px;
}

.nav a {
  color: #1e293b;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav a.active,
.nav a:hover {
  border-color: #d7ccac;
  background: #ffffff;
  color: #0f172a;
}

.nav-spacer {
  margin-left: auto;
}

.console-link {
  border-color: #ddcaa0 !important;
  background: linear-gradient(135deg, #f9efcf, #f6e8bf) !important;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 20px 64px;
  animation: rise 0.45s ease;
  position: relative;
  z-index: 2;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #eadfbf;
  border-radius: 20px;
  padding: 30px;
  background: linear-gradient(145deg, #fffdf5f2, #fff8e8ee);
  box-shadow: 0 10px 28px #6b5f4421;
}

.hero-visual {
  height: 170px;
  margin: -8px -8px 14px;
  border-radius: 16px;
  border: 1px solid #e2d2a8;
  background:
    radial-gradient(120px 80px at 18% 22%, #ffffffcc, #ffffff00 70%),
    linear-gradient(120deg, #f7d58a, #f0b97a 38%, #d8a6ff 72%, #92b7ff);
  box-shadow: inset 0 0 60px #ffffff5d;
  animation: heroPulse 6s ease-in-out infinite;
}

h1, h2, h3 { margin-top: 0; }

h1 {
  font-size: clamp(1.7rem, 2.2vw, 2.4rem);
  letter-spacing: -0.03em;
}

#typing-title {
  min-height: 1.3em;
  position: relative;
  width: fit-content;
  padding-right: 10px;
}

#typing-title::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10%;
  width: 2px;
  height: 80%;
  background: #2563eb;
  animation: caretBlink 0.8s steps(1, end) infinite;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 18px;
}

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px #64583c17;
}

.muted { color: var(--muted); }

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1;
  min-width: 220px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid #e4d7b5;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}

input[type="text"]:focus {
  border-color: #d8b77b;
  box-shadow: 0 0 0 4px #f8ebcc;
}

button {
  border: 1px solid #be9557;
  background: linear-gradient(135deg, #d69e4d, #bb7f31);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

button.ghost {
  border-color: #dfd3b2;
  background: #fff9ec;
  color: #1e293b;
}

.todo-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid #e8dec4;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.todo-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.todo-done {
  text-decoration: line-through;
  color: #64748b;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #e8dec4;
  color: #475569;
  background: #fff9ec;
}

.achv {
  position: relative;
  overflow: hidden;
}

.achv::after {
  content: "";
  position: absolute;
  inset: auto -32% -45% auto;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: #e7c48e4a;
}

.achv.locked {
  filter: grayscale(0.5);
  opacity: 0.75;
}

.achv .title {
  font-weight: 700;
}

.achv.unlocked {
  border-color: #fdba74;
  box-shadow: inset 0 0 0 1px #fdba74a1, 0 0 0 0 #f59e0b66;
  animation: trophyGlow 2s ease-in-out infinite;
}

.footer-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.auth-box {
  max-width: 720px;
}

.music-disc {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid #ead8b2;
  background:
    radial-gradient(circle at 50% 50%, #efe2c7 0 7px, #4a3d2a 7px 11px, transparent 11px),
    repeating-radial-gradient(circle at 50% 50%, #2f2b27 0 2px, #1f1c18 2px 4px, #24211d 4px 6px);
  box-shadow: 0 8px 20px #4e432b4a;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.2s ease;
}

.music-disc:hover {
  transform: scale(1.05);
}

.music-disc.is-playing {
  animation: discSpin 2.6s linear infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes heroPulse {
  0%, 100% { transform: scale(1); filter: saturate(1); }
  50% { transform: scale(1.015); filter: saturate(1.15); }
}

@keyframes trophyGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px #fdba74a1, 0 0 0 0 #f59e0b22; }
  50% { box-shadow: inset 0 0 0 1px #fdba74a1, 0 0 28px 3px #f59e0b66; }
}

@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.85; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.15; }
}

@keyframes sway {
  0%, 100% { margin-left: 0; }
  25% { margin-left: 12px; }
  50% { margin-left: -10px; }
  75% { margin-left: 14px; }
}

@keyframes discSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
