/* KOCopilot — Web 静态高保真 · 紫蓝创作者系（桌面优先）
 * 主题色集中在 :root，5 分钟可换皮（参见 README 「换皮指南」）。
 */
:root {
  /* 主色板：墨紫 + 撞色亮黄 + 浅紫卡 */
  --bg-soft: #fafaff;
  --bg-deep: #f4f1ff;
  --ink: #1a1632;
  --ink-muted: #5a5478;
  --line: #e8e5fa;
  --line-strong: #cfc8ee;

  --primary: #4f3cf7;
  --primary-700: #3a2bd0;
  --primary-100: #ece8ff;
  --accent: #ffd93d;
  --accent-700: #e7b800;

  --success: #19b675;
  --warning: #f59e0b;
  --danger: #e2466a;

  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 2px 8px rgba(79, 60, 247, 0.06);
  --shadow-md: 0 12px 36px rgba(79, 60, 247, 0.1);
  --shadow-lg: 0 24px 64px rgba(79, 60, 247, 0.14);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --font-display: "DM Serif Display", "Songti SC", "SimSun", serif;
  --font-body: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 100% 60% at 50% -20%, rgba(79, 60, 247, 0.08), transparent 55%),
    linear-gradient(180deg, #fafaff 0%, #f4f1ff 100%);
  background-attachment: fixed;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== 顶部导航 ===== */
.koc-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(250, 250, 255, 0.85);
  border-bottom: 1px solid var(--line);
}

.koc-topbar__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.koc-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.koc-brand::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #7a5ef9 60%, var(--accent) 130%);
  box-shadow: 0 4px 14px rgba(79, 60, 247, 0.36);
}

.koc-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.koc-nav a {
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.koc-nav a:hover {
  color: var(--ink);
  text-decoration: none;
  background: var(--bg-deep);
}

.koc-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-100);
  font-weight: 600;
}

.koc-nav--muted a {
  font-size: 0.85rem;
}

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7a5ef9);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(79, 60, 247, 0.32);
}

.btn-primary:hover {
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(79, 60, 247, 0.4);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--bg-deep);
  text-decoration: none;
}

.btn.sm {
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
}

/* ===== 主区与 Hero ===== */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.koc-hero {
  padding: 2.75rem 0 1.75rem;
}

.koc-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.koc-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.koc-lead {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin: 0;
  max-width: 48rem;
}

.koc-badge {
  display: inline-block;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-100);
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-700);
  margin-bottom: 1rem;
}

/* ===== 通用 Section title ===== */
.koc-sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 400;
  margin: 1.6rem 0 1.1rem;
  color: var(--ink);
}

.koc-sec-sub {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: -0.6rem 0 1.2rem;
}

/* ===== 卡片基底 ===== */
.koc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ===== 站脚 ===== */
.koc-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.6rem 2rem 2.4rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.koc-footer a {
  color: var(--primary);
}

/* ===== Toast (顶部短消息) ===== */
.koc-toast {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 999;
  max-width: 420px;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.koc-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.koc-toast[data-kind="error"] { background: var(--danger); }
.koc-toast[data-kind="success"] { background: var(--success); }

/* ===== 加载占位 (skeleton placeholder used while AI is thinking) ===== */
.koc-loading {
  padding: 1.2rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-muted);
  text-align: center;
  font-size: 0.92rem;
  background: var(--bg-soft);
}
.koc-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 0.5rem;
  border: 2px solid var(--primary-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  vertical-align: -2px;
  animation: koc-spin 0.9s linear infinite;
}
@keyframes koc-spin { to { transform: rotate(360deg); } }

/* 按钮 disabled 状态视觉补强 */
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

/* ASR 上传状态条 */
.koc-asr-status {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.koc-asr-status[data-kind="success"] {
  background: rgba(25, 182, 117, 0.08);
  border-color: rgba(25, 182, 117, 0.3);
  color: var(--success);
}
.koc-asr-status[data-kind="error"] {
  background: rgba(226, 70, 106, 0.08);
  border-color: rgba(226, 70, 106, 0.35);
  color: var(--danger);
}

/* 脉冲提示：ASR 完成后让"用 AI 拆解骨架"按钮闪一下吸引注意 */
.koc-pulse {
  animation: koc-pulse 1.6s ease-in-out 3;
  box-shadow: 0 0 0 4px var(--primary-100);
}
@keyframes koc-pulse {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .koc-topbar__inner {
    padding: 0.7rem 1.2rem;
  }
  main {
    padding: 0 1.2rem 3rem;
  }
}
