/**
 * 三大特色页共用样式：/frontend/ 工具箱 · /campus/ 技能树 · /life/ 成就墙
 * 全部颜色取自安知鱼主题 CSS 变量，暗色模式随主题自动切换。
 * ====== 想改外观：动这里的类名对应样式即可 ======
 */

/* ---------- 通用卡片 ---------- */
.fp-card {
  background: var(--anzhiyu-card-bg);
  border: 1px solid var(--anzhiyu-card-border);
  border-radius: 12px;
  box-shadow: var(--anzhiyu-shadow-border);
  padding: 20px;
  transition: box-shadow 0.3s ease;
}

/* ---------- Hero 横幅（紧凑版，把工具面板抬进首屏） ---------- */
.fp-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 14px 20px;
}
.fp-hero-icon {
  font-size: 2em;
  line-height: 1;
  color: var(--anzhiyu-theme);
  filter: drop-shadow(0 4px 8px var(--anzhiyu-gray-op));
}
.fp-hero-title {
  margin: 0 0 6px;
  font-size: 1.5em;
  font-weight: 700;
  color: var(--anzhiyu-fontcolor);
}
.fp-hero-sub {
  margin: 0;
  font-size: 0.92em;
  color: var(--anzhiyu-secondtext);
}
.fp-hero-extra {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8em;
  color: var(--anzhiyu-theme);
  background: var(--anzhiyu-secondbg);
  border: 1px solid var(--anzhiyu-card-border);
  white-space: nowrap;
}
.fp-badge.gold {
  color: #b8860b;
  border-color: rgba(184, 134, 11, 0.35);
  background: rgba(255, 200, 60, 0.12);
}
[data-theme="dark"] .fp-badge.gold {
  color: #ffd666;
}
.fp-badge .anzhiyufont {
  font-size: 0.95em;
}

/* ---------- 分区标题 ---------- */
.fp-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 12px;
  font-size: 1.12em;
  font-weight: 700;
  color: var(--anzhiyu-fontcolor);
}
.fp-section-title::before {
  content: "";
  width: 4px;
  height: 1em;
  border-radius: 2px;
  background: var(--anzhiyu-theme);
}
.fp-section-title .fp-section-tip {
  font-size: 0.72em;
  font-weight: 400;
  color: var(--anzhiyu-secondtext);
}

/* ---------- 通用小按钮 / 输入控件 ---------- */
.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-secondbg);
  color: var(--anzhiyu-fontcolor);
  font-size: 0.88em;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}
.fp-btn:hover {
  color: #fff;
  background: var(--anzhiyu-theme);
  border-color: var(--anzhiyu-theme);
}
.fp-btn.primary {
  color: #fff;
  background: var(--anzhiyu-theme);
  border-color: var(--anzhiyu-theme);
}
.fp-btn.primary:hover {
  filter: brightness(1.1);
}
.fp-input,
.fp-textarea,
.fp-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-secondbg);
  color: var(--anzhiyu-fontcolor);
  font-size: 0.9em;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}
.fp-input:focus,
.fp-textarea:focus,
.fp-select:focus {
  border-color: var(--anzhiyu-theme);
  box-shadow: 0 0 0 3px var(--anzhiyu-theme-op, rgba(66, 89, 239, 0.14));
}
.fp-textarea {
  min-height: 130px;
  resize: vertical;
  font-family: var(--anzhiyu-code-background, monospace);
  line-height: 1.6;
}
.fp-result {
  background: var(--anzhiyu-secondbg);
  border: 1px dashed var(--anzhiyu-card-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.86em;
  line-height: 1.6;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--anzhiyu-fontcolor);
  min-height: 44px;
  max-height: 340px;
  overflow: auto;
  transition: box-shadow 0.3s ease;
}
.fp-code {
  font-family: var(--code-font-family, "JetBrains Mono", Consolas, Menlo, monospace);
  font-size: 0.82em;
}
/* 复制成功时的第二反馈形态（描边闪烁，照顾色弱用户） */
.fp-flash {
  box-shadow: 0 0 0 3px var(--anzhiyu-green) !important;
  border-color: var(--anzhiyu-green) !important;
}
.fp-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.fp-hint {
  font-size: 0.82em;
  color: var(--anzhiyu-secondtext);
}
.fp-error-text {
  color: var(--anzhiyu-red);
  font-size: 0.84em;
}
.fp-success-text {
  color: var(--anzhiyu-green);
  font-size: 0.84em;
}
mark.fp-hit {
  background: rgba(255, 200, 60, 0.45);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------- 工具箱：选项卡（窄屏横向滑动） ---------- */
.ft-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.ft-tabs::-webkit-scrollbar {
  display: none;
}
.ft-sep {
  flex: none;
  width: 1px;
  margin: 4px 3px;
  background: var(--anzhiyu-card-border);
}
.ft-tab {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-card-bg);
  color: var(--anzhiyu-fontcolor);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.25s ease;
}
.ft-tab:hover {
  color: var(--anzhiyu-theme);
  border-color: var(--anzhiyu-theme);
}
.ft-tab.active {
  color: #fff;
  background: var(--anzhiyu-theme);
  border-color: var(--anzhiyu-theme);
  box-shadow: var(--anzhiyu-shadow-blue);
}
.ft-tab .anzhiyufont,
.fp-btn .anzhiyufont {
  margin-right: 4px;
}
.ft-panel {
  display: none;
}
.ft-panel.active {
  display: block;
  animation: fp-fade-in 0.35s ease;
}
.ft-field {
  margin-bottom: 12px;
}
.ft-field > label {
  display: block;
  font-size: 0.84em;
  color: var(--anzhiyu-secondtext);
  margin-bottom: 6px;
}
/* 宽屏左右分栏：输入 | 结果 */
.ft-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 1024px) {
  .ft-split {
    grid-template-columns: 1fr 1fr;
  }
}
/* 正则常用库小片 */
.rx-chip {
  padding: 4px 12px !important;
  font-size: 0.8em !important;
  border-radius: 999px !important;
}
/* JSON / TS 语法高亮配色 */
.j-key {
  color: #d63384;
}
.j-str {
  color: #2f9e44;
}
.j-num {
  color: #1971c2;
}
.j-bool,
.j-null {
  color: #e8590c;
  font-weight: 600;
}
.j-errline {
  display: inline-block;
  width: 100%;
  background: rgba(247, 82, 82, 0.16);
  border-left: 3px solid var(--anzhiyu-red);
  border-radius: 3px;
}
[data-theme="dark"] .j-key {
  color: #f783ac;
}
[data-theme="dark"] .j-str {
  color: #8ce99a;
}
[data-theme="dark"] .j-num {
  color: #74c0fc;
}
[data-theme="dark"] .j-bool,
[data-theme="dark"] .j-null {
  color: #ffc078;
}
/* 对比度检查 */
.ct-preview {
  padding: 18px 16px;
  border-radius: 8px;
  border: 1px solid var(--anzhiyu-card-border);
  font-size: 1.05em;
  text-align: center;
}
.ct-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8em;
  border: 1px solid var(--anzhiyu-card-border);
}
.ct-badge.pass {
  color: var(--anzhiyu-green);
  border-color: var(--anzhiyu-green);
  background: rgba(68, 181, 103, 0.08);
}
.ct-badge.fail {
  color: var(--anzhiyu-red);
  border-color: var(--anzhiyu-red);
  background: rgba(247, 82, 82, 0.06);
}

/* ---------- 技能树 ---------- */
.tree-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tree-progress-bar {
  flex: 1;
  min-width: 180px;
  height: 10px;
  border-radius: 999px;
  background: var(--anzhiyu-secondbg);
  overflow: hidden;
}
.tree-progress-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--anzhiyu-theme), var(--anzhiyu-blue));
  transition: width 0.8s ease;
}
.tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.tree-branch {
  padding: 16px;
}
.tree-branch-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  color: var(--anzhiyu-fontcolor);
  margin-bottom: 4px;
}
.tree-branch-title .tree-branch-icon {
  color: var(--anzhiyu-theme);
  font-size: 1.15em;
}
.tree-branch-desc {
  font-size: 0.78em;
  color: var(--anzhiyu-secondtext);
  margin-bottom: 12px;
}
.tree-nodes {
  list-style: none;
  margin: 0;
  padding: 0 0 0 6px;
  position: relative;
}
/* 连接线改为伪元素：回放时可播放"向下生长"动画 */
.tree-nodes::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 14px;
  bottom: 14px;
  width: 0;
  border-left: 2px dashed var(--anzhiyu-card-border);
  transform-origin: top;
}
.tree-nodes.growing::before {
  animation: lineGrow 0.5s ease both;
}
@keyframes lineGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
.tree-node {
  position: relative;
  margin: 0 0 10px;
  padding: 8px 12px 8px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.tree-node::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--anzhiyu-gray);
  box-shadow: 0 0 0 3px var(--anzhiyu-card-bg);
}
.tree-node:hover {
  transform: translateX(3px);
}
.tree-node .tree-node-name {
  font-size: 0.92em;
  font-weight: 600;
  color: var(--anzhiyu-fontcolor);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tree-node .tree-node-state {
  margin-left: auto;
  font-size: 0.78em;
  color: var(--anzhiyu-secondtext);
}
.tree-node.done::before {
  background: var(--anzhiyu-theme);
  box-shadow: 0 0 0 3px var(--anzhiyu-theme-op, rgba(66, 89, 239, 0.14));
}
.tree-node.done .tree-node-state {
  color: var(--anzhiyu-theme);
}
.tree-node.doing::before {
  background: var(--anzhiyu-orange);
  animation: fp-pulse 1.6s ease-in-out infinite;
}
.tree-node.doing .tree-node-state {
  color: var(--anzhiyu-orange);
}
.tree-node.locked {
  opacity: 0.55;
  border: 1px dashed var(--anzhiyu-card-border);
  background: var(--anzhiyu-secondbg);
}
.tree-node.selected {
  border-color: var(--anzhiyu-theme);
  box-shadow: var(--anzhiyu-shadow-blue);
}
.tree-detail {
  margin-top: 16px;
  font-size: 0.9em;
}
.tree-detail .tree-detail-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--anzhiyu-fontcolor);
}

/* ---------- 成就墙 ---------- */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}
.ach-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-card-bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.ach-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--anzhiyu-shadow-lightblack);
}
.ach-card .ach-icon {
  font-size: 1.5em;
  line-height: 1;
  color: var(--anzhiyu-theme);
}
.ach-card.locked .ach-icon {
  color: var(--anzhiyu-gray);
}
.ach-card .ach-name {
  font-weight: 700;
  font-size: 0.98em;
  color: var(--anzhiyu-fontcolor);
}
.ach-card .ach-desc {
  font-size: 0.8em;
  color: var(--anzhiyu-secondtext);
  line-height: 1.5;
  flex: 1;
}
.ach-card .ach-status {
  font-size: 0.78em;
  font-weight: 600;
}
.ach-card.unlocked {
  border-color: rgba(255, 200, 60, 0.45);
  background: linear-gradient(
    145deg,
    var(--anzhiyu-card-bg),
    rgba(255, 200, 60, 0.07)
  );
}
.ach-card.unlocked .ach-status {
  color: #b8860b;
}
[data-theme="dark"] .ach-card.unlocked .ach-status {
  color: #ffd666;
}
.ach-card.locked {
  filter: grayscale(0.9);
  opacity: 0.72;
}
.ach-card.locked .ach-status {
  color: var(--anzhiyu-secondtext);
}
.ach-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--anzhiyu-secondbg);
  overflow: hidden;
  margin-top: 2px;
}
.ach-progress-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--anzhiyu-theme), var(--anzhiyu-blue));
  transition: width 0.8s ease;
}
.ach-counter {
  font-size: 0.85em;
  color: var(--anzhiyu-secondtext);
}

/* ---------- 动画 ---------- */
@keyframes fp-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fp-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--anzhiyu-theme-op, rgba(66, 89, 239, 0.14)),
      0 0 0 0 rgba(255, 150, 60, 0.35);
  }
  50% {
    box-shadow: 0 0 0 3px var(--anzhiyu-theme-op, rgba(66, 89, 239, 0.14)),
      0 0 0 7px rgba(255, 150, 60, 0.05);
  }
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  .fp-hero {
    gap: 12px;
  }
  .fp-hero-extra {
    margin-left: 0;
    width: 100%;
  }
  .ach-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .ach-card {
    padding: 12px;
  }
}

/* ---------- 工具箱框架：列表 + 视窗（/frontend/） ---------- */
.tb-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.tb-side {
  position: relative;
}
.tb-search {
  position: relative;
  margin-bottom: 12px;
}
.tb-search > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--anzhiyu-secondtext);
  font-size: 0.9em;
}
.tb-search input {
  width: 100%;
  padding: 10px 34px 10px 32px;
  border-radius: 10px;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-secondbg);
  color: var(--anzhiyu-fontcolor);
  font-size: 0.92em;
  outline: none;
  box-sizing: border-box;
}
.tb-search input:focus {
  border-color: var(--anzhiyu-theme);
}
.tb-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--anzhiyu-secondtext);
  cursor: pointer;
  padding: 4px;
}
.tb-list {
  overflow-y: auto;
  max-height: 68vh;
  padding-right: 2px;
}
/* 分类行：点击 → 工具列表向右弹出 */
.tb-cat {
  position: relative;
  display: block;
  width: 100%;
  padding: 10px 10px;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--anzhiyu-fontcolor);
  background: transparent;
  border: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
  line-height: 1.35;
}
.tb-cat:hover {
  background: var(--anzhiyu-secondbg);
}
.tb-cat > i {
  color: var(--anzhiyu-theme);
  margin-right: 4px;
}
.tb-cat .tb-cat-n {
  font-style: normal;
  font-weight: 400;
  font-size: 0.82em;
  color: var(--anzhiyu-secondtext);
  background: var(--anzhiyu-secondbg);
  border-radius: 999px;
  padding: 0 8px;
  margin-left: 2px;
}
.tb-cat .tb-caret {
  float: right;
  margin-top: 2px;
  color: var(--anzhiyu-secondtext);
  font-size: 0.9em;
  transition: transform 0.25s ease;
}
.tb-cat:hover .tb-caret {
  transform: translateX(3px);
  color: var(--anzhiyu-theme);
}
/* 当前工具所在分类：行下方显示正在使用的工具名 */
.tb-cat.has-active {
  background: var(--anzhiyu-secondbg);
}
.tb-cat .tb-cat-cur {
  display: block;
  margin: 3px 0 0 24px;
  font-size: 0.78em;
  font-weight: 400;
  color: var(--anzhiyu-theme);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 向右弹出的工具浮层（桌面） */
.tb-flyout {
  display: none;
  position: absolute;
  left: calc(100% + 10px);
  min-width: 224px;
  max-width: 300px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 8px;
  background: var(--anzhiyu-card-bg);
  border: 1px solid var(--anzhiyu-card-border);
  border-radius: 12px;
  box-shadow: var(--anzhiyu-shadow-black);
  z-index: 60;
}
.tb-flyout.open {
  display: block;
  animation: fp-fade-in 0.2s ease;
}
.tb-flyout-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 10px;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--anzhiyu-secondtext);
  border-bottom: 1px dashed var(--anzhiyu-card-border);
  margin-bottom: 6px;
}
.tb-flyout-head em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.9em;
  color: var(--anzhiyu-secondtext);
  background: var(--anzhiyu-secondbg);
  border-radius: 999px;
  padding: 0 8px;
  margin-left: auto;
}
.tb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--anzhiyu-fontcolor);
  font-size: 0.92em;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}
.tb-item i {
  color: var(--anzhiyu-secondtext);
  width: 16px;
  text-align: center;
}
.tb-item:hover {
  background: var(--anzhiyu-secondbg);
}
.tb-item.active {
  background: var(--anzhiyu-theme);
  color: #fff;
}
.tb-item.active i,
.tb-item.active .fp-hit {
  color: #fff;
}
.tb-item.active mark.fp-hit {
  background: rgba(255, 255, 255, 0.25);
}
.tb-topbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.tb-topbar b {
  color: var(--anzhiyu-fontcolor);
}
.tb-topbar-tip {
  font-size: 0.8em;
  color: var(--anzhiyu-secondtext);
  margin-left: auto;
}

/* 平板：窄侧栏双栏 */
@media (min-width: 768px) {
  .tb-shell {
    grid-template-columns: 210px 1fr;
  }
}

/* 桌面：双栏常驻，侧栏吸顶 */
@media (min-width: 1024px) {
  .tb-shell {
    grid-template-columns: 250px 1fr;
  }
  .tb-side {
    position: sticky;
    top: 70px;
  }
  .tb-list {
    max-height: calc(100vh - 260px);
  }
  .tb-topbar {
    display: none;
  }
}

/* 手机：列表态 / 详情态二选一；浮层变为底部抽屉 */
@media (max-width: 1023.5px) {
  .tb-shell.tb-mode-list .tb-main {
    display: none;
  }
  .tb-shell.tb-mode-detail .tb-side {
    display: none;
  }
  .tb-topbar {
    display: flex;
  }
  .tb-flyout {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    max-width: none;
    max-height: 65vh;
    border-radius: 16px;
    box-shadow: var(--anzhiyu-shadow-blackdeep);
  }
}

/* 查表工具表格 */
.tb-table-wrap {
  overflow-x: auto;
  max-height: 60vh;
  overflow-y: auto;
}
.tb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}
.tb-table th {
  position: sticky;
  top: 0;
  background: var(--anzhiyu-secondbg);
  color: var(--anzhiyu-secondtext);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--anzhiyu-card-border);
  white-space: nowrap;
}
.tb-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--anzhiyu-card-border);
  color: var(--anzhiyu-fontcolor);
}
.tb-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
.tb-table tbody tr:hover {
  background: var(--anzhiyu-secondbg);
}
.tb-unit-row:hover {
  background: var(--anzhiyu-card-bg);
  border-radius: 4px;
}

/* ---------- 技能树：时光线 / 彩签 / 弹窗 / 目标清单 ---------- */
/* 时光线（横向，窄屏可横滑） */
.tl-track {
  display: flex;
  overflow-x: auto;
  padding: 4px 2px 2px;
  scrollbar-width: thin;
}
.tl-node {
  position: relative;
  flex: 1 0 auto;
  min-width: 158px;
  padding: 0 16px 2px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tl-node::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 2px;
  background: var(--anzhiyu-card-border);
}
.tl-node:first-child::before {
  left: 10px;
}
.tl-node:last-child::before {
  right: auto;
  width: 20px;
}
.tl-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 1;
}
.tl-dot.tl-done {
  background: var(--anzhiyu-theme);
  box-shadow: 0 0 0 3px var(--anzhiyu-theme-op, rgba(66, 89, 239, 0.14));
}
.tl-dot.tl-doing {
  background: var(--anzhiyu-orange);
  animation: fp-pulse 1.6s ease-in-out infinite;
}
.tl-node b {
  font-size: 0.9em;
  color: var(--anzhiyu-fontcolor);
  margin-top: 16px;
}
.tl-node span {
  font-size: 0.8em;
  color: var(--anzhiyu-secondtext);
}

/* 三态统计彩签 */
.tree-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 600;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-secondbg);
}
.tree-chip.c-done {
  color: var(--anzhiyu-theme);
  border-color: var(--anzhiyu-theme);
}
.tree-chip.c-doing {
  color: var(--anzhiyu-orange);
  border-color: var(--anzhiyu-orange);
}
.tree-chip.c-locked {
  color: var(--anzhiyu-secondtext);
}

/* 分支小进度 */
.tree-branch-mini {
  margin-left: auto;
  font-size: 0.72em;
  font-weight: 400;
  color: var(--anzhiyu-secondtext);
  background: var(--anzhiyu-secondbg);
  border-radius: 999px;
  padding: 1px 9px;
}

/* 节点入场点亮动画 */
.tree-node {
  animation: nodeIn 0.4s both;
}
@keyframes nodeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 节点详情弹窗 */
.tree-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}
.tree-modal.open {
  display: block;
}
.tree-modal-mask {
  position: absolute;
  inset: 0;
  background: var(--anzhiyu-maskbg, rgba(0, 0, 0, 0.45));
  backdrop-filter: blur(2px);
}
.tree-modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92%, 460px);
  animation: fp-fade-in 0.25s ease;
}
.tree-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  color: var(--anzhiyu-secondtext);
  cursor: pointer;
  font-size: 1.1em;
  padding: 4px;
}
.tree-modal-close:hover {
  color: var(--anzhiyu-red);
}
.ts-done {
  color: var(--anzhiyu-theme);
  font-weight: 600;
  font-size: 0.9em;
}
.ts-doing {
  color: var(--anzhiyu-orange);
  font-weight: 600;
  font-size: 0.9em;
}
.ts-locked {
  color: var(--anzhiyu-secondtext);
  font-weight: 600;
  font-size: 0.9em;
}

/* 阶段目标清单 */
.goal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px dashed var(--anzhiyu-card-border);
  cursor: pointer;
  transition: background 0.2s ease;
}
.goal-item:hover {
  background: var(--anzhiyu-secondbg);
}
.goal-item:last-child {
  border-bottom: none;
}
.goal-item input {
  accent-color: var(--anzhiyu-theme);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.goal-item span {
  font-size: 0.92em;
  color: var(--anzhiyu-fontcolor);
}
.goal-item.done span {
  text-decoration: line-through;
  color: var(--anzhiyu-secondtext);
}

/* ---------- 技能树进阶：回放 / 筛选 / tooltip / 键盘 ---------- */
/* 成长回放过程态：未点亮的节点隐去，lit 节点闪亮登场 */
#tree-grid.replaying .tree-node {
  opacity: 0.12;
}
#tree-grid.replaying .tree-node.lit {
  opacity: 1;
  animation: nodeFlash 0.6s ease both;
}
@keyframes nodeFlash {
  0% {
    filter: brightness(1.8);
    transform: scale(0.94);
  }
  100% {
    filter: none;
    transform: none;
  }
}
#replay-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* 熟练度小圆点 */
.lv {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: 1px;
}
.lv i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--anzhiyu-card-border);
}
.lv i.on {
  background: var(--anzhiyu-theme);
}

/* 彩签筛选：激活态 + 弹跳入场 */
.tree-chip.active {
  background: var(--anzhiyu-theme) !important;
  color: #fff !important;
  border-color: var(--anzhiyu-theme) !important;
  box-shadow: var(--anzhiyu-shadow-blue);
}
.tree-chip.pop-later {
  animation: chipPop 0.45s both;
}
@keyframes chipPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* 筛选：非目标状态淡出 */
#tree-grid.filter-done .tree-node:not(.done),
#tree-grid.filter-doing .tree-node:not(.doing),
#tree-grid.filter-locked .tree-node:not(.locked) {
  opacity: 0.16;
}
#tree-grid.filter-done .tree-node.done,
#tree-grid.filter-doing .tree-node.doing,
#tree-grid.filter-locked .tree-node.locked {
  animation: none;
}

/* 桌面悬停快速预览 tooltip */
.tb-tip {
  position: fixed;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8em;
  background: var(--anzhiyu-card-bg);
  border: 1px solid var(--anzhiyu-card-border);
  box-shadow: var(--anzhiyu-shadow-lightblack);
  color: var(--anzhiyu-fontcolor);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tb-tip.show {
  opacity: 1;
}
.tb-tip b {
  font-weight: 600;
}
.tb-tip span {
  color: var(--anzhiyu-secondtext);
  white-space: nowrap;
}

/* 键盘可达 */
.tree-node:focus-visible {
  outline: 2px solid var(--anzhiyu-theme);
  outline-offset: 2px;
}

/* 移动端：状态徽章只留图标防挤压 */
@media (max-width: 600px) {
  .tree-node-state {
    font-size: 0;
    gap: 0;
  }
  .tree-node-state .anzhiyufont {
    font-size: 0.95em;
  }
}

/* 减少动态效果偏好：关闭本页装饰动画 */
@media (prefers-reduced-motion: reduce) {
  .tree-node,
  .tl-dot,
  .tree-progress-inner,
  .ach-progress-inner,
  .tb-flyout,
  .tree-chip,
  .tree-modal-card,
  .tree-nodes::before,
  .ach-card,
  .ach-new,
  .score-level {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 成就墙进阶：积分段位 / 稀有度 / NEW / 跳转 ---------- */
/* 积分与段位卡 */
.score-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}
.score-level {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05em;
  color: #fff;
  box-shadow: var(--anzhiyu-shadow-border);
}
.score-main {
  flex: 1;
  min-width: 0;
}
.score-main b {
  font-size: 1.02em;
  color: var(--anzhiyu-fontcolor);
}

/* 稀有度角标 */
.ach-rarity {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.68em;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--anzhiyu-card-border);
  color: var(--anzhiyu-secondtext);
}
.ach-rarity.r-rare {
  color: var(--anzhiyu-theme);
  border-color: var(--anzhiyu-theme);
}
.ach-rarity.r-epic {
  color: #9c6ade;
  border-color: #9c6ade;
  background: rgba(156, 106, 222, 0.08);
}
[data-theme="dark"] .ach-rarity.r-epic {
  color: #c39bef;
}

/* NEW 徽章 + 新解锁弹跳 */
.ach-new {
  position: absolute;
  top: -8px;
  left: -8px;
  background: linear-gradient(135deg, #f7b500, #f75252);
  color: #fff;
  font-size: 0.66em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(247, 181, 0, 0.4);
  animation: chipPop 0.5s both;
  z-index: 1;
}
.ach-card.newly {
  animation: newlyPop 0.5s both;
}
@keyframes newlyPop {
  0% {
    transform: scale(0.85);
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* 成就卡阶梯入场 */
.ach-card {
  animation: nodeIn 0.4s both;
}

/* 未解锁可点击卡：前往解锁引导 */
.ach-card.clickable {
  cursor: pointer;
}
.ach-card.clickable:hover {
  border-color: var(--anzhiyu-theme);
  opacity: 1;
}
.ach-go {
  margin-top: 4px;
  font-size: 0.76em;
  font-weight: 600;
  color: var(--anzhiyu-theme);
}
.ach-card.clickable:hover .ach-go {
  text-decoration: underline;
}

/* 筛选条激活态 */
#life-filter .fl-chip.active {
  background: var(--anzhiyu-theme);
  color: #fff;
  border-color: var(--anzhiyu-theme);
}
