@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=ZCOOL+QingKe+HuangYou&display=swap");

:root {
  --sky-1: #f8fbff;
  --sky-2: #eef5ff;
  --sky-3: #fff8d8;
  --blue: #3046ac;
  --blue-2: #4f67dc;
  --blue-3: #89a0ff;
  --ink: #162443;
  --ink-soft: #556587;
  --line: #d5e0ff;
  --card: rgba(255, 255, 255, 0.84);
  --ok: #28b96a;
  --lock: #9099b5;
  --r-xl: 30px;
  --r-lg: 20px;
  --r-md: 14px;
  --shadow-soft: 0 12px 28px rgba(69, 96, 211, 0.15);
  --shadow-glow: 0 0 24px rgba(125, 150, 255, 0.42);
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(137, 160, 255, 0.33), transparent 35%),
    radial-gradient(circle at 84% 10%, rgba(255, 248, 216, 0.94), transparent 38%),
    radial-gradient(circle at 80% 76%, rgba(79, 103, 220, 0.14), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, var(--sky-1) 28%, var(--sky-2) 65%, var(--sky-3) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  z-index: -1;
}

body::before {
  width: 320px;
  height: 320px;
  top: -90px;
  left: -80px;
  background: radial-gradient(circle, rgba(137, 160, 255, 0.25), transparent 72%);
}

body::after {
  width: 360px;
  height: 360px;
  top: -120px;
  right: -110px;
  background: radial-gradient(circle, rgba(255, 248, 216, 0.88), transparent 72%);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 999;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
  padding: 8px 12px;
}

/* 顶部改为横条，不再是圆角框 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0;
  padding: 10px max(12px, calc((100vw - 1240px) / 2));
  border: 0;
  border-bottom: 1px solid #dce6ff;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(69, 96, 211, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--blue);
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-weight: 400;
  font-size: 38px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.brand:hover {
  opacity: 0.88;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app {
  flex: 1 0 auto;
  width: min(1240px, calc(100% - 20px));
  margin: 26px auto 32px;
}

.site-footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  padding: 18px max(12px, calc((100vw - 1240px) / 2)) 22px;
  text-align: center;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 4px;
}

.site-footer a {
  color: var(--blue-2);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.home-layout {
  min-height: calc(82vh - 90px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
}

.angel-panel {
  display: flex;
  justify-content: center;
}

/* 左图去边框 */
.angel {
  width: min(100%, 500px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: angelFloat 4.4s ease-in-out infinite;
}

@keyframes angelFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

/* 右区去边框 */
.home-actions {
  border: 0;
  border-radius: var(--r-xl);
  padding: 28px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 248, 216, 0.82), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(244, 249, 255, 0.56));
  backdrop-filter: blur(2px);
  box-shadow: none;
}

.home-actions h1 {
  margin: 0;
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-weight: 400;
  font-size: clamp(54px, 6vw, 84px);
  line-height: 1;
  letter-spacing: 0.4px;
  color: #213b9c;
  text-shadow: 0 2px 0 #fff;
}

.home-actions p {
  margin: 12px 0 20px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.72;
}

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

.btn-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3vw, 36px);
  color: #223c9f;
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-weight: 400;
}

h3 {
  margin: 0 0 10px;
  color: var(--blue);
}

.card {
  margin-bottom: 14px;
  border-radius: var(--r-lg);
  border: 1px solid #d8e3ff;
  background: var(--card);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

/* 更炫酷按钮动效：发光 + 扫光 */
button {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #5d77ef, #3046ac);
  box-shadow: 0 8px 18px rgba(56, 82, 198, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

button::before {
  content: "";
  position: absolute;
  top: -130%;
  left: -26%;
  width: 36%;
  height: 360%;
  transform: rotate(22deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transition: left 0.5s ease;
}

button:hover {
  transform: translateY(-3px) scale(1.01);
  filter: brightness(1.03);
  box-shadow: 0 10px 22px rgba(56, 82, 198, 0.34), 0 0 18px rgba(127, 150, 255, 0.45);
}

button:hover::before {
  left: 116%;
}

button:active {
  transform: translateY(-1px) scale(0.985);
}

button.ghost {
  background: linear-gradient(180deg, #ffffff, #f1f6ff);
  color: #2d3f80;
  border-color: #cddaff;
  box-shadow: none;
}

.top-actions .ghost,
#headerAuthBtn {
  border-radius: 999px;
  min-height: 36px;
}

textarea,
input,
select {
  border: 1px solid #ccd9ff;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  font-family: inherit;
}

textarea {
  width: 100%;
  min-height: 96px;
}

label {
  color: #364a7a;
  font-weight: 700;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #9db3ff;
  outline-offset: 1px;
}

.level-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.level-card {
  border-radius: 16px;
  border: 1px solid #d3deff;
  background: #fff;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(63, 87, 196, 0.12);
}

.status-solved {
  border-left: 4px solid var(--ok);
}

.status-unlocked {
  border-left: 4px solid var(--blue-2);
}

.status-locked {
  border-left: 4px solid var(--lock);
  background: #f8faff;
}

.status-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip.solved {
  color: #1a904b;
  background: #e9faef;
}

.status-chip.unlocked {
  color: #2d45ab;
  background: #ebf0ff;
}

.status-chip.locked {
  color: #6e7996;
  background: #eef1f7;
}

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

.dict-item,
.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #d5e0ff;
  border-radius: var(--r-md);
  background: #fff;
  padding: 12px;
}

.item-main {
  display: grid;
  gap: 2px;
}

.field-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.note-input {
  width: min(380px, 100%);
}

.line-row,
.sortable li,
.module-item {
  border: 1px solid #d5e0ff;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.line-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.sortable {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sortable li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: linear-gradient(180deg, #f8faff, #eaf0ff);
  color: #2e43a1;
  border-color: #ccd9ff;
}

.output-bar {
  min-height: 62px;
  border: 1px dashed #c6d4ff;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.char-canvas {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid #c7d5ff;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
}

.module-item {
  cursor: grab;
}

.module-item.dragging {
  opacity: 0.5;
}

.module-item textarea,
.module-item input {
  width: 100%;
  margin-top: 8px;
}

.small {
  font-size: 12px;
  color: #6a7693;
}

.result {
  margin-top: 10px;
  color: var(--blue);
  font-weight: 800;
}

.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.hidden {
  display: none;
}

@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .btn-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 8px 10px;
  }
  .brand {
    font-size: 28px;
  }
  .top-actions .ghost:nth-child(-n + 3) {
    display: none;
  }
  .app {
    width: calc(100% - 12px);
    margin-top: 12px;
  }
  .angel-panel {
    display: none;
  }
  .home-actions {
    padding: 16px;
  }
  .home-actions h1 {
    font-size: clamp(42px, 12vw, 56px);
  }
  .btn-grid,
  .btn-grid.compact {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .dict-item,
  .admin-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .note-input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 临时隐藏登录入口（恢复时删除本段） */
#headerAuthBtn,
#loginBtn {
  display: none !important;
}
