:root {
  --ink: #0e0e10;
  --muted: #5e5e68;
  --line: #ececef;
  --card: #f3f3f5;
  --accent: #8574da;
  --dot: #7b6cf6;
  --green: #2bb673;
  --tag-bg: #efebfd;
  --tag-ink: #4b3fb0;
  --wire: #9b9ca6;
  font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #fff; }
a { color: var(--ink); }
a:hover { color: #6a5bd6; }
img { display: block; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 小标签：全大写 + 圆点 */
.eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 500; letter-spacing: 1.8px; color: var(--muted);
}
.eyebrow::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--dot); }
.eyebrow.green::before { background: var(--green); }
.micro { font-size: 9px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); }

.tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-ink);
}

.btn {
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid #dcdce2;
  background: #fff; font-size: 13px; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { color: #fff; background: #2a2a30; }

/* 马卡龙底色 */
.tone-lav { background: linear-gradient(160deg, #eeeaf9, #d6cef0); }
.tone-sun { background: linear-gradient(160deg, #f4d58c, #e5b35a); }
.tone-pink { background: linear-gradient(160deg, #f7d6ee, #e7b5de); }
.tone-sky { background: linear-gradient(160deg, #e1ebfb, #c2d5f3); }
.tone-mint { background: linear-gradient(160deg, #e2f4eb, #bfe5d2); }
.holo { background: linear-gradient(135deg, #d7f3e6 0%, #e4ddfb 38%, #f8d8ec 68%, #fff0c7 100%); }

/* 页头 */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.logo::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; font-weight: 500; letter-spacing: 1.6px; }
.nav a { padding: 14px 12px; text-decoration: none; color: var(--muted); }
.nav a[aria-current='page'] { color: var(--ink); }

/* 首页标题区 */
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 32px; padding-top: 24px; }
.hero h1, .profile-head h1 { margin: 20px 0 0; font-weight: 400; letter-spacing: -2.4px; line-height: 1.08; font-size: clamp(40px, 6vw, 64px); }
.hero h1 span, .profile-head h1 span, .panel h2 span, .page-title span { color: var(--accent); }
.hero-side { max-width: 280px; display: flex; flex-direction: column; gap: 16px; padding-top: 32px; }
.hero-side p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); }

/* 悬挂卡片 */
.rack { overflow-x: auto; margin: 32px -32px 0; padding: 0 32px; scrollbar-width: none; }
.rack::-webkit-scrollbar { display: none; }
.rack-inner { position: relative; min-width: 960px; padding: 8px 0 48px; }
.wire { position: absolute; left: 2%; top: 0; width: 96%; height: 40px; }
.cards { position: relative; display: flex; justify-content: center; gap: 64px; padding-top: 14px; }
.hanger { width: 272px; display: flex; flex-direction: column; align-items: center; }
.pin { width: 9px; height: 9px; border-radius: 50%; background: #b4b5bf; margin-top: -4px; }
.string { width: 1px; background: var(--wire); }
.clip {
  width: 22px; height: 14px; border-radius: 6px 6px 3px 3px; background: #c3c4cd;
  display: flex; align-items: center; justify-content: center; margin-bottom: -6px; position: relative; z-index: 2;
}
.clip::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
/* 摆动：绳子和卡片一起绕钉子转，角度由 motion.js 的物理模拟写入 --swing */
.swing { width: 272px; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 0; transform: rotate(var(--swing, 0deg)); will-change: transform; }
/* 悬停倾斜：跟随鼠标的 3D 倾斜，由 motion.js 写入 --rx / --ry */
.tilt { width: 272px; perspective: 900px; }
.tilt-inner { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .25s ease-out; }

.flip { position: relative; width: 272px; transition: transform .9s cubic-bezier(.34, 1.45, .5, 1); transform-style: preserve-3d; }
.flip.on { transform: rotateY(180deg); }
.flip .back, .flip.on .card-front { pointer-events: none; }
.flip.on .back { pointer-events: auto; }

/* 悬停时的镭射光泽，位置跟随鼠标（--mx / --my） */
.shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 45%),
    linear-gradient(115deg, rgba(167, 243, 208, 0) 20%, rgba(167, 243, 208, .35) 35%, rgba(196, 181, 253, .4) 50%, rgba(249, 168, 212, .35) 65%, rgba(253, 230, 138, 0) 80%);
  background-size: 100% 100%, 250% 250%;
  background-position: 0 0, var(--sx, 50%) var(--sy, 50%);
  mix-blend-mode: soft-light;
}
.card-front:hover .shine, .card-back:hover .shine, .badge:hover .shine { opacity: 1; }
.card-front, .card-back, .badge { position: relative; }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.back { position: absolute; inset: 0; transform: rotateY(180deg); }

.card-front {
  width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 12px;
  border-radius: 20px; border: 1px solid #e8e8ec; background: var(--card);
  box-shadow: 0 18px 40px rgba(20, 20, 40, .08); text-align: left; cursor: pointer; transition: box-shadow .3s;
}
.card-front:hover { box-shadow: 0 26px 50px rgba(20, 20, 40, .14); }
.card-front:hover .arrow { transform: rotate(45deg); }
.card-top { display: flex; justify-content: space-between; font-size: 8px; font-weight: 600; letter-spacing: 1.4px; color: var(--muted); }
.photo { position: relative; height: 236px; border-radius: 14px; overflow: hidden; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-name { display: flex; flex-direction: column; gap: 2px; padding: 4px 2px 0; }
.card-name strong { font-size: 19px; font-weight: 500; letter-spacing: -.4px; }
.card-name span { font-size: 12px; color: var(--muted); }
.rule { height: 1px; background: #e2e2e7; margin: 6px 0 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; font-size: 8px; font-weight: 600; letter-spacing: 1.4px; }
.arrow {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink);
  display: flex; align-items: center; justify-content: center; transition: transform .3s;
}

.card-back {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: 20px; border: 1px solid #e8e8ec; box-shadow: 0 18px 40px rgba(20, 20, 40, .1);
}
.card-back .card-top { color: #4a4a55; }
.mini { display: flex; align-items: center; gap: 10px; }
.mini img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.mini strong { display: block; font-size: 14px; font-weight: 600; }
.mini span { font-size: 10px; color: #4a4a55; }
.latest { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; padding-top: 4px; }
.latest-item { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid rgba(14, 14, 16, .08); }
.latest-item .micro { color: #4a4a55; font-size: 8px; letter-spacing: 1.2px; }
.latest-item p { margin: 0; font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.latest-empty { font-size: 12px; color: #4a4a55; line-height: 1.6; }
.back-foot { display: flex; align-items: center; justify-content: space-between; }
.back-foot a { font-size: 9px; font-weight: 600; letter-spacing: 1.4px; padding: 10px 0; }
.back-foot button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(14, 14, 16, .2); background: rgba(255, 255, 255, .6); font-size: 10px; cursor: pointer; }

/* 展开的动态面板 */
.panel { border-radius: 28px; border: 1px solid var(--line); background: #fafafb; padding: 32px; display: flex; flex-wrap: wrap; gap: 32px; }
.panel[hidden] { display: none; }
.panel-side { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-size: 40px; font-weight: 400; letter-spacing: -1.4px; line-height: 1.15; }
.panel-side p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.panel-list { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }

/* 动态条目 */
.post { display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.post-date { flex: 0 0 72px; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; font-size: 10px; letter-spacing: 1.2px; }
.post-date b { font-weight: 600; }
.post-date span { color: var(--muted); }
.post-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.post h3 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.2px; line-height: 1.5; }
.post p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted); white-space: pre-line; }
.post-source { font-size: 9px; font-weight: 600; letter-spacing: 1.4px; padding: 4px 0; }
.post-thumb { flex: 0 0 120px; height: 90px; border-radius: 12px; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.empty { padding: 28px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.8; }
.error { color: #b0245a; }

/* 今日更新 */
.feed { display: flex; flex-direction: column; gap: 8px; padding-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 32px; font-weight: 400; letter-spacing: -1px; }
.row { display: flex; align-items: center; gap: 20px; padding: 18px 4px; border-top: 1px solid var(--line); text-decoration: none; flex-wrap: wrap; }
.row-time { flex: 0 0 64px; font-size: 11px; color: var(--muted); }
.row-name { flex: 0 0 110px; font-size: 14px; font-weight: 500; }
.row-title { flex: 1 1 280px; min-width: 0; font-size: 15px; }
.row-go { font-size: 16px; color: var(--muted); }
.more { align-self: center; margin-top: 24px; }

main { display: flex; flex-direction: column; gap: 32px; padding-bottom: 80px; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 32px; padding-bottom: 32px; font-size: 9px; font-weight: 500; letter-spacing: 1.8px; color: var(--muted); }

/* CP 主页 */
.profile-head { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; justify-content: space-between; padding-top: 24px; }
.profile-text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-top: 24px; }
.profile-head h1 { margin: 0; font-size: clamp(44px, 5vw, 64px); letter-spacing: -2.8px; line-height: 1.05; }
.profile-text > p { margin: 0; max-width: 460px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.stats { display: flex; gap: 32px; flex-wrap: wrap; padding-top: 12px; }
.stats div { display: flex; flex-direction: column; gap: 4px; }
.stats strong { font-size: 28px; font-weight: 400; letter-spacing: -.8px; }
.badge-hang { flex: 0 0 300px; display: flex; flex-direction: column; align-items: center; }
.badge { width: 268px; padding: 16px; border-radius: 22px; border: 1px solid #e8e8ec; box-shadow: 0 24px 50px rgba(20, 20, 40, .12); display: flex; flex-direction: column; gap: 12px; }
.badge .card-top { color: #4a4a55; }
.badge strong { font-size: 20px; font-weight: 500; letter-spacing: -.4px; }
.badge .sub { font-size: 12px; color: #4a4a55; }

/* 日程日历 */
.cal { flex: 0 1 340px; min-width: 280px; margin-top: 24px; padding: 20px; border-radius: 22px; background: var(--card); display: flex; flex-direction: column; gap: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-switch { display: flex; align-items: center; gap: 4px; }
.cal-month { font-size: 13px; font-weight: 500; min-width: 76px; text-align: center; }
.cal-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #dcdce2; background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-wd { font-size: 10px; color: var(--muted); padding: 4px 0; }
.cal-day { height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; border: none; background: transparent; padding: 0; }
.cal-day.past { color: #a2a2ab; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.cal-day.has { position: relative; cursor: pointer; background: linear-gradient(135deg, #e4ddfb, #f8d8ec); font-weight: 600; color: var(--ink); }
.cal-day.has::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--dot); }
.cal-day.has:hover { background: linear-gradient(135deg, #d6cef0, #f2c8e6); }
.cal-day.sel { background: var(--ink); color: #fff; }
.cal-day.sel::after { background: #fff; }
.cal-sub { padding-top: 4px; border-top: 1px solid #e2e2e7; padding-top: 12px; }
.cal-list { display: flex; flex-direction: column; gap: 4px; }
.cal-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; text-decoration: none; }
.stamp {
  flex: 0 0 auto; width: 40px; padding: 4px 0; text-align: center; background: #fff;
  border: 1.5px dotted #b4b5bf; border-radius: 6px; display: flex; flex-direction: column;
}
.stamp small { font-size: 9px; color: var(--muted); }
.stamp b { font-size: 16px; font-weight: 600; line-height: 1.1; }
.cal-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-text strong { font-size: 13px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-text span { font-size: 11px; color: var(--muted); }
.cal-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-top: 48px; }
.tabs button {
  height: 48px; padding: 0 14px; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; font-size: 11px; font-weight: 500; letter-spacing: 1.6px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected='true'] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }

.profile-main { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-top: 32px; }
.profile-feed { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.box { padding: 22px; border-radius: 22px; background: var(--card); display: flex; flex-direction: column; }
.box h2 { margin: 0 0 10px; }
.fact { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 11px 0; border-top: 1px solid #e2e2e7; }
.fact span:first-child { color: var(--muted); }
.fact span:last-child { text-align: right; }
.other { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 6px 0; }
.other img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.other strong { flex-grow: 1; font-size: 14px; font-weight: 500; }
.other .arrow { color: #fff; font-size: 12px; }

/* 自动更新：新条目滑入，底色慢慢褪掉 */
.fresh { animation: slide-in .6s cubic-bezier(.2, .8, .2, 1), fresh-bg 4s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fresh-bg { 0%, 40% { background-color: #f4f1fe; } 100% { background-color: transparent; } }
.latest.fresh, .cal.fresh { animation: fade-in .5s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 有新动态的卡片：右上角亮一个小点 */
.new-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px rgba(123, 108, 246, .18); opacity: 0; transform: scale(.4); transition: opacity .4s, transform .4s; pointer-events: none; }
.card-front.has-new .new-dot { opacity: 1; transform: none; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; letter-spacing: .6px;
  box-shadow: 0 12px 30px rgba(20, 20, 40, .2); transition: opacity .35s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 一行放不下名字、日历、工牌时：工牌跟在名字后面，日历放到它们下面 */
@media (max-width: 1200px) {
  .badge-hang { order: 1; }
  .cal { order: 2; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .rack { margin: 24px -16px 0; padding: 0 16px; }
  .panel { padding: 20px; }
  .post-thumb { flex-basis: 80px; height: 64px; }
  .post-date { flex-basis: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .flip, .tilt-inner { transition: none; }
  .shine { display: none; }
  .fresh, .latest.fresh { animation: none; }
}
