:root {
  --bg: #06070b;
  --rail-bg: #080a10;
  --panel: rgba(18, 22, 31, 0.72);
  --line: rgba(122, 145, 180, 0.14);
  --line-2: rgba(122, 145, 180, 0.3);
  --ink: #e8eef7;
  --dim: #93a1b8;
  --faint: #5f6c82;
  --mint: #34e0a1;
  --mint-deep: #12b981;
  --amber: #ffb86b;
  --radius: 18px;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  display: grid;
  grid-template-columns: 236px 1fr;
  position: relative;
}

/* 背景光晕 + 网格 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 90vh;
  background:
    radial-gradient(46% 60% at 26% 6%, rgba(52, 224, 161, 0.13), transparent 70%),
    radial-gradient(44% 56% at 82% 0%, rgba(255, 184, 107, 0.1), transparent 72%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(122, 145, 180, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(122, 145, 180, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 55% at 55% 0%, #000 0%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

/* ---------------- 侧栏 ---------------- */
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 14px 18px;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.96), rgba(6, 7, 11, 0.86));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  text-decoration: none;
  color: var(--ink);
}

.rail-brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--mint), #1c8fb8);
  color: #04120d;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 0 22px rgba(52, 224, 161, 0.3);
  flex: 0 0 auto;
}

.rail-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.rail-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--faint);
  margin-top: 3px;
}

.rail-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--dim);
  text-decoration: none;
  font-size: 13.5px;
  transition: background 0.18s, color 0.18s;
  position: relative;
}

.rail-nav a:hover { background: rgba(122, 145, 180, 0.07); color: var(--ink); }

.rail-nav a.active {
  background: rgba(52, 224, 161, 0.09);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--mint);
}

.rail-nav a .ic {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(122, 145, 180, 0.1);
  color: var(--dim);
  flex: 0 0 auto;
}

.rail-nav a.active .ic { background: rgba(52, 224, 161, 0.18); color: var(--mint); }

.rail-nav a .soon {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
}

.rail-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--faint);
  font-family: var(--font-mono);
  padding: 10px 10px 0;
  border-top: 1px solid var(--line);
}

.pulse i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---------------- 主区 ---------------- */
.main {
  position: relative;
  z-index: 1;
  width: min(1000px, 100% - 64px);
  margin: 0 auto;
  padding: 46px 0 72px;
  min-height: 100dvh;
}

.view[hidden] { display: none !important; }
.view { animation: rise 0.45s ease both; }

.page-head { margin-bottom: 30px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--mint);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.sub { color: var(--dim); font-size: 14px; margin-top: 10px; max-width: 560px; }

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

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(20, 25, 35, 0.92), rgba(9, 11, 16, 0.6));
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(52, 224, 161, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 224, 161, 0.4);
  box-shadow: 0 24px 48px -30px rgba(52, 224, 161, 0.75);
}

.tool-card:hover::after { opacity: 1; }

.tool-card .ti {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(52, 224, 161, 0.12);
  border: 1px solid rgba(52, 224, 161, 0.24);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 17px;
  margin-bottom: 4px;
}

.tool-card h3 { font-size: 15.5px; font-weight: 600; letter-spacing: 0.01em; }
.tool-card p { font-size: 12.5px; color: var(--dim); line-height: 1.55; }

.tool-card .badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--mint);
  border: 1px solid rgba(52, 224, 161, 0.3);
  border-radius: 5px;
  padding: 1px 6px;
  text-transform: uppercase;
}

.tool-card.soon { opacity: 0.5; cursor: default; }
.tool-card.soon:hover { transform: none; border-color: var(--line); box-shadow: none; }
.tool-card.soon .ti { background: rgba(122, 145, 180, 0.1); border-color: var(--line); color: var(--faint); }
.tool-card.soon .badge { color: var(--faint); border-color: var(--line); }

.grid-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--faint);
  font-family: var(--font-mono);
}

/* ---------------- 工具页 ---------------- */
.back {
  display: inline-block;
  font-size: 12.5px;
  color: var(--faint);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back:hover { color: var(--mint); }

.tool-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 26px; }

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(52, 224, 161, 0.12);
  border: 1px solid rgba(52, 224, 161, 0.24);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 18px;
  flex: 0 0 auto;
}

.tool-head h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  line-height: 1.25;
}

.tool-head .sub { margin-top: 6px; font-size: 13.5px; }

/* ---------------- 输入区 ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

.input-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }

.field {
  position: relative;
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  align-items: center;
  background: rgba(6, 8, 12, 0.72);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus-within {
  border-color: rgba(52, 224, 161, 0.55);
  box-shadow: 0 0 0 4px rgba(52, 224, 161, 0.08);
}

.field input {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 15px 8px 15px 16px;
}

.field input::placeholder { color: var(--faint); }

.icon-btn {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12.5px;
  padding: 0 14px;
  cursor: pointer;
  border-left: 1px solid var(--line);
  transition: color 0.2s;
}

.icon-btn:hover { color: var(--mint); }

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 13px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  padding: 15px 30px;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  white-space: nowrap;
}

.btn-primary {
  color: #04120d;
  background: linear-gradient(140deg, var(--mint), var(--mint-deep));
  box-shadow: 0 12px 30px -12px rgba(52, 224, 161, 0.7);
}

.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { filter: grayscale(0.5) brightness(0.75); cursor: progress; transform: none; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}

.tag {
  font-size: 12px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
}

.tag.on { color: var(--mint); border-color: rgba(52, 224, 161, 0.35); background: rgba(52, 224, 161, 0.06); }

.hint { margin-top: 12px; font-size: 12.5px; color: var(--faint); font-family: var(--font-mono); }

/* ---------------- 结果 ---------------- */
.result { margin-top: 22px; display: none; }
.result.show { display: block; animation: rise 0.45s ease both; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.card-head { display: flex; gap: 18px; padding: 18px; flex-wrap: wrap; }

.thumb {
  width: 150px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  object-fit: cover;
  background: #11151d;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.meta { flex: 1 1 240px; min-width: 0; }

.meta .plat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--mint);
  border: 1px solid rgba(52, 224, 161, 0.3);
  border-radius: 6px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.meta h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
  margin: 12px 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--dim);
  font-family: var(--font-mono);
}

.dl-area { padding: 0 18px 18px; display: grid; gap: 10px; }

.dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(6, 8, 12, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.dl:hover {
  border-color: rgba(52, 224, 161, 0.45);
  background: rgba(52, 224, 161, 0.06);
  transform: translateX(2px);
}

.dl .label { font-size: 13.5px; }
.dl .label span { color: var(--faint); font-family: var(--font-mono); font-size: 11.5px; margin-left: 8px; }

.dl .go {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mint);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.gallery a {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #11151d;
}

.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery a::after {
  content: "↓";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(6, 8, 12, 0.78);
  color: var(--mint);
  font-size: 12px;
  border: 1px solid rgba(52, 224, 161, 0.4);
}

.section-label {
  padding: 0 18px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

.error {
  display: none;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 120, 120, 0.35);
  background: rgba(255, 90, 90, 0.08);
  color: #ffb4b4;
  font-size: 13.5px;
}

.error.show { display: block; animation: rise 0.3s ease both; }

/* ---------------- 历史 ---------------- */
.history { margin-top: 40px; }

.history h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}

.history h3 button {
  background: none;
  border: 0;
  color: var(--faint);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.history h3 button:hover { color: var(--amber); }

.hist-list { display: grid; gap: 8px; }

.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(12, 15, 22, 0.6);
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.hist-item:hover { border-color: var(--line-2); color: var(--ink); }
.hist-item img { width: 34px; height: 44px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
/* min-width:0 必须显式写：flex 子项默认按内容最小宽度撑开，长标题会把整页顶宽 */
.hist-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .p { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); text-transform: uppercase; }

/* ---------------- 特性 / 页脚 ---------------- */
.features {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.feat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(160deg, rgba(18, 22, 31, 0.7), rgba(9, 11, 16, 0.4));
}

.feat b { display: block; font-size: 14px; margin-bottom: 6px; }
.feat p { font-size: 12.5px; color: var(--dim); }

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--mint); }

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

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

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }

  .rail {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-brand { padding: 0; flex: 0 0 auto; }
  .rail-name small { display: none; }

  .rail-nav { flex-direction: row; gap: 6px; overflow: visible; }
  .rail-nav a { white-space: nowrap; padding: 7px 11px; font-size: 12.5px; }
  .rail-nav a .ic { display: none; }
  .rail-nav a.active { box-shadow: inset 0 -2px 0 var(--mint); border-radius: 8px; }
  .rail-foot { display: none; }

  .main { width: min(1000px, 100% - 32px); padding: 28px 0 56px; }
  .page-head { margin-bottom: 22px; }
  .tool-grid { grid-template-columns: 1fr; gap: 10px; }

  .input-row { flex-direction: column; }
  .field { flex: 1 1 auto; width: 100%; }
  /* 移动端输入框字号必须 ≥16px，否则聚焦时浏览器会自动放大页面 */
  .field input { font-size: 16px; }
  .btn-primary { width: 100%; }

  .thumb { width: 108px; }
  .card-head { gap: 14px; }
  .back { margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------- 侧栏分组 ---------------- */
.rail-group {
  margin: 14px 0 4px;
  padding-left: 11px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #7d8ba1;
  text-transform: uppercase;
}

.rail-nav a .ic {
  font-size: 12px;
  line-height: 1;
}

/* ---------------- 首页分类 ---------------- */
.cat { margin-bottom: 26px; }

.cat-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #c3cfe1;
  margin-bottom: 12px;
  font-family: var(--font-body);
}

.cat-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--mint), rgba(52, 224, 161, 0.25));
}

.cat-title span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  color: #93a1b8;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 0 6px;
  line-height: 16px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
}

.tool-card { padding: 18px 20px; gap: 7px; }
.tool-card .ti { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; margin-bottom: 2px; }
.tool-card h3 { font-size: 14.5px; }
.tool-card p { font-size: 12px; }

/* ---------------- 工具内容容器 ---------------- */
.tool-host { display: block; }

/* ---------------- 番茄钟 ---------------- */
.pomo { display: grid; gap: 20px; justify-items: center; }

.pomo-stage { position: relative; width: 220px; height: 220px; }

.pomo-ring {
  --p: 0deg;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(var(--mint) var(--p), rgba(122, 145, 180, 0.12) 0);
  display: grid;
  place-items: center;
  transition: background 0.4s linear;
}

.pomo-ring[data-mode="short"] { background: conic-gradient(#7dd3fc var(--p), rgba(122, 145, 180, 0.12) 0); }
.pomo-ring[data-mode="long"] { background: conic-gradient(var(--amber) var(--p), rgba(122, 145, 180, 0.12) 0); }

.pomo-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #0a0e15;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
}

.pomo-time {
  font-family: var(--font-mono);
  font-size: 40px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.pomo-mode { font-size: 12px; color: var(--faint); letter-spacing: 0.2em; }

.pomo-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.08em;
}

@media (max-width: 980px) {
  .rail-group { display: none; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .pomo-stage { width: 180px; height: 180px; }
  .pomo-ring { width: 180px; height: 180px; }
  .pomo-time { font-size: 32px; }
}

/* 侧栏导航滚动条隐藏（内容仍可滚动） */
.rail-nav { scrollbar-width: none; -ms-overflow-style: none; }
.rail-nav::-webkit-scrollbar { width: 0; height: 0; }

/* 页脚：备案号必须常驻可见（个人站点备案要求底部展示并链接工信部） */
.site-foot {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
}

.site-foot a {
  color: var(--faint);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
}

.site-foot a:hover { color: var(--mint); border-bottom-color: var(--mint); }
