:root {
  --bg: #f7f4ee;
  --paper: #ffffff;
  --ink: #1d2130;
  --ink-soft: #4d5468;
  --line: #e3ddd2;
  --accent: #b4813c;
  --accent-soft: #f3e6d2;
  --deep: #171b28;
  --me: #eef4ff;
  --shadow: 0 10px 30px rgba(23, 27, 40, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

code { background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--deep); color: #fff; font-size: 18px;
  overflow: hidden; flex: 0 0 32px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 42%; display: block; }

/* ---------- 照片 ---------- */
.portrait { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; }
.portrait img {
  width: 128px; height: 128px; border-radius: 50%; flex: 0 0 128px;
  object-fit: cover; object-position: 60% 42%;
  border: 5px solid #fff; outline: 2px solid var(--accent);
  box-shadow: var(--shadow); transform: rotate(-3deg);
}
.portrait figcaption { display: flex; flex-direction: column; gap: 2px; }
.portrait b { font-size: 19px; color: var(--ink); }
.portrait span { color: var(--ink-soft); font-size: 14px; }

.photo-card img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 60% 42%;
  border-radius: 12px; display: block; margin-bottom: 10px;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 60% 42%; display: block; }
.nav-links { display: flex; gap: 18px; margin-left: auto; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: 999px; font-size: 15px; white-space: nowrap;
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 32px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 56px;
}
.hello { color: var(--accent); font-weight: 700; letter-spacing: 2px; margin: 0 0 6px; }
.hero h1 { font-size: clamp(38px, 6vw, 62px); line-height: 1.15; margin: 0 0 18px; }
.hero h1 .name { color: var(--accent); }
.facts { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; display: flex; gap: 8px; align-items: baseline;
}
.facts .k { color: var(--ink-soft); font-size: 13px; }
.facts .v { font-weight: 700; }
.lead { color: var(--ink-soft); font-size: 17px; margin: 0 0 12px; }
.tip {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: 10px 14px; border-radius: 8px; font-size: 15px;
}

/* ---------- 聊天卡片 ---------- */
.chat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 78px;
}
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.chat-head h2 { margin: 0; font-size: 20px; }
.chat-sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 13px; }
.ghost {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

.chat-log { height: 300px; overflow-y: auto; padding: 14px 4px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.me { flex-direction: row; }
.msg.you { flex-direction: row-reverse; }
.avatar {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; color: #fff; background: var(--deep);
}
.msg.you .avatar { background: var(--accent); }
.bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word;
  background: var(--me); border: 1px solid #dbe6f7;
}
.msg.you .bubble { background: #fff8ec; border-color: #eeddc0; }
.bubble.pending { color: var(--ink-soft); font-style: normal; }
.bubble.err { background: #fdecec; border-color: #f3c4c4; color: #93261f; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.quick button {
  border: 1px dashed var(--line); background: #fbfaf7; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.quick button:hover { border-color: var(--accent); color: var(--accent); }

.chat-input { display: flex; gap: 8px; }
.chat-input input {
  flex: 1; min-width: 0; padding: 11px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; color: var(--ink);
}
.chat-input input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.chat-input button {
  border: none; background: var(--accent); color: #fff; padding: 0 20px;
  border-radius: 10px; font-size: 15px; cursor: pointer;
}
.chat-input button:disabled { opacity: 0.55; cursor: wait; }
.chat-status { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-soft); min-height: 18px; }

/* ---------- 通用区块 ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 48px 24px; border-top: 1px solid var(--line); }
.section-title { font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 6px; }
.section-lead { color: var(--ink-soft); margin: 0 0 26px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 18px; color: var(--accent); }
.card p { margin: 0 0 10px; color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }
.small { font-size: 13px; color: var(--ink-soft); }

.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.piano-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.practice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.know-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.dl dt { font-weight: 700; color: var(--accent); }
.dl dd { margin: 0; color: var(--ink-soft); }

.timeline, .steps { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.timeline li, .steps li { margin-bottom: 8px; }
.timeline b, .steps b { color: var(--ink); }
.plain { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.plain li { margin-bottom: 6px; }

/* ---------- 数字卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: var(--deep); color: #fff; border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat b { font-size: 28px; color: #f0c987; line-height: 1.2; }
.stat span { font-weight: 700; }
.stat i { font-style: normal; font-size: 12.5px; color: #b9c0d4; }

/* ---------- 可弹的键盘 ---------- */
.keyboard-wrap {
  margin-top: 28px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px 24px; box-shadow: var(--shadow);
}
.kbd-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: baseline; }
.kbd-head h3 { margin: 0; color: var(--accent); font-size: 18px; }
.kbd-head p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.keyboard { position: relative; height: 160px; margin-top: 16px; display: flex; touch-action: manipulation; }
.key {
  border: 1px solid #cfc6b6; border-radius: 0 0 8px 8px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-bottom: 8px; font-size: 12px; color: #97907f; user-select: none;
}
.key.white { flex: 1; background: linear-gradient(#fff, #f6f2ea); }
.key.black {
  position: absolute; width: 8.4%; height: 60%; background: linear-gradient(#2a2f3d, #14171f);
  color: #98a0b6; border-color: #14171f; z-index: 2; border-radius: 0 0 6px 6px;
}
.key.on { background: linear-gradient(#ffe9c2, #f4cf94); color: #7a5a1d; }
.key.black.on { background: linear-gradient(#b4813c, #7d5620); color: #fff; }
.kbd-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }

/* ---------- 知识库列表 ---------- */
.know-list { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.know-list li { margin-bottom: 6px; }
.know-list .off { color: #a8552f; }

.foot { border-top: 1px solid var(--line); padding: 28px 24px 40px; text-align: center; background: var(--paper); }
.foot p { margin: 0 0 4px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .chat-card { position: static; }
  .know-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .portrait { gap: 12px; }
  .portrait img { width: 92px; height: 92px; flex-basis: 92px; border-width: 4px; }
}
