/* ═══════════════════════════════════════════════════════
   WhispBuild · 首页（Alpha 极简版）
   单独一套浅色样式，只服务 index.html。
   docs/ 下的文档页仍然使用 styles.css（深色），互不影响。
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:          #f8f8f7;
  --surface:     #ffffff;
  --text:        #1a1a19;
  --muted:       #6b6b66;
  --dim:         #9a9a94;
  --line:        #e6e6e2;
  --line-strong: #d6d6d1;
  --focus:       #b9b9b2;
  --max:         1200px;
  --box:         620px;
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* ════════════════════ HEADER ════════════════════
   Alpha：顶栏不放菜单，只有品牌 + 中英文切换 */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.nav-shell {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.brand-logo {
  /* 与 v2 同一枚 mark（v2/frontend/src/assets/logo.svg 逐字节拷贝）。
     内部是 fill="currentColor"，作为 <img> 引入时解析为黑色，正好配浅色顶栏；
     若哪天要放到深色底上，得改成 inline SVG 才能换色。 */
  height: 26px;
  width: auto;
}
.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;   /* 窄屏别被品牌名挤扁 */
}

/* 顶栏两个登录按钮。圆角跟着页面其余控件走胶囊形，不照抄参考图的圆角矩形，
   否则同一行里 EN 是胶囊、旁边两个是方角，看着不像一套。 */
.btn {
  font: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  border-radius: 999px;
  height: 34px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn-solid {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.btn-solid:hover { background: #000; border-color: #000; }
.btn-outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-outline:hover { background: #fbfbfa; border-color: #c4c4be; }

.lang-btn {
  font: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.lang-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: #fbfbfa;
}
.lang-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ════════════════════ HERO ════════════════════ */
.hero {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0 132px;
}

.hero-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.5s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-inner { animation: none; }
}

.hero-title {
  margin: 0 0 30px;
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-align: center;
}

/* ── 输入框 ── */
.composer {
  width: min(100%, var(--box));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.05);
  padding: 16px 16px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 34px rgba(0, 0, 0, 0.08);
}

.composer-input {
  display: block;
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.65;
  min-height: 58px;
  max-height: 260px;
  overflow-y: auto;
  padding: 0;
}
.composer-input::placeholder { color: var(--dim); }

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
}

.send-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ececea;
  color: #a6a69f;
  cursor: default;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.send-btn.ready {
  background: var(--text);
  color: #fff;
  cursor: pointer;
}
.send-btn.ready:hover { transform: scale(1.06); }
.send-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── 示例胶囊 ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  width: min(100%, calc(var(--box) + 120px));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: #fbfbfa;
}
.chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.chip svg { flex: none; color: var(--dim); }
.chip:hover svg { color: var(--muted); }

/* ════════════════════ FOOTER ════════════════════ */
.site-footer {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 0;
}

/* 支持的编译平台，挂在胶囊行下面。
   espressif 的源 PNG 没有 alpha、白底是实的，已用 -transparent white 抠过，
   所以这条放在 --bg 的浅灰区域也不会露白方块——换素材时记得重抠。 */
.support-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 30px;
}
.support-label {
  font-size: 0.8rem;
  color: var(--dim);
}
.support-logos {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.support-logos img {
  height: 26px;
  width: auto;
}

.footer-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.82rem;
  color: var(--dim);
}
.footer-shell a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-shell a:hover { color: var(--text); }

/* 备案号。ICP + 公网安备是境内站点的展示要求，两个号都必须可点跳转。 */
.footer-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 12px;
  font-size: 0.76rem;
}
.footer-beian a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-beian a:hover { color: var(--muted); text-decoration: underline; }
.footer-beian img {
  /* 全局 img 是 display:block，会把警徽顶到文字上一行 */
  display: inline-block;
  width: 15px;
  height: auto;
}

/* 微信二维码浮层 */
.wechat-wrap { position: relative; display: inline-flex; }
.wechat-btn {
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.wechat-btn:hover { color: var(--text); }
.wechat-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.wechat-card {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  /* 绝对定位元素的可用宽度来自 .wechat-wrap（只有按钮那么宽），
     不写死宽度会被压成一条竖条，二维码也跟着缩没 */
  width: 172px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
  padding: 12px;
  z-index: 20;
}
.wechat-card.open { display: block; }
.wechat-card-title {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 8px;
}
.wechat-card img {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: 8px;
}

/* ════════════════════ 响应式 ════════════════════ */
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  /* 窄屏一行要塞下 品牌 + EN + 登录 + 注册，收紧内边距和间距 */
  .nav-actions { gap: 6px; }
  .btn { font-size: 0.79rem; height: 30px; padding: 0 12px; }
  .lang-btn { font-size: 0.79rem; height: 30px; padding: 0 11px; }
  .hero { padding: 32px 0 56px; }
  .hero-title { margin-bottom: 24px; }
  .composer { border-radius: 18px; padding: 14px 14px 10px; }
  .chips { gap: 7px; }
  .chip { font-size: 0.8rem; padding: 7px 13px; }
  .support-strip { gap: 6px 12px; margin-top: 24px; }
  .support-logos { gap: 16px; }
  .support-logos img { height: 22px; }
  .footer-shell { gap: 6px 14px; font-size: 0.78rem; }
  .footer-beian { gap: 4px 14px; font-size: 0.72rem; margin-top: 10px; }
  /* 窄屏上居中的浮层会顶出右边界，撑出横向滚动条；改成贴按钮右缘 */
  .wechat-card { left: auto; right: 0; transform: none; }
}

/* 再窄就只留 logo，跟 v2 顶栏一样——字样留着会被三个按钮挤到截断 */
@media (max-width: 420px) {
  .brand-name { display: none; }
}
