/* ============================================================
   moodoo — 首页样式
   ============================================================ */
:root {
  --bg: #f6f5f1;
  --ink: #21211e;
  --muted: #8b8b84;
  --line: rgba(33, 33, 30, 0.08);
  --card: #ffffff;
  --accent: #f2703f;
  --green: #3d9c62;
  --blue: #4a6fe0;
  --orange: #e2703f;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(20, 20, 18, 0.04), 0 10px 28px -14px rgba(20, 20, 18, 0.14);
  --shadow-lg: 0 2px 4px rgba(20, 20, 18, 0.05), 0 22px 44px -18px rgba(20, 20, 18, 0.20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.hidden { display: none !important; }

/* ---------------- 背景 ---------------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.blob-a { width: 460px; height: 460px; left: -140px; top: -160px; background: #ffd6c4; }
.blob-b { width: 420px; height: 420px; right: -120px; top: -80px; background: #d9defa; }
.blob-c { width: 520px; height: 520px; left: 32%; bottom: -300px; background: #d7ecd8; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 34px 8px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  flex: none;
}
.brand .dot { color: var(--accent); }
.user-area { display: flex; align-items: center; gap: 10px; }

.btn {
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}
.btn.ghost:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(20,20,18,0.25); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(0,0,0,0.5); }
.btn.block { width: 100%; padding: 13px; }
.btn:disabled { opacity: 0.6; cursor: default; transform: none !important; }

/* 明暗切换按钮 */
.theme-btn {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background 0.18s ease, transform 0.18s ease;
}
.theme-btn:hover { background: #fff; transform: translateY(-1px); }

/* 用户信息 */
.chip {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 8px 5px 6px;
  box-shadow: 0 4px 14px -10px rgba(20,20,18,0.25);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f8a978, #f2703f);
  color: #fff; font-size: 13px; font-weight: 600;
}
.uname { font-size: 13.5px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-out {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.chip-out:hover { background: #f3f2ee; color: var(--ink); }

/* ---------------- 主区 ---------------- */
.hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%;
  padding: 30px 20px 64px;
  text-align: center;
}

.greet { font-size: 15px; color: var(--muted); margin-bottom: 16px; }

.tagline {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted);
  letter-spacing: 0.16em;
}

/* ---------------- 服务卡片 ---------------- */
.grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 300px));
  gap: 18px;
  width: 100%;
  justify-content: center;
}

.card {
  position: relative;
  display: flex; align-items: center; gap: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  text-align: left;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card.offline { opacity: 0.55; }
.card.acct { cursor: pointer; }
.card.acct:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid; place-items: center;
}
.icon svg { width: 23px; height: 23px; }
.icon-green  { background: #e9f5ec; color: var(--green); }
.icon-blue   { background: #edf1fd; color: var(--blue); }
.icon-orange { background: #fdefe7; color: var(--orange); }
.icon-violet  { background: #f0edfb; color: #6d5bd0; }

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.card-title { font-size: 16px; font-weight: 650; }
.card-desc {
  font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.arrow { flex: 0 0 auto; color: #c9c8c0; display: grid; place-items: center; transition: transform 0.22s ease, color 0.22s ease; }
.arrow svg { width: 19px; height: 19px; }
a.card:hover .arrow { transform: translateX(4px); color: var(--ink); }

.cta {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  white-space: nowrap;
}
.cta:hover { border-color: rgba(33,33,30,0.25); transform: translateY(-1px); }

/* 状态小圆点 */
.status-dot {
  position: absolute; top: 16px; right: 16px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #dcdbd4;
}
.status-dot.checking { background: #e0b45c; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(61,156,98,0.15); }
.status-dot.bad { background: #e2554d; box-shadow: 0 0 0 3px rgba(226,85,77,0.15); }

/* ---------------- 页脚 ---------------- */
.footer {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 26px 20px 30px;
  font-size: 12px; color: #b0afa7;
  flex-wrap: wrap;
}
.footer a { color: #b0afa7; transition: color 0.15s; }
.footer a:hover { color: var(--ink); }
.footer .beian-link { display: inline-flex; align-items: center; gap: 4px; }
.footer .beian-icon { width: 14px; height: 16px; display: block; flex: none; }
.sep { color: #d5d4cc; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 30, 27, 0.35);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 380px;
  background: #fff;
  border-radius: 24px;
  padding: 34px 32px 28px;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.35);
  animation: pop 0.22s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  color: var(--muted); font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #f3f2ee; color: var(--ink); }
.modal-brand { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.modal-brand .dot { color: var(--accent); }
.modal h2 { margin-top: 14px; font-size: 24px; font-weight: 700; }
.modal-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.modal form { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  font-size: 14px;
  background: #fafaf8;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: #c2c1b9; }
.field input:focus {
  border-color: rgba(242, 112, 63, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(242, 112, 63, 0.10);
}
.form-error {
  font-size: 12.5px; color: #e2554d;
  background: #fdf0ef; border-radius: 10px;
  padding: 9px 12px;
}
.modal-switch { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.modal-switch a { color: var(--ink); font-weight: 600; border-bottom: 1px solid rgba(33,33,30,0.2); }
.modal-switch a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- 轻提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 60;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,0.45);
  animation: rise 0.25s ease;
  max-width: min(88vw, 420px);
  text-align: center;
}
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 320px)); }
}
@media (max-width: 700px) {
  .grid { grid-template-columns: minmax(0, 360px); margin-top: 40px; }
  .topbar { padding: 16px 18px; }
  .hero { justify-content: flex-start; padding-top: 12vh; }
}

/* ---------------- 暗黑模式 ---------------- */
[data-theme="dark"] {
  --bg: #161613;
  --card: #1e1e1b;
  --ink: #eae7dd;
  --muted: #a09d92;
  --faint: #75736b;
  --dim: #bcb9ae;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff8a5c;
  --green: #57b57c;
  --blue: #7894f5;
  --orange: #ef8a5f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 32px -16px rgba(0,0,0,.55);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 26px 48px -18px rgba(0,0,0,.6);
}
[data-theme="dark"] .blob { opacity: 0.5; }
[data-theme="dark"] .blob-a { background: #4a2414; }
[data-theme="dark"] .blob-b { background: #1c2750; }
[data-theme="dark"] .blob-c { background: #15301d; }
[data-theme="dark"] .theme-btn { background: rgba(255,255,255,.06); }
[data-theme="dark"] .theme-btn:hover { background: rgba(255,255,255,.12); }
[data-theme="dark"] .btn.ghost { background: rgba(255,255,255,.05); }
[data-theme="dark"] .btn.ghost:hover { background: rgba(255,255,255,.1); }
[data-theme="dark"] .btn.dark { background: #eae7dd; color: #161613; }
[data-theme="dark"] .btn.dark:hover { background: #fff; }
[data-theme="dark"] .chip { background: #1e1e1b; }
[data-theme="dark"] .chip-out:hover { background: rgba(255,255,255,.08); }
[data-theme="dark"] .icon-green  { background: rgba(87,181,124,.16); }
[data-theme="dark"] .icon-blue   { background: rgba(120,148,245,.16); }
[data-theme="dark"] .icon-orange { background: rgba(239,138,95,.16); }
[data-theme="dark"] .icon-violet { background: rgba(169,140,245,.16); color: #b7a0f8; }
[data-theme="dark"] .arrow { color: #4d4c47; }
[data-theme="dark"] .cta { background: #1e1e1b; }
[data-theme="dark"] .status-dot { background: #3a3a35; }
[data-theme="dark"] .footer { color: #5c5b55; }
[data-theme="dark"] .footer a { color: #5c5b55; }
[data-theme="dark"] .footer a:hover { color: var(--ink); }
[data-theme="dark"] .sep { color: rgba(255,255,255,.14); }
[data-theme="dark"] .modal-mask { background: rgba(0,0,0,.5); }
[data-theme="dark"] .modal { background: #1e1e1b; }
[data-theme="dark"] .modal-close:hover { background: rgba(255,255,255,.08); }
[data-theme="dark"] .field input { background: #141411; color: #eae7dd; }
[data-theme="dark"] .field input:focus { background: #232320; }
[data-theme="dark"] .field input::placeholder { color: #5f5e58; }
[data-theme="dark"] .form-error { background: rgba(226,85,77,.14); color: #ff9b92; }
[data-theme="dark"] .modal-switch a { border-bottom-color: rgba(255,255,255,.25); }
[data-theme="dark"] .toast { background: #eae7dd; color: #161613; }