/* ==========================================================================
   个人工具站 · 柔光工作台
   淡暖纸白 + 单一鼠尾草绿点缀，索引卡式工具卡片
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;
  --ink: #24231f;
  --ink-2: #56544c;
  --muted: #6b685d;
  --line: #e7e5dc;
  --line-strong: #d9d6ca;
  --accent: #5f7c61;
  --accent-deep: #42584a;
  --accent-soft: #e6ece1;
  --ok: #4f9d6b;

  --shadow-sm: 0 1px 2px rgba(36, 35, 31, 0.05), 0 4px 12px rgba(36, 35, 31, 0.05);
  --shadow-md: 0 2px 6px rgba(36, 35, 31, 0.05), 0 16px 40px rgba(36, 35, 31, 0.1);
  --shadow-lg: 0 4px 10px rgba(36, 35, 31, 0.06), 0 30px 64px rgba(36, 35, 31, 0.16);

  --radius: 18px;
  --font-display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 细腻的纸面颗粒 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: 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.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   花园背景
   -------------------------------------------------------------------------- */
.garden {
  position: fixed;
  inset: 0;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-image: var(--portal-frame-desktop);
  background-repeat: no-repeat;
  background-position: center -64px;
  background-size: 100% auto;
  opacity: 0.38;
}

.garden__defs {
  position: absolute;
  width: 0;
  height: 0;
}

.garden__vine,
.garden__float {
  display: none;
}

.g-stem {
  stroke: #6b8a6e;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  opacity: 0.55;
}

.garden__vine--left {
  left: clamp(-90px, -4vw, -20px);
  top: 40px;
  width: 300px;
  opacity: 0.8;
}

.garden__vine--right {
  right: clamp(-110px, -3vw, -30px);
  top: -20px;
  width: 380px;
  opacity: 0.75;
}

.garden__vine--bl {
  left: 0;
  bottom: -40px;
  width: 320px;
  opacity: 0.75;
}

.garden__vine--br {
  right: -30px;
  bottom: -50px;
  width: 360px;
  opacity: 0.75;
}

.garden__float {
  position: absolute;
  width: 56px;
  opacity: 0.5;
  animation: garden-float 7s ease-in-out infinite;
}

.garden__float--1 {
  left: 12%;
  top: 22%;
}

.garden__float--2 {
  right: 16%;
  top: 34%;
  animation-delay: -2.3s;
}

.garden__float--3 {
  left: 24%;
  top: 58%;
  animation-delay: -4.1s;
}

@keyframes garden-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(6deg);
  }
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand__mark svg {
  width: 36px;
  height: 36px;
  display: block;
}

.brand__word {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__word strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__word small {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 22px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(79, 157, 107, 0.14);
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  font-family: var(--font-mono);
}

.clock strong {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.clock span {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   主体
   -------------------------------------------------------------------------- */
.main {
  flex: 1;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

/* --- Hero --- */
.hero {
  padding: 40px 0 40px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
  text-transform: uppercase;
}

.eyebrow__rule {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(50px, 10vw, 80px);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 700;
}

.hero__title-accent {
  position: relative;
  z-index: 0;
  color: var(--accent-deep);
}

.hero__title-accent::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0.05em;
  height: 0.34em;
  z-index: -1;
  border-radius: 6px;
  background: var(--accent-soft);
}

.hero__lead {
  max-width: 620px;
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
}

/* --- 启动器（搜索） --- */
.launcher {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 660px;
  height: 58px;
  margin-top: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-md);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.launcher:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14), var(--shadow-md);
}

.launcher__icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.launcher input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: 0;
  outline: none;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.launcher input::placeholder {
  color: #8d8a80;
}

.launcher input::-webkit-search-cancel-button {
  display: none;
}

.launcher__key,
.launcher__clear {
  flex: none;
  margin-right: 12px;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.launcher__clear {
  display: none;
  cursor: pointer;
  border-color: var(--accent-soft);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.launcher__clear.is-visible {
  display: grid;
}

.launcher__clear:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* --- 快捷搜索 chips --- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chips button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  box-shadow: var(--shadow-sm);
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.chips button:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   工具箱
   -------------------------------------------------------------------------- */
.toolbox {
  padding: 18px 0 80px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 30px;
}

.tab {
  --i: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.tab:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.tab.is-active {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.tab.is-entering {
  animation: rise-in 0.5s calc(var(--i) * 50ms) cubic-bezier(0.22, 0.8, 0.32, 1) backwards;
}

.tab__icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab__label {
  font-weight: 600;
}

.tab__code {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.55;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent-deep);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
}

.section-head p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* --- 工具卡片网格 --- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* 签名元素：带真实植物标本角饰的索引卡 */
.tool-card {
  --i: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.tool-card.is-entering {
  animation: rise-in 0.55s calc(var(--i) * 70ms) cubic-bezier(0.22, 0.8, 0.32, 1) backwards;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.tool-card__botanical {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 148px;
  height: 148px;
  object-fit: contain;
  object-position: top right;
  opacity: 0.82;
  pointer-events: none;
}

.tool-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tool-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.tool-card__icon::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--surface);
}

.tool-card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-card__code {
  margin: 2px 6px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding-right: 82px;
}

.tool-card__body {
  margin-top: 24px;
}

.tool-card__english {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent-deep);
}

.tool-card h3 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.tool-card__summary {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.tool-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tool-card__tags span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 11px;
  background: var(--surface-2);
}

.tool-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
}

.tool-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}

.tool-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ok);
  background: rgba(79, 157, 107, 0.1);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.tool-card__status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
}

.tool-card__arrow {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
}

.tool-card:hover .tool-card__arrow {
  transform: translateX(4px);
}

/* --- 空状态 --- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}

.empty__icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty__title {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.empty__text {
  max-width: 460px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.empty__action {
  margin-top: 20px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--accent-deep);
  background: var(--surface-2);
  font-size: 12px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.empty__action:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.footer__icp {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.footer__icp:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   动画
   -------------------------------------------------------------------------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero {
    padding: 60px 0 48px;
  }
}

@media (max-width: 560px) {
  .garden {
    height: 100vh;
    background-image: var(--portal-frame-mobile);
    background-position: center -38px;
    background-size: 100% auto;
    opacity: 0.28;
  }

  .garden__vine--left,
  .garden__vine--right {
    display: none;
  }

  .garden__vine--bl,
  .garden__vine--br {
    opacity: 0.55;
  }

  .topbar {
    padding: 14px 18px;
  }

  .status {
    display: none;
  }

  .clock strong {
    font-size: 13px;
  }

  .main {
    width: min(100% - 30px, 1120px);
  }

  .hero {
    padding: 40px 0 36px;
  }

  .hero__title {
    font-size: clamp(50px, 10vw, 80px);
  }

  .hero__lead {
    font-size: 14px;
  }

  .launcher {
    height: 52px;
  }

  .toolbox {
    padding: 8px 0 48px;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-bottom: 20px;
  }

  .tab {
    padding: 10px 12px;
  }

  .tab__code {
    display: none;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 300px;
    padding: 20px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .garden__float {
    animation: none;
  }

  .tab.is-entering,
  .tool-card.is-entering {
    animation: none;
  }

  .tool-card,
  .tool-card__botanical,
  .tool-card__arrow,
  .launcher,
  .chips button,
  .tab,
  .empty__action {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   登录认证
   -------------------------------------------------------------------------- */
.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  height: 30px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.auth-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.auth-btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.auth-btn--primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
}

.auth-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.auth-user {
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}

.tool-card.is-locked {
  position: relative;
  opacity: 0.82;
}

.tool-card.is-locked h3,
.tool-card.is-locked .tool-card__summary.is-blurred {
  filter: blur(3px);
  user-select: none;
}

.tool-card.is-locked .tool-card__cta {
  color: #8c682e;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(36, 35, 31, 0.46);
  backdrop-filter: blur(5px);
  animation: auth-fade-in 180ms ease both;
}

.auth-modal__box {
  width: min(380px, 100%);
  max-height: calc(100dvh - 24px);
  padding: 20px 24px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(217, 214, 202, 0.82);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: auth-rise-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-modal__box--register {
  width: min(400px, 100%);
  padding-top: 18px;
}

.auth-modal__box--register .auth-bloom {
  width: 88px;
  height: 94px;
  margin-top: -8px;
}

.auth-modal__box--register .auth-modal__hint {
  margin-bottom: 15px;
}

.auth-modal__box h3 {
  margin: 0 0 4px;
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0;
}

.auth-modal__hint {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12.5px;
}

.auth-bloom {
  position: relative;
  width: 106px;
  height: 116px;
  margin: -10px auto 0;
  animation: auth-bloom-breathe 4s ease-in-out infinite;
}

.auth-bloom__frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 5px 8px rgba(66, 88, 74, 0.1));
  transform-origin: 50% 100%;
  transition: opacity 240ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-bloom__frame--open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.auth-bloom__frame--bud {
  opacity: 0;
  transform: translateY(3px) scale(0.82);
}

.auth-modal__box.is-password-stage .auth-bloom__frame--open {
  opacity: 0;
  transform: translateY(3px) scale(0.76);
}

.auth-modal__box.is-password-stage .auth-bloom__frame--bud {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0);
}

.auth-field {
  position: relative;
}

.auth-field--code .input {
  padding-right: 119px;
}

.auth-code-send {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  display: inline-flex;
  min-width: 104px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}

.auth-code-send:hover,
.auth-code-send:focus-visible {
  background: var(--accent-soft);
  color: #31463a;
}

.auth-code-send:disabled {
  cursor: default;
  opacity: 0.58;
}

.auth-modal__box .input {
  display: block;
  width: 100%;
  height: 44px;
  margin-bottom: 10px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.auth-modal__box .input::placeholder {
  color: #918e84;
  opacity: 1;
}

.auth-modal__box .input:focus {
  border-color: var(--accent);
  background: var(--accent-faint, #fbfcfa);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.auth-field--password .input {
  position: relative;
  z-index: 1;
  padding-right: 48px;
  caret-color: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.auth-field--password .input::placeholder {
  color: #918e84;
  -webkit-text-fill-color: #918e84;
}

.auth-password-cover {
  position: absolute;
  top: 1px;
  right: 45px;
  left: 1px;
  z-index: 2;
  height: 42px;
  border-radius: 7px 0 0 7px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms ease, background 180ms ease;
}

.auth-field--password.has-password-value .auth-password-cover {
  opacity: 1;
}

.auth-field--password:focus-within .auth-password-cover {
  background: var(--accent-faint, #fbfcfa);
}

:root {
  --password-leaf: var(--accent, #708b72);
  --password-leaf-alt: var(--accent-soft, #91a98f);
  --password-leaf-alt2: color-mix(in srgb, var(--accent, #708b72) 62%, #fff);
  --password-leaf-selected: var(--accent-deep, #42584a);
  --password-leaf-ring: color-mix(in srgb, var(--accent, #5f7c61) 22%, transparent);
}

.auth-leaf-mask {
  position: absolute;
  top: 0;
  left: 13px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 44px;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.auth-leaf-mask i {
  display: block;
  width: 8px;
  height: 12px;
  border-radius: 80% 10% 80% 10%;
  background: var(--password-leaf);
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.24);
  transform: rotate(-36deg);
  animation: auth-leaf-arrive 180ms calc(var(--leaf-i) * 10ms) ease-out both;
}

.auth-leaf-mask i:nth-child(even) {
  background: var(--password-leaf-alt2, var(--password-leaf-alt));
}

.auth-leaf-mask i.is-selected {
  background: var(--password-leaf-selected);
  box-shadow: 0 0 0 2px var(--password-leaf-ring), inset -1px -1px 0 rgba(255, 255, 255, 0.25);
}

.auth-leaf-caret {
  --caret-index: 0;
  position: absolute;
  top: 11px;
  left: 13px;
  z-index: 3;
  width: 1.5px;
  height: 22px;
  border-radius: 1px;
  background: var(--accent-deep);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(var(--caret-index) * 11px));
}

.auth-field--password .input:focus ~ .auth-leaf-caret {
  opacity: 1;
  animation: auth-caret-blink 1s steps(1, end) infinite;
}

.auth-leaf-caret.is-hidden {
  opacity: 0 !important;
  animation: none !important;
}

.auth-pass-reveal {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #76756d;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 160ms ease, background 160ms ease, transform 120ms ease;
}

.auth-pass-reveal:hover,
.auth-pass-reveal:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.auth-pass-reveal.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  transform: scale(0.94);
}

.auth-pass-reveal svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-field--password.is-revealed .input {
  caret-color: var(--accent-deep);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.auth-field--password.is-revealed .auth-password-cover {
  opacity: 0;
  visibility: hidden;
}

.auth-field--password.is-revealed .auth-leaf-mask,
.auth-field--password.is-revealed .auth-leaf-caret {
  opacity: 0;
}

.auth-field--password.is-revealed .auth-leaf-caret {
  animation: none;
  visibility: hidden;
}

.auth-modal__error {
  min-height: 18px;
  margin: 0 0 10px;
  color: #a4483c;
  font-size: 12.5px;
  text-align: left;
}

.auth-modal__error.is-success {
  color: var(--ok);
}

.auth-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.auth-modal__actions .auth-btn {
  flex: 1;
  height: 42px;
}

.auth-modal__switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
.auth-switch-divider {
  color: var(--line-strong);
}
  font-size: 12.5px;
}

.auth-modal__switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 1px;
  border-bottom: 1px solid transparent;
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 160ms ease, color 160ms ease;
}

.auth-modal__switch::before {
  content: '';
  width: 7px;
  height: 11px;
  border-radius: 80% 10% 80% 10%;
  background: var(--accent);
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.22);
  transform: rotate(-36deg);
}

.auth-modal__switch:hover,
.auth-modal__switch:focus-visible {
  border-color: var(--accent);
  color: #31463a;
}

@keyframes auth-fade-in {
  from { opacity: 0; }
}

@keyframes auth-rise-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

@keyframes auth-bloom-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes auth-leaf-arrive {
  from { opacity: 0; scale: 0.5; }
  to { opacity: 1; scale: 1; }
}

@keyframes auth-caret-blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 720px) {
  .auth-user {
    display: none;
  }

  .auth-modal__box {
    padding-inline: 20px;
  }
}

@media (max-width: 560px) {
  .topbar__meta {
    gap: 10px;
  }

  .topbar__meta .clock {
    display: none;
  }

  .auth-area {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 6px;
  }

  .auth-btn {
    min-height: 28px;
    flex-shrink: 0;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
  }
}

@media (max-height: 650px) {
  .auth-modal__box--register .auth-bloom {
    width: 72px;
    height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-modal__box,
  .auth-bloom,
  .auth-leaf-mask i,
  .auth-leaf-caret {
    animation: none;
  }

  .auth-bloom__frame {
    transition: none;
  }
}

:root[data-theme='violet'] {
  --bg: #f7f3f8;
  --surface: #ffffff;
  --surface-2: #eee8f0;
  --ink: #29242c;
  --ink-2: #5c5261;
  --muted: #756a79;
  --line: #e8e0ea;
  --line-strong: #d7cadc;
  --accent: #7a568f;
  --accent-deep: #513a60;
  --accent-soft: #eee4f2;
  --accent-faint: #f8f2fa;
  --ok: #8a64a0;
  --status-ring: rgba(138, 100, 160, 0.16);
  --status-soft: rgba(138, 100, 160, 0.11);
  --password-leaf: #7a568f;
  --password-leaf-alt: #a887b9;
  --password-leaf-selected: #513a60;
  --password-leaf-ring: rgba(122, 86, 143, 0.22);
  --garden-desktop: url('./assets/botanical-frame-desktop-violet-v1.webp?v=1');
  --garden-mobile: url('./assets/botanical-frame-mobile-violet-v1.webp?v=1');
  --garden-opacity: 0.52;
  --shadow-sm: 0 1px 2px rgba(54, 39, 62, 0.05), 0 4px 12px rgba(54, 39, 62, 0.06);
  --shadow-md: 0 2px 6px rgba(54, 39, 62, 0.06), 0 16px 40px rgba(54, 39, 62, 0.11);
  --shadow-lg: 0 4px 10px rgba(54, 39, 62, 0.07), 0 30px 64px rgba(54, 39, 62, 0.17);
}

:root[data-theme='violet'] .auth-btn--primary,
:root[data-theme='violet'] .empty__action {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 8px 18px rgba(81, 58, 96, 0.16);
}

:root[data-theme='violet'] .tool-card__botanical {
  opacity: 0.82;
}



/* ---- 工具卡收藏星（主题色联动） ---- */
.fav-star {
  flex: none;
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted, #6b685d);
  transition: color .15s ease, background .15s ease, transform .12s ease;
}
.fav-star svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}
.fav-star:hover {
  color: var(--accent, #5f7c61);
  background: var(--accent-soft, rgba(var(--accent-rgb), 0.12));
}
.fav-star.is-fav {
  color: var(--accent, #5f7c61);
}
.fav-star.is-fav svg {
  fill: currentColor;
  stroke: var(--accent-deep, #42584a);
}
.fav-star:active {
  transform: scale(0.88);
}

.auth-user {
  text-decoration: none;
}

.auth-user:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Compact disclosure; options grow vertically without widening the topbar. */
.theme-picker { position: relative; flex: 0 0 auto; }
.theme-picker__trigger { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--accent-deep); font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.theme-picker__trigger::-webkit-details-marker { display: none; }
.theme-picker__current, .theme-picker__swatch { width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; background: var(--swatch, var(--accent)); }
.theme-picker__chevron { transition: transform 180ms ease; }
.theme-picker__trigger[aria-expanded='true'] .theme-picker__chevron { transform: rotate(180deg); }
.theme-picker__options { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: 192px; max-width: calc(100vw - 32px); max-height: min(320px, 60vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); }
.theme-picker__options button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 9px; text-align: left; font-size: 13px; }
.theme-picker__options button:hover, .theme-picker__trigger:hover { background: var(--surface-2); }
.theme-picker__options button[aria-pressed='true'] { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
.theme-picker__options button[aria-pressed='true']::after { content: '✓'; margin-left: auto; }
@media (prefers-reduced-motion: no-preference) {
  .theme-picker__options:not([hidden]) { animation: theme-options-in 180ms ease-out; }
}
@keyframes theme-options-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .theme-picker__chevron { transition: none; } }
:root:is([data-theme='violet'], [data-theme='cornflower'], [data-theme='rose']) .tool-card__botanical {
  opacity: .8;
  /* 三个花主题的角饰内容铺满画布（绿叶图只占右上约 76%），同盒视觉偏大约 30%，
     缩小到 104px 避免左下花枝压住卡片标题与摘要 */
  width: 104px;
  height: 104px;
}
:root:is([data-theme='cornflower'], [data-theme='rose']) .auth-bloom { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  :root:is([data-theme='cornflower'], [data-theme='rose']) .tool-card { animation: cornflower-arrive 480ms ease-out backwards; animation-delay: calc(min(var(--i), 7) * 35ms); transition: transform 220ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 220ms ease; }
  :root:is([data-theme='cornflower'], [data-theme='rose']) .tool-card__arrow { transition: transform 220ms ease; }
  :root:is([data-theme='cornflower'], [data-theme='rose']) .tool-card:hover .tool-card__arrow { transform: translateX(3px); }
  :root:is([data-theme='cornflower'], [data-theme='rose']) .auth-btn:active, :root:is([data-theme='cornflower'], [data-theme='rose']) .theme-picker button:active { transform: scale(.96); }
}
@keyframes cornflower-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .theme-picker button span { transition: none; } }

.theme-picker__options[hidden] { display: none; }
