/* ============================================================
   宝藏水仙 · 主页样式 (home.css)
   ★ BUILD: 2026-10-03 v8 (浅绿清新 + 原神 UI 结构感) ★
   ============================================================ */

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

:root {
  /* ===== 背景：浅绿清新 ===== */
  --bg: #f4faf6;
  --bg-elev: #ffffff;
  --bg-subtle: #eaf5ee;
  --bg-grad-top: #f7fcf9;
  --bg-grad-bottom: #ecf7f0;

  /* ===== 卡片 ===== */
  --card-bg: #ffffff;
  --card-border: rgba(26, 51, 40, 0.08);
  --card-border-hover: rgba(45, 138, 95, 0.28);
  --card-shadow:
    0 1px 2px rgba(26, 51, 40, 0.03),
    0 4px 16px rgba(26, 51, 40, 0.04);
  --card-shadow-hover:
    0 2px 4px rgba(26, 51, 40, 0.04),
    0 12px 32px rgba(45, 138, 95, 0.1);

  /* ===== 文字 ===== */
  --text: #1a3328;
  --text-mid: #3d5f4d;
  --text-dim: #7a9484;

/* ===== 主色：清新草绿 ===== */
--green: #3ea86c;
--green-deep: #2d8a5f;
--green-soft: rgba(62, 168, 108, 0.1);
--green-glow: rgba(62, 168, 108, 0.2);

  /* ===== 辅色：芙宁娜蓝 ===== */
  --hydro: #4a90d9;
  --hydro-deep: #3570b3;
  --hydro-soft: rgba(74, 144, 217, 0.08);
  --hydro-glow: rgba(74, 144, 217, 0.18);

  /* ===== 原神 UI 结构色 ===== */
  --ui-line: rgba(45, 138, 95, 0.35);
  --ui-line-soft: rgba(45, 138, 95, 0.15);

  /* ===== 稀有度色（原神风格）===== */
  --rarity-3: #5a9bd4;    /* 三星：蓝 */
  --rarity-4: #a06cd5;    /* 四星：紫 */
  --rarity-5: #d4a24e;    /* 五星：金 */

  /* ===== 间距 ===== */
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;

  --radius: 14px;
  --radius-sm: 10px;

  /* ===== 控件 ===== */
  --ctrl-bg: #ffffff;
  --ctrl-border: rgba(26, 51, 40, 0.1);
  --ctrl-hover: #f4faf6;

  /* ===== 字体 ===== */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans SC", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Songti SC", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco,
          "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;

  --transition: 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  --transition-fast: 0.18s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ===== 深色模式 ===== */
html.dark {
  --bg: #0d1a14;
  --bg-elev: #14261d;
  --bg-subtle: #1a2e23;
  --bg-grad-top: #102018;
  --bg-grad-bottom: #0d1a14;

  --card-bg: #14261d;
  --card-border: rgba(120, 200, 160, 0.12);
  --card-border-hover: rgba(74, 232, 160, 0.35);
  --card-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.25);
  --card-shadow-hover:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 12px 32px rgba(45, 138, 95, 0.2);

  --text: #e6f4ec;
  --text-mid: #a8c4b4;
  --text-dim: #6a8a78;

  --green: #4ae8a0;
  --green-deep: #2ed488;
  --green-soft: rgba(74, 232, 160, 0.1);
  --green-glow: rgba(74, 232, 160, 0.22);

  --hydro: #6cb0f0;
  --hydro-deep: #4a90d9;
  --hydro-soft: rgba(108, 176, 240, 0.1);
  --hydro-glow: rgba(108, 176, 240, 0.22);

  --ui-line: rgba(120, 200, 160, 0.4);
  --ui-line-soft: rgba(120, 200, 160, 0.18);

  --ctrl-bg: #1a2e23;
  --ctrl-border: rgba(120, 200, 160, 0.15);
  --ctrl-hover: #223a2c;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a { text-decoration: none; color: inherit; }

/* ===== 顶部品牌线 ===== */
.brand-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green) 0%, var(--hydro) 50%, var(--green) 100%);
  background-size: 200% auto;
  z-index: 100;
  animation: brandFlow 8s linear infinite;
}

@keyframes brandFlow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ===== 背景层 ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg) 50%, var(--bg-grad-bottom) 100%);
}

.bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 138, 95, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 138, 95, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 90%);
}

html.dark .bg-layer::after {
  background-image:
    linear-gradient(rgba(120, 200, 160, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 160, 0.03) 1px, transparent 1px);
}

/* ===== 右上角控制栏 ===== */
.top-controls {
  position: fixed;
  top: 20px;
  right: max(20px, calc((100vw - 1100px) / 2 + 24px));
  z-index: 200;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ctrl-btn {
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  background: var(--ctrl-bg);
  border: 1px solid var(--ctrl-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(26, 51, 40, 0.04);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:hover {
  background: var(--ctrl-hover);
  color: var(--green-deep);
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--green-glow);
}

.ctrl-btn:active { transform: translateY(0) scale(0.98); }
.ctrl-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--ctrl-border);
  background: var(--ctrl-bg);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.login-btn:hover {
  background: var(--ctrl-hover);
  color: var(--green-deep);
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--green-glow);
}

.login-btn.logged-in {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.theme-btn {
  width: 38px;
  padding: 0;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.theme-btn .icon-sun,
.theme-btn .icon-moon {
  position: absolute;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-btn .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

html.dark .theme-btn .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
html.dark .theme-btn .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  height: 38px;
  background: var(--ctrl-bg);
  border: 1px solid var(--ctrl-border);
  border-radius: 10px;
  gap: 2px;
}

.lang-opt {
  padding: 0 12px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-opt:hover { color: var(--text); }

.lang-opt.active {
  background: var(--green);
  color: #fff;
}

/* ===== 容器与布局 ===== */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 24px 80px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
}

@media (min-width: 880px) {
  .layout {
    grid-template-columns: 340px 1fr;
    gap: 48px;
    align-items: start;
  }
  .col-left, .col-right { align-self: start; min-width: 0; }
}

/* ============================================================
   角隅装饰（原神卡片风格）
   ============================================================ */
.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 2;
  transition: opacity var(--transition);
}

.corner-tl {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--green);
  border-left: 2px solid var(--green);
  border-top-left-radius: var(--radius);
  opacity: 0.55;
}

.corner-tr {
  top: -1px;
  right: -1px;
  border-top: 2px solid var(--hydro);
  border-right: 2px solid var(--hydro);
  border-top-right-radius: var(--radius);
  opacity: 0.55;
}

.corner-bl {
  bottom: -1px;
  left: -1px;
  border-bottom: 2px solid var(--hydro);
  border-left: 2px solid var(--hydro);
  border-bottom-left-radius: var(--radius);
  opacity: 0.35;
}

.corner-br {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--green);
  border-right: 2px solid var(--green);
  border-bottom-right-radius: var(--radius);
  opacity: 0.55;
}

.identity:hover .corner { opacity: 0.9; }

/* ============================================================
   身份卡
   ============================================================ */
.identity {
  padding: var(--sp-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.identity:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.identity-top {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  position: relative;
  z-index: 1;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px dashed var(--hydro);
  opacity: 0.4;
  pointer-events: none;
  animation: ringSpin 24s linear infinite;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.avatar {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 70% 25%;
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 1.5px var(--hydro);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: block;
  background: var(--hydro-soft);
}

.avatar:hover { transform: scale(1.05) rotate(-2deg); }

/* ★ 头像右下角小星星徽章（原神好感度感） */
.avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd97a, #d4a24e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-bg);
  box-shadow: 0 2px 6px rgba(212, 162, 78, 0.35);
  z-index: 3;
}

.identity-text {
  min-width: 0;
  flex: 1;
}

.name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--text);
}

.tagline {
  font-size: 12.5px;
  color: var(--text-mid);
  font-weight: 400;
  line-height: 1.6;
}

.tagline .dot {
  color: var(--green);
  margin: 0 5px;
  font-weight: 600;
}

/* ★ 元素徽章（原神元素标签） */
.element-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.elem-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid;
}

.elem-hydro {
  background: rgba(74, 144, 217, 0.08);
  color: var(--hydro-deep);
  border-color: rgba(74, 144, 217, 0.3);
}

.elem-star {
  background: rgba(212, 162, 78, 0.08);
  color: #a47a2e;
  border-color: rgba(212, 162, 78, 0.3);
}

html.dark .elem-hydro { color: var(--hydro); }
html.dark .elem-star { color: #ffd97a; }

/* ===== 主标语 ===== */
.slogan {
  display: block;
  margin: 22px 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--text);
}

.slogan-text {
  position: relative;
  display: inline-block;
  padding: 0 6px;
  z-index: 1;
}

.slogan-text::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 4px;
  right: 0;
  height: 38%;
  background: linear-gradient(90deg, var(--green-soft), rgba(74, 144, 217, 0.12));
  border-radius: 3px;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.slogan-wrap-visible .slogan-text::before,
.slogan:hover .slogan-text::before {
  transform: scaleX(1);
}

/* ===== 数字统计 ===== */
.identity-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--card-border);
  position: relative;
}

.stat {
  position: relative;
  padding-left: 12px;
}

.stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--green);
  opacity: 0.25;
  border-radius: 2px;
}

.stat:nth-child(2)::before { background: var(--hydro); opacity: 0.35; }
.stat:nth-child(3)::before { background: var(--green); opacity: 0.35; }

.stat-num {
  display: inline;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.3px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-suffix {
  display: inline;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  margin-left: 1px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ===== 区块标题（原神三段式装饰）===== */
.block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: var(--sp-md);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* ★ 三段式：短-长-短 */
.block-title::before {
  content: '';
  width: 14px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 20px 0 0 -0.5px var(--green);
}

.block-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--ui-line-soft), transparent);
}

/* ===== 左栏块 ===== */
.side-block { margin-top: var(--sp-xl); }

.about-text {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.9;
}

.about-text p { margin-bottom: 12px; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-text .hl {
  color: var(--green-deep);
  font-weight: 600;
  background: var(--green-soft);
  padding: 1px 6px;
  border-radius: 4px;
}

html.dark .about-text .hl { color: var(--green); }

/* ===== 友情链接卡片 ===== */
.friend-card {
  display: block;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--hydro);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.friend-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
  border-left-color: var(--hydro-deep);
}

.friend-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.friend-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--hydro-deep);
  background: var(--hydro-soft);
  transition: transform var(--transition), background var(--transition);
}
.friend-card:hover .friend-logo {
  transform: scale(1.06);
  background: var(--hydro-glow);
}
.friend-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.friend-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}
.friend-sub {
  font-size: 11.5px;
  color: var(--hydro-deep);
  font-weight: 500;
}
.friend-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-dim);
  background: var(--bg-subtle);
  transition: transform var(--transition), color var(--transition), background var(--transition);
}
.friend-card:hover .friend-go {
  transform: translate(2px, -2px);
  color: #fff;
  background: var(--hydro);
}

.friend-desc {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-mid);
  margin-bottom: 10px;
}

.friend-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.friend-tag {
  font-size: 11px;
  line-height: 1.6;
  padding: 2px 9px;
  border-radius: 20px;
  color: var(--hydro-deep);
  background: var(--hydro-soft);
  border: 1px solid transparent;
}
html.dark .friend-tag { color: var(--hydro); }

/* ===== 技术栈标签 ===== */
.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill {
  background: transparent;
  border: 1px solid var(--card-border);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-mid);
  transition: all var(--transition-fast);
  cursor: default;
  font-weight: 500;
}

.skill:hover {
  background: var(--green-soft);
  color: var(--green-deep);
  border-color: var(--green);
  transform: translateY(-1px);
}

html.dark .skill:hover { color: var(--green); }

/* ===== 正在做 ===== */
.doing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-reset: doing;
}

.doing-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--text-mid);
}

.doing-list li::before {
  content: counter(doing, decimal-leading-zero);
  counter-increment: doing;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  opacity: 0.7;
  flex-shrink: 0;
  width: 20px;
  letter-spacing: -0.5px;
}

/* ============================================================
   作品卡片
   ============================================================ */
.work-group + .work-group { margin-top: var(--sp-xl); }

.work-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-card {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  color: inherit;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.work-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  background: linear-gradient(180deg, var(--green), var(--hydro));
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--transition);
  pointer-events: none;
}

.work-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.work-card:hover::after { transform: scaleY(1); }

.work-card:active {
  transform: translateY(0) scale(0.995);
  transition-duration: 0.1s;
}

.work-card:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ★ 作品图标：原神元素徽章样式 */
.work-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent 60%),
    linear-gradient(135deg, var(--green-soft), rgba(74, 144, 217, 0.1));
  color: var(--green-deep);
  border: 1.5px solid var(--green);
  border-radius: 10px;
  box-shadow:
    inset 0 0 8px rgba(45, 138, 95, 0.12),
    0 0 0 3px rgba(45, 138, 95, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

/* ★ 徽章左上高光点 */
.work-icon::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

html.dark .work-icon {
  color: var(--green);
  border-color: var(--green);
  box-shadow:
    inset 0 0 10px rgba(74, 232, 160, 0.15),
    0 0 0 3px rgba(74, 232, 160, 0.08);
}

/* ★ 稀有度色：按 data-rarity 区分描边色 */
.work-icon[data-rarity="5"] {
  border-color: var(--rarity-5);
  color: #8a6520;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.7), transparent 60%),
    linear-gradient(135deg, rgba(212, 162, 78, 0.12), rgba(255, 217, 122, 0.08));
  box-shadow:
    inset 0 0 10px rgba(212, 162, 78, 0.2),
    0 0 0 3px rgba(212, 162, 78, 0.08);
}

html.dark .work-icon[data-rarity="5"] { color: #ffd97a; }

.work-icon[data-rarity="4"] {
  border-color: var(--rarity-4);
  color: #6b3a99;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent 60%),
    linear-gradient(135deg, rgba(160, 108, 213, 0.1), rgba(74, 144, 217, 0.08));
  box-shadow:
    inset 0 0 10px rgba(160, 108, 213, 0.15),
    0 0 0 3px rgba(160, 108, 213, 0.06);
}

html.dark .work-icon[data-rarity="4"] { color: #c8a0f0; }

.work-icon[data-rarity="3"] {
  border-color: var(--rarity-3);
  color: #2c5a8a;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent 60%),
    linear-gradient(135deg, rgba(90, 155, 212, 0.1), rgba(74, 144, 217, 0.06));
  box-shadow:
    inset 0 0 10px rgba(90, 155, 212, 0.15),
    0 0 0 3px rgba(90, 155, 212, 0.06);
}

html.dark .work-icon[data-rarity="3"] { color: #8ac4f0; }

.work-card:hover .work-icon { transform: scale(1.08); }

.work-info { flex: 1; min-width: 0; }

.work-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.35;
}

.work-desc {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
  line-height: 1.35;
}

.work-arrow {
  flex-shrink: 0;
  font-size: 15px;
  color: var(--text-dim);
  transition: all var(--transition);
  opacity: 0.5;
  font-family: var(--mono);
}

.work-card:hover .work-arrow {
  color: var(--green);
  opacity: 1;
  transform: translateX(3px);
}

/* ===== 主推作品区 ===== */
.work-group.featured-group .block-title::before {
  width: 20px;
  background: linear-gradient(90deg, var(--green), var(--hydro));
}

.work-group.featured-group .work-card {
  border-color: rgba(45, 138, 95, 0.2);
}

.work-group.featured-group .work-card:hover {
  border-color: var(--green);
}

/* ============================================================
   联系区块
   ============================================================ */
.contact-section { margin-top: var(--sp-xl); }

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.contact-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  color: var(--text-mid);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(26, 51, 40, 0.04);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.contact-btn svg {
  color: var(--green);
  flex-shrink: 0;
  transition: color var(--transition);
}

.contact-btn:hover {
  color: var(--text);
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--green-glow);
}

.contact-btn:active { transform: translateY(0) scale(0.98); }

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

.contact-btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}

.contact-btn.primary svg { color: #fff; }

.contact-btn.primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: shimmer 3.2s infinite 1s;
}

@keyframes shimmer {
  0% { left: -100%; }
  60% { left: 200%; }
  100% { left: 200%; }
}

.contact-btn.primary:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--green-glow);
}

/* ===== 邮箱面板 ===== */
.email-panel {
  max-width: 460px;
  margin: var(--sp-md) 0 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 4px 14px;
  display: none;
}

.email-panel.show {
  display: block;
  animation: fadeSlide 0.25s ease;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--card-border);
}

.email-row:last-child { border-bottom: none; }

.email-addr {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
  font-family: var(--mono);
}

.copy-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-mid);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.copy-btn:hover {
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--green-soft);
}

.copy-btn.copied {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

/* ===== 时钟 ===== */
.clock-inline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: var(--sp-md);
  border-top: 1px solid var(--card-border);
}

.clock-inline .time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  font-family: var(--mono);
}

.clock-inline .sep { color: var(--text-dim); opacity: 0.5; }
.clock-inline .lunar { color: var(--text-dim); }

/* ===== 页脚 ===== */
.foot {
  text-align: center;
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.3px;
}

.foot .heart { color: var(--green); }

/* ===== 入场动画 ===== */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.65s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.12s; }
.fade-up:nth-child(3) { animation-delay: 0.19s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 879px) {
  .shell { padding: 72px var(--sp-md) 64px; max-width: 640px; }
  .top-controls { top: 14px; right: 14px; gap: 6px; }
  .ctrl-btn { height: 34px; padding: 0 12px; font-size: 12px; }
  .theme-btn { width: 34px; }
  .lang-switch { height: 34px; }
  .lang-opt { padding: 0 10px; height: 26px; font-size: 12px; }
  .identity { padding: var(--sp-md); }
  .avatar-wrap, .avatar { width: 64px; height: 64px; }
  .name { font-size: 22px; }
  .stat-num, .stat-suffix { font-size: 20px; }
  .work-card { padding: 12px 14px; gap: var(--sp-sm); }
  .work-icon { width: 36px; height: 36px; }
  .work-icon svg { width: 16px; height: 16px; }
  .contact-btn { padding: 9px 16px; font-size: 12.5px; }
  .email-panel { max-width: 100%; }
}

@media (max-width: 380px) {
  .lang-opt { padding: 0 8px; font-size: 11px; }
  .name { font-size: 20px; }
  .ctrl-btn { height: 32px; }
  .theme-btn { width: 32px; }
  .lang-switch { height: 32px; }
  .lang-opt { height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-up { opacity: 1; transform: none; }
  .contact-btn.primary::after { display: none; }
  .avatar-ring { animation: none; }
}

/* ============================================================
   芙宁娜 AI 聊天悬浮窗
   ============================================================ */
.fw-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}

.fw-wrap > * { pointer-events: auto; }

.fw-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  background: linear-gradient(135deg, var(--hydro), #8ac7f0);
  color: #fff;
  box-shadow: 0 6px 20px var(--hydro-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s;
}

.fw-fab:hover {
  transform: scale(1.06) rotate(-6deg);
  box-shadow: 0 10px 28px var(--hydro-glow);
}

.fw-fab:active { transform: scale(0.96); }

.fw-fab-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
}

.fw-panel {
  width: 360px;
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(26, 51, 40, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.fw-wrap.open .fw-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.fw-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hydro), #8ac7f0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fw-info { flex: 1; min-width: 0; }
.fw-name { font-size: 14px; font-weight: 700; color: var(--text); }
.fw-status { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

.fw-role {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.fw-role.admin {
  background: var(--green);
  color: #fff;
}
.fw-role.user {
  background: var(--hydro-soft);
  color: var(--hydro-deep);
  border: 1px solid rgba(74, 144, 217, 0.25);
}
.fw-role.guest {
  background: rgba(220, 100, 100, 0.08);
  color: #c96060;
  border: 1px solid rgba(220, 100, 100, 0.2);
}

.fw-min {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.fw-min:hover { background: var(--card-border); color: var(--text); }

.fw-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fw-body::-webkit-scrollbar { width: 4px; }
.fw-body::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

.fw-msg { display: flex; animation: fwIn 0.3s ease; }

@keyframes fwIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.fw-msg.user { justify-content: flex-end; }

.fw-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}

.fw-msg.bot .fw-bubble {
  background: var(--bg-subtle);
  color: var(--text);
  border-top-left-radius: 4px;
}

html.dark .fw-msg.bot .fw-bubble { background: var(--bg-subtle); }

.fw-msg.user .fw-bubble {
  background: var(--hydro);
  color: #fff;
  border-top-right-radius: 4px;
}

.fw-bubble pre {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  overflow-x: auto;
  font-size: 12px;
  white-space: pre;
}

.fw-bubble code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--green-soft);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--green-deep);
}

html.dark .fw-bubble code {
  color: var(--green);
  background: var(--green-soft);
}

.fw-caret {
  display: inline-block;
  width: 5px;
  height: 12px;
  background: var(--green);
  border-radius: 1px;
  vertical-align: -2px;
  margin-left: 2px;
  animation: fwBlink 1s step-end infinite;
}

@keyframes fwBlink { 50% { opacity: 0; } }

.fw-think {
  margin-bottom: 8px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-subtle);
  overflow: hidden;
  font-size: 12.5px;
}

.fw-think-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  cursor: pointer;
  user-select: none;
  color: var(--text-dim);
  font-weight: 600;
  transition: background 0.2s;
}

.fw-think-head:hover { background: var(--card-border); }

.fw-think-arrow { display: inline-block; transition: transform 0.25s; font-size: 10px; }
.fw-think.open .fw-think-arrow { transform: rotate(90deg); }

.fw-think-body {
  display: none;
  padding: 8px 11px 9px;
  color: var(--text-mid);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--card-border);
}

.fw-think.open .fw-think-body { display: block; }

.fw-think-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: fwThinkPulse 1.4s infinite;
}

@keyframes fwThinkPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.fw-typing { display: flex; gap: 4px; padding: 12px 14px !important; }

.fw-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: fwBounce 1.4s infinite ease-in-out;
}

.fw-typing span:nth-child(2) { animation-delay: 0.2s; }
.fw-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fwBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.fw-foot {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 14px 6px;
  border-top: 1px solid var(--card-border);
  flex-shrink: 0;
}

.fw-input {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  max-height: 90px;
  min-height: 40px;
  outline: none;
  transition: all var(--transition-fast);
}

.fw-input::placeholder { color: var(--text-dim); }

.fw-input:focus {
  border-color: var(--green);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.fw-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.fw-send:hover:not(:disabled) {
  background: var(--green-deep);
  transform: scale(1.04);
}

.fw-send:disabled { opacity: 0.4; cursor: not-allowed; }

.fw-tip {
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: center;
  padding: 0 0 10px;
}

@media (max-width: 520px) {
  .fw-wrap { right: 14px; bottom: 14px; gap: 10px; }
  .fw-fab { width: 48px; height: 48px; }
  .fw-fab svg { width: 20px; height: 20px; }
  .fw-panel {
    width: calc(100vw - 28px);
    height: calc(100vh - 140px);
    max-height: 560px;
    border-radius: 14px;
  }
  .fw-bubble { font-size: 13px; max-width: 88%; }
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-mid);
  cursor: pointer;
  box-shadow: var(--card-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.show { opacity: 1; visibility: visible; transform: none; }

.back-to-top:hover {
  color: var(--green);
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--green-glow);
}

.back-to-top:active { transform: scale(0.94); }

@media (max-width: 520px) {
  .back-to-top { right: 16px; bottom: 80px; width: 38px; height: 38px; }
}