/* ==========================================================================
   claudechat.club · 基础样式 + 组件
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.02em;
  color: var(--ink);
}

h1 { font-size: var(--fs-xl); }
h2 { font-size: clamp(1.75rem, 1.1rem + 2.2vw, 2.75rem); }
h3 { font-size: var(--fs-md); }

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection {
  background: var(--accent-tint);
  color: var(--accent-text);
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.kick {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

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

/* ==========================================================================
   顶部导航
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  box-shadow: 0 1px 0 var(--line);
}

.header-bar {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -.01em;
  color: var(--ink);
  flex: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  min-width: 0;
}

.site-nav a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.header-note {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  max-width: 190px;
  line-height: 1.4;
  text-align: right;
}

/* ---------- 主题切换器 ---------- */
.theme-picker { position: relative; }

.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  display: grid;
  place-items: center;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.theme-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.theme-btn-ring {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0 60deg,
    var(--sky) 60deg 120deg,
    var(--olive) 120deg 180deg,
    var(--kraft) 180deg 240deg,
    #141413 240deg 300deg,
    #a9502c 300deg 360deg
  );
  box-shadow: inset 0 0 0 2px var(--page);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 188px;
  padding: 7px;
  border-radius: var(--radius-card);
  background: var(--page);
  box-shadow: 0 0 0 .5px var(--line-strong), 0 16px 40px -8px #00000026;
  display: none;
  z-index: 60;
}

.theme-menu[data-open="true"] { display: block; }

.theme-menu-title {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  padding: 5px 9px 7px;
  letter-spacing: .08em;
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast) var(--ease-out);
}

.theme-option:hover { background: var(--surface); }

.theme-option[aria-checked="true"] {
  background: var(--accent-tint);
  color: var(--accent-text);
  font-weight: 600;
}

.theme-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px #0000001f;
}

.theme-option .check {
  margin-left: auto;
  font-size: 11px;
  opacity: 0;
}

.theme-option[aria-checked="true"] .check { opacity: 1; }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.btn-lg {
  min-height: 46px;
  padding: 0 24px;
  font-size: .9375rem;
}

.btn-primary {
  background: var(--ink);
  color: var(--page);
}

.btn-primary:hover {
  background: var(--ink-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-text);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--page);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 32%, transparent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover { color: var(--ink); background: var(--surface); }

.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  color: var(--accent-text);
  border-bottom: 1px solid var(--accent-tint);
  padding-bottom: 1px;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.link-more:hover { border-color: var(--accent); }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
  border-radius: var(--radius-card);
  background: var(--page);
  box-shadow: 0 0 0 .5px var(--line-strong), 0 8px 24px var(--shadow-soft);
  padding: 24px;
}

.card-surface { background: var(--surface); }

.card-accent-top {
  border-top: 3px solid var(--tone, var(--accent));
}

.glass {
  border-radius: var(--radius-card);
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--on-dark-line), 0 20px 60px -20px #0009;
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

/* 标签 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent-text);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: .04em;
}

.pill-neutral {
  background: var(--surface);
  color: var(--text-muted);
}

.pill-success { background: var(--success-tint); color: var(--success); }
.pill-danger { background: var(--danger-tint); color: var(--danger); }

/* ==========================================================================
   表单
   ========================================================================== */
.field { display: block; margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 7px;
}

.field-hint {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  margin-top: 6px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: none;
  border-radius: var(--radius-input);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.textarea { padding: 11px 13px; min-height: 110px; resize: vertical; line-height: 1.6; }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  background: var(--page);
  box-shadow: inset 0 0 0 1px var(--accent),
              0 0 0 4px var(--accent-tint);
}

.input::placeholder,
.textarea::placeholder { color: var(--text-subtle); }

/* 验证码行：输入框 + 发送按钮 */
.code-row {
  display: flex;
  gap: 9px;
}

.code-row .input { flex: 1; }

.code-btn {
  min-width: 116px;
  flex: none;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: var(--fs-xs);
}

.code-btn:hover:not(:disabled) { background: var(--surface-2); }

.code-btn:disabled {
  color: var(--text-subtle);
  cursor: not-allowed;
  opacity: 1;
}

/* 倒计时秒数：等宽数字，避免宽度跳动 */
.code-btn .resend-sec {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
  color: var(--accent-text);
}

/* 勾选框 */
.checkline {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.5;
}

.checkline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.checkline a { color: var(--accent-text); border-bottom: 1px solid var(--accent-tint); }

/* 表单提示 */
.form-msg {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 13px;
  border-radius: var(--radius-input);
  font-size: var(--fs-xs);
  line-height: 1.5;
  margin-bottom: 14px;
}

.form-msg[data-show="true"] { display: flex; }
.form-msg[data-kind="error"] { background: var(--danger-tint); color: var(--danger); }
.form-msg[data-kind="ok"] { background: var(--success-tint); color: var(--success); }
.form-msg[data-kind="info"] { background: var(--accent-tint); color: var(--accent-text); }

/* ==========================================================================
   页面骨架
   ========================================================================== */
.section {
  padding-block: var(--section-gap);
}

.section-tight { padding-block: clamp(44px, 5vw, 68px); }

.section-head {
  max-width: 620px;
  margin-bottom: 36px;
}

.section-head h2 { margin-top: 12px; }

.section-head p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: 1.62;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 44px 34px;
  margin-top: var(--section-gap);
}

.footer-top {
  display: flex;
  gap: 48px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-brand { max-width: 300px; }

.footer-brand p {
  margin-top: 12px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-cols {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: var(--fs-2xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-col a {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding: 4px 0;
  transition: color var(--dur-fast) var(--ease-out);
}

.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
}

.footer-disclaimer {
  margin-top: 18px;
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  line-height: 1.6;
  max-width: 780px;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 960px) {
  .site-nav { display: none; }
  .header-note { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; --header-h: 58px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding-block: 52px; }
  .footer-cols { gap: 32px; }
  .header-right .btn { display: none; }
}

/* ==========================================================================
   悬浮客服（Telegram）
   全站通用，固定右下角，移动端收成圆形按钮
   ========================================================================== */
.tg-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px 12px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--page);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: 0 6px 22px -6px #14141380, 0 0 0 .5px #14141322;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.tg-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -8px #14141399, 0 0 0 .5px #14141333;
  color: var(--page);
}

.tg-fab svg { flex: none; opacity: .92; }

@media (max-width: 640px) {
  .tg-fab {
    right: 14px;
    bottom: 14px;
    padding: 13px;
    border-radius: 50%;
  }
  .tg-fab-text { display: none; }
}
