/* ============================================================
   Melomi 设计系统 — 透 + 药丸
   关键词：通透玻璃材质 · 胶囊形交互元素 · 浅色为主、深色跟随系统
   ============================================================ */

/* ============ 浅色（默认） ============ */
:root {
  color-scheme: light;

  /* 背景：极简中性浅灰白，去紫调 */
  --bg:            #F4F5F8;
  --bg-soft:       #EBEDF1;
  --bg-elev:       rgba(255, 255, 255, .55);
  --bg-elev-2:     rgba(255, 255, 255, .72);

  /* 文本 */
  --text:          #1A1B1F;
  --text-soft:     #565A66;
  --text-dim:      #8A8F9C;

  /* 分隔线 */
  --line:          rgba(20, 24, 40, .08);
  --line-soft:     rgba(20, 24, 40, .045);

  /* 玻璃材质 · 薄（通透，不厚重） */
  --glass:         rgba(255, 255, 255, .5);
  --glass-hover:   rgba(255, 255, 255, .72);
  --glass-border:  rgba(255, 255, 255, .85);
  --glass-edge:    rgba(20, 24, 40, .05);
  --glass-blur:    blur(22px) saturate(150%);
  --glass-shadow:  0 4px 22px rgba(20, 24, 40, .06);
  --glass-inner:   inset 0 1px 0 rgba(255, 255, 255, .9);

  /* 玻璃材质 · 厚（导航/浮层） */
  --thick-bg:      rgba(255, 255, 255, .72);
  --thick-blur:    blur(30px) saturate(160%);

  /* 品牌（克制使用） */
  --brand:         #5B5BF0;
  --brand-2:       #4C7DF0;
  --brand-grad:    linear-gradient(135deg, #6A6AF5 0%, #4C7DF0 100%);
  --brand-glow:    rgba(91, 91, 240, .16);
  --brand-soft:    rgba(91, 91, 240, .1);
  --brand-text:    #4A4AE0;
  --brand-border:  rgba(91, 91, 240, .26);

  /* 会员金（克制） */
  --gold:          #B5872E;
  --gold-2:        #D9A544;
  --gold-grad:     linear-gradient(135deg, #E0B259 0%, #C2902F 100%);
  --gold-glow:     rgba(197, 144, 47, .18);
  --gold-soft:     rgba(197, 144, 47, .1);

  /* 语义色 */
  --success:       #1F9D5B;
  --warning:       #C98A16;
  --danger:        #E05353;
  --info:          #4C7DF0;

  /* 背景柔光（极淡，营造“透”而非“炫”） */
  --blob-a:        rgba(255, 150, 205, .14);
  --blob-b:        rgba(150, 130, 255, .12);
  --blob-c:        rgba(120, 190, 255, .11);
  --blob-d:        rgba(120, 224, 200, .10);

  /* 圆角 */
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-2xl: 30px;
  --r-3xl: 40px;
  --r-pill: 999px;            /* 药丸 */

  --shadow-sm: 0 1px 5px rgba(20, 24, 40, .05);
  --shadow-md: 0 8px 28px rgba(20, 24, 40, .08);
  --shadow-lg: 0 22px 60px rgba(20, 24, 40, .12);

  --max-w: 1180px;
  --nav-h: 72px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ============ 深色（手动切换） ============ */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] {
  --bg:            #0C0D12;
  --bg-soft:       #13141B;
  --bg-elev:       rgba(255, 255, 255, .06);
  --bg-elev-2:     rgba(255, 255, 255, .09);

  --text:          #F4F4F8;
  --text-soft:     #A6A8B4;
  --text-dim:      #6F7280;

  --line:          rgba(255, 255, 255, .1);
  --line-soft:     rgba(255, 255, 255, .06);

  --glass:         rgba(255, 255, 255, .06);
  --glass-hover:   rgba(255, 255, 255, .1);
  --glass-border:  rgba(255, 255, 255, .12);
  --glass-edge:    rgba(255, 255, 255, .08);
  --glass-blur:    blur(22px) saturate(150%);
  --glass-shadow:  0 6px 28px rgba(0, 0, 0, .4);
  --glass-inner:   inset 0 1px 0 rgba(255, 255, 255, .12);

  --thick-bg:      rgba(20, 22, 30, .7);
  --thick-blur:    blur(30px) saturate(160%);

  --brand:         #8B8BFF;
  --brand-2:       #6B9BFF;
  --brand-grad:    linear-gradient(135deg, #8B8BFF 0%, #6B9BFF 100%);
  --brand-glow:    rgba(139, 139, 255, .22);
  --brand-soft:    rgba(139, 139, 255, .14);
  --brand-text:    #AEAEF6;
  --brand-border:  rgba(139, 139, 255, .3);

  --gold:          #E5B75E;
  --gold-2:        #F5D08A;
  --gold-grad:     linear-gradient(135deg, #F5D08A 0%, #E5B75E 100%);
  --gold-glow:     rgba(229, 183, 94, .2);
  --gold-soft:     rgba(229, 183, 94, .12);

  --success:       #3ECF8E;
  --warning:       #F5B95B;
  --danger:        #FF6B6B;
  --info:          #6B9BFF;

  --blob-a:        rgba(124, 92, 255, .16);
  --blob-b:        rgba(62, 130, 245, .12);
  --blob-c:        rgba(255, 158, 92, .1);
  --blob-d:        rgba(92, 214, 200, .09);

  --shadow-sm: 0 1px 5px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .4);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .55);
}

/* ============ 深色（跟随系统） ============ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:            #0C0D12;
    --bg-soft:       #13141B;
    --bg-elev:       rgba(255, 255, 255, .06);
    --bg-elev-2:     rgba(255, 255, 255, .09);
    --text:          #F4F4F8;
    --text-soft:     #A6A8B4;
    --text-dim:      #6F7280;
    --line:          rgba(255, 255, 255, .1);
    --line-soft:     rgba(255, 255, 255, .06);
    --glass:         rgba(255, 255, 255, .06);
    --glass-hover:   rgba(255, 255, 255, .1);
    --glass-border:  rgba(255, 255, 255, .12);
    --glass-inner:   inset 0 1px 0 rgba(255, 255, 255, .12);
    --thick-bg:      rgba(20, 22, 30, .7);
    --brand:         #8B8BFF;
    --brand-2:       #6B9BFF;
    --brand-grad:    linear-gradient(135deg, #8B8BFF 0%, #6B9BFF 100%);
    --brand-glow:    rgba(139, 139, 255, .22);
    --brand-soft:    rgba(139, 139, 255, .14);
    --brand-text:    #AEAEF6;
    --brand-border:  rgba(139, 139, 255, .3);
    --gold:          #E5B75E;
    --gold-grad:     linear-gradient(135deg, #F5D08A 0%, #E5B75E 100%);
    --gold-glow:     rgba(229, 183, 94, .2);
    --gold-soft:     rgba(229, 183, 94, .12);
    --success:       #3ECF8E;
    --warning:       #F5B95B;
    --danger:        #FF6B6B;
    --info:          #6B9BFF;
    --blob-a:        rgba(255, 130, 200, .18);
    --blob-b:        rgba(150, 120, 255, .16);
    --blob-c:        rgba(110, 180, 255, .14);
    --blob-d:        rgba(110, 224, 200, .12);
    --shadow-sm: 0 1px 5px rgba(0, 0, 0, .3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, .4);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, .55);
  }
}

/* ============================================================
   基础层
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

::selection { background: var(--brand); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ---------------- 排版 ---------------- */
.h-display {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; line-height: 1.18; letter-spacing: -.025em; }
.h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 660; line-height: 1.3; letter-spacing: -.02em; }
.h3 { font-size: 1.12rem; font-weight: 620; letter-spacing: -.012em; }
.lead { font-size: clamp(1rem, 1.4vw, 1.1rem); color: var(--text-soft); line-height: 1.75; }
.muted { color: var(--text-soft); }
.dim { color: var(--text-dim); }
.mono { font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }

.grad-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------------- 布局 ---------------- */
.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; position: relative; }

/* ---------------- 玻璃材质 ---------------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  border-radius: var(--r-lg);
}
.glass-thick {
  background: var(--thick-bg);
  -webkit-backdrop-filter: var(--thick-blur);
  backdrop-filter: var(--thick-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), var(--glass-inner);
}

/* ---------------- 按钮（药丸） ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 26px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 560;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.btn:active { transform: scale(.975); }

.btn-primary {
  background: linear-gradient(135deg, rgba(107,107,245,.18), rgba(76,125,240,.14));
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-inner), 0 4px 18px var(--brand-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(107,107,245,.28), rgba(76,125,240,.22));
  box-shadow: var(--glass-inner), 0 8px 26px var(--brand-glow);
}

.btn-gold {
  background: linear-gradient(135deg, rgba(224,178,89,.28), rgba(194,144,47,.22));
  color: var(--gold);
  font-weight: 640;
  border: 1px solid rgba(197,144,47,.4);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-inner), 0 4px 18px var(--gold-glow);
}
.btn-gold:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(224,178,89,.38), rgba(194,144,47,.3));
  box-shadow: var(--glass-inner), 0 8px 26px var(--gold-glow);
}

.btn-ghost {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--text);
  box-shadow: var(--glass-inner);
}
.btn-ghost:hover { background: var(--glass-hover); transform: translateY(-2px); }

.btn-plain { color: var(--text-soft); }
.btn-plain:hover { color: var(--text); }

.btn-sm { height: 38px; padding: 0 18px; font-size: 13.5px; }
.btn-lg { height: 54px; padding: 0 34px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------------- 标签（药丸） ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 560;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-border); }
.badge-gold  { background: var(--gold-soft); color: var(--gold); border: 1px solid transparent; }
.badge-ok    { background: rgba(31, 157, 91, .12); color: var(--success); }
.badge-warn  { background: rgba(201, 138, 22, .14); color: var(--warning); }
.badge-err   { background: rgba(224, 83, 83, .12); color: var(--danger); }
.badge-mute  { background: var(--glass); color: var(--text-dim); border: 1px solid var(--line); }

/* ---------------- 提示框 ---------------- */
.alert {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.alert.ok  { background: var(--brand-soft); color: var(--brand-text); border: 1px solid transparent; }
.alert.err { background: rgba(224, 83, 83, .12); color: var(--danger); border: 1px solid rgba(224, 83, 83, .26); }

.hr { height: 1px; background: var(--line); border: none; }

/* ---------------- 表单（药丸输入框） ---------------- */
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 560; color: var(--text-soft); margin-bottom: 8px; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--text);
  outline: none;
  transition: all .2s var(--ease);
}
.input::placeholder { color: var(--text-dim); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input:disabled { opacity: .5; cursor: not-allowed; }
textarea.input { height: auto; padding: 14px 20px; resize: vertical; min-height: 96px; line-height: 1.6; }

/* ---------------- 开关（药丸） ---------------- */
.switch {
  position: relative;
  width: 44px; height: 25px;
  border-radius: 99px;
  background: var(--line);
  transition: background .24s var(--ease);
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .24s var(--ease);
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(19px); }

/* ---------------- 滚动入场（仅一次，非循环动画） ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .65s var(--ease-out), transform .65s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------------- 主题切换按钮 ---------------- */
.theme-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--text-soft);
  transition: all .2s var(--ease);
  flex-shrink: 0;
}
.theme-btn:hover { color: var(--text); background: var(--glass-hover); }
.theme-btn svg { width: 17px; height: 17px; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun  { display: block; }
.theme-btn .i-moon { display: block; }
.theme-btn .i-sun  { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-sun  { display: block; }
}

@media (max-width: 768px) {
  .section { padding: 66px 0; }
  .wrap { padding: 0 20px; }
}

/* 尊重系统「减少动态效果」 */
/* 背景柔光层（通用：官网与后台共用） */
.bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: var(--bg);
}
.bg-layer span { position: absolute; border-radius: 50%; }
.bg-layer span:nth-child(1) { width: 720px; height: 720px; top: -320px; left: -160px; background: radial-gradient(circle, var(--blob-a), transparent 68%); }
.bg-layer span:nth-child(2) { width: 620px; height: 620px; top: 380px; right: -200px; background: radial-gradient(circle, var(--blob-b), transparent 68%); }
.bg-layer span:nth-child(3) { width: 560px; height: 560px; top: 1500px; left: 42%; background: radial-gradient(circle, var(--blob-c), transparent 68%); }

/* 站点 Logo（通用：官网与后台共用） */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px var(--brand-glow));
}
.logo-mark img,
.logo-mark svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-cn {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
}

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