/* ===== 主题变量 ===== */
:root {
  --bg: #fff0f6;
  --bg-2: #ffe3f0;
  --card: #ffffff;
  --text: #4a2b3a;
  --text-dim: #9a7488;
  --accent: #ff7eb3;
  --accent-2: #ffb3d1;
  --accent-text: #ffffff;
  --border: #ffd0e2;
  --shadow: rgba(255, 126, 179, 0.25);
}

/* ===== 预设主题 ===== */
[data-theme="hachimi"] {
  --bg: #fff0f6; --bg-2: #ffe3f0; --card: #ffffff;
  --text: #4a2b3a; --text-dim: #9a7488;
  --accent: #ff7eb3; --accent-2: #ffb3d1; --accent-text: #fff;
  --border: #ffd0e2; --shadow: rgba(255,126,179,.25);
}
[data-theme="cream"] {
  --bg: #fffbea; --bg-2: #fff1c9; --card: #ffffff;
  --text: #5c4a1f; --text-dim: #a8945e;
  --accent: #f6b93b; --accent-2: #ffd98a; --accent-text: #5c4a1f;
  --border: #ffe7ad; --shadow: rgba(246,185,59,.25);
}
[data-theme="mint"] {
  --bg: #effff8; --bg-2: #d9f7ea; --card: #ffffff;
  --text: #1f4a3a; --text-dim: #6ea392;
  --accent: #2ecc9a; --accent-2: #a3e8cf; --accent-text: #fff;
  --border: #bdeeda; --shadow: rgba(46,204,154,.25);
}
[data-theme="sea"] {
  --bg: #eff6ff; --bg-2: #dcebff; --card: #ffffff;
  --text: #21365c; --text-dim: #6f87b0;
  --accent: #4a9eff; --accent-2: #a8cdff; --accent-text: #fff;
  --border: #bcd9ff; --shadow: rgba(74,158,255,.25);
}
[data-theme="lavender"] {
  --bg: #f7f2ff; --bg-2: #ebe0ff; --card: #ffffff;
  --text: #3a2b5c; --text-dim: #8a7aa8;
  --accent: #9b6dff; --accent-2: #c9aaff; --accent-text: #fff;
  --border: #ddc9ff; --shadow: rgba(155,109,255,.25);
}
[data-theme="night"] {
  --bg: #1a1c22; --bg-2: #23262e; --card: #2a2e38;
  --text: #e8e6f0; --text-dim: #8f8ca3;
  --accent: #a29bfe; --accent-2: #6c5ce7; --accent-text: #fff;
  --border: #3d4150; --shadow: rgba(0,0,0,.45);
}

/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
  transition: background .35s, color .35s;
  overflow-x: hidden;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 18px 60px;
  position: relative;
  z-index: 1;
}

/* ===== 背景漂浮猫猫 ===== */
.bg-cats {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-cats span {
  position: absolute;
  font-size: 28px;
  opacity: .14;
  animation: floaty linear infinite;
}
@keyframes floaty {
  0%   { transform: translateY(105vh) rotate(0deg); }
  100% { transform: translateY(-15vh) rotate(360deg); }
}

/* ===== 头部 ===== */
.hero { text-align: center; margin-bottom: 26px; position: relative; }
.logo {
  font-size: 64px;
  display: inline-block;
  animation: bounce 2.4s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.hero h1 {
  font-size: 34px;
  letter-spacing: 4px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.slogan { color: var(--text-dim); margin-top: 8px; }

.theme-btn {
  margin-top: 14px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: transform .15s, box-shadow .15s;
}
.theme-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px var(--shadow); }

/* ===== 面板 ===== */
.panel {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px var(--shadow);
}

.hidden { display: none !important; }

/* ===== 皮肤面板 ===== */
.theme-panel h2 { font-size: 16px; margin-bottom: 14px; }
.theme-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-chip {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: transform .15s, border-color .15s;
}
.theme-chip:hover { transform: translateY(-2px); }
.theme-chip.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--d1), var(--d2));
  display: inline-block;
}

.custom-row {
  margin-top: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  font-size: 14px;
}
.custom-row label { display: flex; align-items: center; gap: 10px; }
#hueSlider { accent-color: var(--accent); width: 160px; cursor: pointer; }
.hue-preview {
  width: 20px; height: 20px; border-radius: 50%;
  background: hsl(330, 80%, 62%);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--border);
  transition: background .15s;
}
.mode-label { color: var(--text-dim); cursor: pointer; }
.mode-label input { accent-color: var(--accent); cursor: pointer; }

/* ===== 工作区 ===== */
.io { margin-bottom: 6px; }
.io-title { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-2);
}
textarea::placeholder { color: var(--text-dim); }

.actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 16px 0 22px;
}

.btn {
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  border: none;
  font-weight: 700;
  padding: 10px 26px;
}
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 14px; font-size: 13px; border-radius: 999px; }

.result-actions { display: flex; gap: 10px; margin-top: 10px; }

.share-box {
  display: flex; gap: 8px; margin-top: 10px;
}
.share-box input {
  flex: 1;
  border: 1.5px dashed var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 13px;
}

.tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  min-height: 18px;
}

/* ===== 关于 ===== */
.about h2 { font-size: 17px; margin-bottom: 10px; }
.about p { font-size: 14px; line-height: 1.9; color: var(--text-dim); margin-bottom: 6px; }
.about b { color: var(--accent); }
.about .mini { font-size: 12px; opacity: .8; }

footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 30px;
}

/* ===== 响应式 ===== */
@media (max-width: 520px) {
  .hero h1 { font-size: 26px; }
  .logo { font-size: 50px; }
  .panel { padding: 16px; }
  .actions .btn { flex: 1 1 40%; }
}
