/* Ktao 个人站 V2 — Claude 暖色 × 卡通贴纸风,零依赖 */
:root {
  --bg: #faf5ee;
  --bg2: #f3ece1;
  --fg: #211d18;
  --muted: #7a7268;
  --line: #e3d9cb;
  --ink: #2b2620;
  --accent: #c4562e;   /* Claude 陶土橘 */
  --accent2: #e8a33d;  /* 芥末黄 */
  --accent3: #3e7c6f;  /* 墨绿 */
  --accent4: #7b5ea7;  /* 紫 */
  --card: #fffdf9;
  --code-bg: #f0e8db;
  --shadow: #2b2620;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140f;
    --bg2: #1e1a14;
    --fg: #ece5da;
    --muted: #9c9488;
    --line: #322c23;
    --ink: #ece5da;
    --accent: #e07a4d;
    --accent2: #e8b25c;
    --accent3: #5da895;
    --accent4: #a98fd6;
    --card: #201c15;
    --code-bg: #2a251d;
    --shadow: #000;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
header.site { padding: 18px 0; position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 50; border-bottom: 2px solid var(--ink); }
header.site .wrap { display: flex; justify-content: space-between; align-items: center; }
header.site .logo { font-weight: 800; color: var(--fg); font-size: 18px; letter-spacing: .5px; }
header.site .logo em { font-style: normal; color: var(--accent); }
header.site nav a { margin-left: 16px; color: var(--fg); font-size: 14px; font-weight: 600; }
header.site nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- 贴纸/徽章 ---------- */
.sticker {
  display: inline-block; padding: 4px 14px; font-size: 13.5px; font-weight: 700;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--card);
  box-shadow: 3px 3px 0 var(--shadow); transform: rotate(-1.5deg);
}
.sticker.s2 { transform: rotate(1.8deg); background: var(--accent2); color: #2b2013; border-color: var(--ink); }
.sticker.s3 { transform: rotate(-2.5deg); background: var(--accent3); color: #fff; }
.sticker.s4 { transform: rotate(2deg); background: var(--accent4); color: #fff; }
.sticker.s1 { background: var(--accent); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 40px; position: relative; }
.hero .wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; position: relative; }
.hero .txt { flex: 1 1 380px; }
.hero h1 { font-size: 40px; line-height: 1.25; letter-spacing: 1px; font-weight: 800; }
.hero h1 .hl { position: relative; white-space: nowrap; }
.hero h1 .hl svg { position: absolute; left: 0; bottom: -6px; width: 100%; height: 12px; }
.hero .sub { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 540px; }
.hero .stickers { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.avatar-box { flex: 0 0 236px; position: relative; }
.avatar-box::before {
  content: ""; position: absolute; z-index: 0;
  inset: 14% 4% 2% 2%;
  background: var(--accent2);
  border: 3px solid var(--ink);
  border-radius: 58% 42% 55% 45% / 52% 58% 42% 48%;
  transform: rotate(-4deg);
}
.avatar-box img.bot {
  position: relative; z-index: 1;
  width: 236px; height: auto; display: block;
  filter: drop-shadow(5px 6px 0 var(--shadow));
  animation: bob 3.5s ease-in-out infinite;
}
.avatar-box .avatar-tag { position: absolute; z-index: 2; bottom: -10px; left: 50%; margin-left: -42px; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg);} 50% { transform: translateY(-10px) rotate(1.5deg);} }

/* 漂浮涂鸦 */
.doodle { position: absolute; opacity: .85; pointer-events: none; animation: floaty 6s ease-in-out infinite; }
.doodle.d2 { animation-duration: 7.5s; animation-delay: -2s; }
.doodle.d3 { animation-duration: 5s; animation-delay: -1s; }
.doodle.d4 { animation-duration: 8s; animation-delay: -3s; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0deg);} 50% { transform: translateY(-14px) rotate(8deg);} }
@media (prefers-reduced-motion: reduce) { .doodle, .avatar-box img.bot, .marquee-inner { animation: none !important; } }

/* ---------- 跑马灯 ---------- */
.marquee { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--accent); color: #fff; overflow: hidden; padding: 8px 0; transform: rotate(-.6deg); margin: 26px 0 0; }
.marquee-inner { display: inline-block; white-space: nowrap; animation: scroll 22s linear infinite; font-weight: 700; font-size: 14.5px; letter-spacing: 1px; }
.marquee-inner span { margin: 0 14px; }
@keyframes scroll { from { transform: translateX(0);} to { transform: translateX(-50%);} }

/* ---------- 数据条 ---------- */
.stats { padding: 44px 0 8px; }
.stats .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 680px) { .stats .grid { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 16px 14px; text-align: center;
  transition: transform .15s;
}
.stat:nth-child(odd) { transform: rotate(-1deg); }
.stat:nth-child(even) { transform: rotate(1deg); }
.stat:hover { transform: rotate(0) translateY(-4px); }
.stat b { display: block; font-size: 26px; color: var(--accent); font-weight: 800; }
.stat i { font-style: normal; font-size: 13px; color: var(--muted); }

/* ---------- 分区 ---------- */
section { padding: 52px 0; position: relative; }
section h2 { font-size: 24px; margin-bottom: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
section h2 .spark { width: 22px; height: 22px; flex: 0 0 22px; }
section h2 .en { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 2px; margin-left: 6px; }
.wave { display: block; width: 100%; height: 24px; }

.prose p { margin-bottom: 14px; }
.prose strong { color: var(--accent); font-weight: 700; }

/* ---------- 卡片 ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
  padding: 22px; display: block; color: var(--fg);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.card:hover { transform: translate(-2px,-4px) rotate(-.5deg); box-shadow: 8px 9px 0 var(--shadow); text-decoration: none; }
.card h3 { font-size: 16.5px; margin-bottom: 8px; font-weight: 800; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.65; }
.card .tag { display: inline-block; margin-top: 12px; font-size: 12.5px; color: var(--accent); font-weight: 700; }
.card .corner { position: absolute; top: -12px; right: 14px; }

/* ---------- 时间线 ---------- */
.timeline { border-left: 3px solid var(--ink); margin-left: 8px; padding-left: 26px; }
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-item::before {
  content: ""; position: absolute; left: -36px; top: 6px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--accent2); border: 3px solid var(--ink);
}
.tl-item:nth-child(2)::before { background: var(--accent); }
.tl-item:nth-child(3)::before { background: var(--accent3); }
.tl-item:nth-child(4)::before { background: var(--accent4); }
.tl-item:nth-child(5)::before { background: var(--accent2); }
.tl-item .when { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.tl-item h3 { font-size: 16px; margin: 2px 0 4px; font-weight: 800; }
.tl-item p { font-size: 14.5px; color: var(--muted); }

/* ---------- 便利贴墙 ---------- */
.wall {
  border: 3px solid var(--ink); border-radius: 18px;
  background:
    radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1.2px, transparent 1.3px),
    var(--bg2);
  background-size: 22px 22px;
  box-shadow: 6px 6px 0 var(--shadow), inset 0 0 40px color-mix(in srgb, var(--ink) 8%, transparent);
  padding: 26px 22px 30px;
  margin-top: 8px;
}
.wall + .wall { margin-top: 26px; }
.wall .wall-title {
  display: inline-block; font-size: 15px; font-weight: 800;
  background: var(--ink); color: var(--bg); padding: 4px 16px;
  border-radius: 6px; transform: rotate(-1.2deg); margin: -40px 0 18px 6px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.wall-notes { columns: 3 220px; column-gap: 16px; }
.note {
  display: inline-block; width: 100%; break-inside: avoid; margin-bottom: 16px;
  padding: 34px 15px 16px; position: relative;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", var(--fallback, sans-serif);
  font-size: 15.5px; font-weight: 700; line-height: 1.6; color: #2b2418;
  --paper: #ffe98f; --paper-dk: #f0d264;
  /* 纸纤维噪点 + 自然光照(顶部微亮→底部微暗) */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(178deg,
      color-mix(in srgb, var(--paper) 82%, #fff) 0%,
      var(--paper) 45%,
      var(--paper-dk) 100%);
  /* 贴合阴影 + 底部翘起投影 */
  box-shadow:
    0 1px 2px rgba(31, 26, 18, .16),
    2px 9px 14px -6px rgba(31, 26, 18, .38);
  transition: transform .18s;
  border-radius: 1px 1px 3px 1px;
}
.note:hover { transform: rotate(0deg) scale(1.04) !important; z-index: 3; }
.note small { display: block; font-weight: 500; font-size: 12.5px; margin-top: 6px; opacity: .8; line-height: 1.55; }
/* 便利贴纸色 */
.note.p1 { --paper: #ffe98f; --paper-dk: #efd063; }
.note.p2 { --paper: #ffcdb0; --paper-dk: #f2b088; }
.note.p3 { --paper: #cfe7d1; --paper-dk: #adcfb2; }
.note.p4 { --paper: #ddd0f0; --paper-dk: #c2afdd; }
.note.p5 { --paper: #cfe2f4; --paper-dk: #abc9e4; }
/* 右下卷角:翻起的纸背 + 折痕阴影 */
.note::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px;
  background: linear-gradient(to top left,
    color-mix(in srgb, var(--paper) 55%, #fff) 0%,
    color-mix(in srgb, var(--paper) 78%, #fff) 42%,
    rgba(31, 26, 18, .14) 49%,
    transparent 52%);
  filter: drop-shadow(-2px -2px 2px rgba(31, 26, 18, .10));
  border-radius: 0 0 3px 0;
}
/* 胶带:半透明米色,带高光和毛边 */
.note.tape::before {
  content: ""; position: absolute; top: 7px; left: 50%; width: 84px; height: 21px;
  margin-left: -42px; transform: rotate(-3deg);
  background: linear-gradient(180deg,
    rgba(255, 252, 240, .62) 0%,
    rgba(248, 240, 214, .48) 45%,
    rgba(240, 228, 190, .58) 100%);
  box-shadow: 0 1px 2px rgba(31, 26, 18, .10), inset 0 0 6px rgba(255, 255, 255, .5);
  border-left: 1px dashed rgba(120, 100, 60, .25);
  border-right: 1px dashed rgba(120, 100, 60, .25);
}
/* 图钉 */
.note.pin::before {
  content: ""; position: absolute; top: 10px; left: 50%; width: 15px; height: 15px; margin-left: -7px;
  border-radius: 50%; background: radial-gradient(circle at 35% 32%, #ff8a72, var(--accent) 65%);
  border: 2px solid var(--ink); box-shadow: 0 3px 3px rgba(0,0,0,.3);
}
/* 随机歪斜 */
.note:nth-child(6n+1) { transform: rotate(-2.4deg); }
.note:nth-child(6n+2) { transform: rotate(1.6deg); }
.note:nth-child(6n+3) { transform: rotate(-1deg); }
.note:nth-child(6n+4) { transform: rotate(2.6deg); }
.note:nth-child(6n+5) { transform: rotate(-1.8deg); }
.note:nth-child(6n)   { transform: rotate(1.1deg); }
@media (prefers-color-scheme: dark) {
  .note { color: #2b2418; }
  .wall { background: radial-gradient(rgba(255,255,255,.10) 1.2px, transparent 1.3px), var(--bg2); background-size: 22px 22px; }
}

/* ---------- 技能 ---------- */
.skills .group { margin-bottom: 18px; }
.skills .group h4 { font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.skills ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.skills li {
  background: var(--card); border: 2px solid var(--ink); border-radius: 8px;
  padding: 4px 12px; font-size: 14px; font-weight: 600;
  box-shadow: 2px 2px 0 var(--shadow);
}
.skills li:hover { transform: translateY(-2px); }

/* ---------- 联系 ---------- */
.contact-box {
  border: 2px solid var(--ink); border-radius: 16px; background: var(--card);
  box-shadow: 6px 6px 0 var(--shadow); padding: 28px; text-align: center;
}
.contact-box .btn {
  display: inline-block; margin-top: 14px; background: var(--accent); color: #fff;
  border: 2px solid var(--ink); border-radius: 999px; padding: 10px 26px;
  font-weight: 800; box-shadow: 3px 3px 0 var(--shadow); transition: transform .15s;
}
.contact-box .btn:hover { transform: translateY(-3px) rotate(-1deg); text-decoration: none; }

/* ---------- 留言表单 ---------- */
.msg-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 34px; }
.msg-form input, .msg-form textarea {
  border: 2px solid var(--ink); border-radius: 10px; background: var(--card); color: var(--fg);
  padding: 10px 14px; font-size: 15px; font-family: inherit; box-shadow: 3px 3px 0 var(--shadow);
  outline: none; resize: vertical;
}
.msg-form input:focus, .msg-form textarea:focus { border-color: var(--accent); }
.msg-form-row { display: flex; justify-content: space-between; align-items: center; }
.msg-count { font-size: 12.5px; color: var(--muted); }
.msg-form button {
  background: var(--accent); color: #fff; border: 2px solid var(--ink); border-radius: 999px;
  padding: 8px 22px; font-size: 14.5px; font-weight: 800; cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow); transition: transform .15s;
}
.msg-form button:hover:not(:disabled) { transform: translateY(-2px) rotate(-1deg); }
.msg-form button:disabled { opacity: .6; cursor: wait; }

.btn-pill {
  display: inline-block; background: var(--accent); color: #fff;
  border: 2px solid var(--ink); border-radius: 999px; padding: 10px 28px;
  font-weight: 800; font-size: 15px; box-shadow: 3px 3px 0 var(--shadow); transition: transform .15s;
}
.btn-pill:hover { transform: translateY(-3px) rotate(-1deg); text-decoration: none; }

footer.site { padding: 36px 0 60px; border-top: 2px solid var(--ink); color: var(--muted); font-size: 14px; }

.mobile-hint { display: none; }

/* ---------- 移动端 ---------- */
@media (max-width: 620px) {
  .mobile-hint { display: inline; }
  header.site nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-left: 12px; }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a { margin-left: 12px; font-size: 13px; }
  header.site nav a:first-child { margin-left: 0; }
  .hero { padding: 44px 0 28px; }
  .hero h1 { font-size: 30px; }
  .hero .sub { font-size: 15.5px; }
  .avatar-box { margin: 8px auto 0; }
  .doodle { display: none; }
  section { padding: 40px 0; }
  section h2 { font-size: 21px; }
  .stat b { font-size: 21px; }
  .wall { padding: 22px 12px 22px; }
  .wall .wall-title { margin-top: -36px; font-size: 13.5px; }
  /* 便利贴:两列偏方形,正文省略,点击展开 */
  .wall-notes { columns: 2; column-gap: 10px; }
  .note { padding: 24px 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 10px; cursor: pointer; }
  .note small { font-size: 11px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .note .note-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .note.open small, .note.open .note-body { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .note.tape::before { width: 54px; height: 13px; margin-left: -27px; top: 6px; }
  .note.pin::before { width: 12px; height: 12px; margin-left: -6px; top: 7px; }
  .note:hover { transform: none; }
  .contact-box { padding: 20px 14px; }
  .contact-box .btn { font-size: 13.5px; padding: 9px 16px; }
}

/* ---------- 滚动浮现 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 案例页 ---------- */
.case-hero { padding: 56px 0 8px; }
.case-hero .crumb { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.case-hero h1 { font-size: 28px; line-height: 1.35; font-weight: 800; }
.case-hero .facts { margin: 18px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.case-hero .facts span { border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; background: var(--card); box-shadow: 2px 2px 0 var(--shadow); font-weight: 600; }
article.case { padding: 32px 0 56px; }
article.case h2 { font-size: 19px; margin: 32px 0 12px; font-weight: 800; }
article.case p, article.case li { margin-bottom: 10px; }
article.case ul { padding-left: 22px; margin-bottom: 14px; }
article.case .callout {
  border: 2px solid var(--ink); border-left: 6px solid var(--accent); background: var(--code-bg);
  padding: 14px 18px; border-radius: 10px; margin: 20px 0; font-size: 15px;
  box-shadow: 4px 4px 0 var(--shadow);
}
code { background: var(--code-bg); border-radius: 4px; padding: 1px 6px; font-size: 14px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }

/* ---------- 简历页(保持克制,可打印) ---------- */
.resume { padding: 48px 0 64px; }
.resume h1 { font-size: 26px; }
.resume .headline { color: var(--muted); margin-top: 6px; }
.resume .contact { font-size: 14px; color: var(--muted); margin-top: 10px; }
.resume .contact span { margin-right: 14px; }
.resume h2 { font-size: 17px; margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.resume .item { margin-bottom: 18px; }
.resume .item .row { display: flex; justify-content: space-between; flex-wrap: wrap; }
.resume .item h3 { font-size: 15px; font-weight: 700; }
.resume .item .time { font-size: 13px; color: var(--muted); }
.resume .item .role { font-size: 14px; color: var(--accent); margin: 2px 0 6px; }
.resume .item ul { padding-left: 20px; font-size: 14.5px; }
.resume .item li { margin-bottom: 4px; }
.resume .skills-line { font-size: 14.5px; margin-bottom: 6px; }
.resume .skills-line b { font-weight: 700; }
.toolbar { padding: 18px 0 0; display: flex; gap: 12px; }
.toolbar button {
  background: var(--accent); color: #fff; border: 2px solid var(--ink); border-radius: 10px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; font-weight: 700;
  box-shadow: 3px 3px 0 var(--shadow);
}
.toolbar button.ghost { background: transparent; color: var(--accent); }

@media print {
  header.site, footer.site, .toolbar { display: none !important; }
  :root { --bg: #fff; --fg: #111; --muted: #555; --line: #ddd; --accent: #8a3d1e; --code-bg: #f5f5f5; --card: #fff; --ink: #333; --shadow: transparent; }
  body { font-size: 13px; line-height: 1.55; }
  .resume { padding: 0; }
  .wrap { max-width: 100%; padding: 0; }
  a { color: inherit; }
}
