/* ==========================================================================
   1234工具包 · 明快吸睛 / 平板界面风（融合 1234go.top + 牛马宝库）
   暖橙红品牌色 · 大圆角 · 明快渐变 · 弹性动效 · 滚动渐显
   ========================================================================== */

:root {
  /* 明快浅色 */
  --bg: #eef2ff;
  --bg-grad-1: #e9f0ff;
  --bg-grad-2: #fef0f6;
  --surface: #ffffff;
  --surface-2: #f5f7ff;
  --border: #e7e9f5;
  --border-strong: #d8dbf0;
  --text: #1d2440;
  --text-soft: #5a6480;
  --text-mute: #98a0bd;
  --accent: #dc6440;
  --accent-2: #f59e0b;
  --accent-soft: #fdeee8;
  --grad-brand: linear-gradient(120deg, #e8633f 0%, #f59231 50%, #f7b733 100%);
  --grad-warm: linear-gradient(120deg, #ff9a6c 0%, #ff7a59 50%, #ffc371 100%);
  --shadow-sm: 0 2px 6px rgba(70, 80, 160, .07), 0 6px 18px -10px rgba(70, 80, 160, .18);
  --shadow-md: 0 14px 34px -14px rgba(220, 100, 64, .32), 0 6px 14px -8px rgba(220, 100, 64, .15);
  --shadow-lg: 0 40px 90px -30px rgba(60, 50, 160, .5);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --topbar-h: 70px;
  --maxw: 1280px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0c1024;
  --bg-grad-1: #0e1230;
  --bg-grad-2: #1a1030;
  --surface: #161b35;
  --surface-2: #1c2244;
  --border: #2a3160;
  --border-strong: #36407a;
  --text: #eef1ff;
  --text-soft: #aab2d8;
  --text-mute: #6f78a6;
  --accent: #ff7a4d;
  --accent-2: #ffb347;
  --accent-soft: #34201a;
  --grad-brand: linear-gradient(120deg, #ff7a4d 0%, #ffa43a 50%, #ffc45e 100%);
  --grad-warm: linear-gradient(120deg, #ff9a6c 0%, #ff7a59 50%, #ffc371 100%);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .4), 0 6px 18px -10px rgba(0, 0, 0, .5);
  --shadow-md: 0 16px 38px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .75);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 18px); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(232, 99, 63, .15) 0%, transparent 55%),
    radial-gradient(900px 560px at -8% 8%, rgba(245, 158, 11, .13) 0%, transparent 52%),
    linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* 分类主题色（明快） */
.cat-common { --cat: #dc6440; --cat-soft: #fdeee8; --cat-glow: rgba(220,100,64,.34); }
.cat-doc  { --cat: #3b82f6; --cat-soft: #eaf0ff; --cat-glow: rgba(59,130,246,.32); }
.cat-util { --cat: #12b886; --cat-soft: #e3faf1; --cat-glow: rgba(18,184,134,.32); }
.cat-ai   { --cat: #8b5cf6; --cat-soft: #f1ebff; --cat-glow: rgba(139,92,246,.32); }
.cat-fun  { --cat: #ff7a59; --cat-soft: #fff0e9; --cat-glow: rgba(255,122,89,.32); }
[data-theme="dark"] .cat-common { --cat-soft: #34201a; }
[data-theme="dark"] .cat-doc  { --cat-soft: #181f4a; }
[data-theme="dark"] .cat-util { --cat-soft: #0f3328; }
[data-theme="dark"] .cat-ai   { --cat-soft: #241a44; }
[data-theme="dark"] .cat-fun  { --cat-soft: #321e16; }

/* 顶部滚动进度条 */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--grad-brand); z-index: 200; border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--cat-glow, rgba(220,100,64,.5));
  transition: width .12s ease-out;
}

/* ----------------------------- 顶部应用栏 ----------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad-brand); box-shadow: 0 8px 20px -6px rgba(220, 100, 64, .6);
  flex: none; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
.brand-logo:hover { transform: rotate(-10deg) scale(1.08); }
.brand-logo svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-size: 18px; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand-sub { font-size: 11px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search { flex: 1 1 auto; max-width: 580px; margin: 0 auto; position: relative; }
.search input {
  width: 100%; height: 46px; padding: 0 46px 0 46px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-size: 15px; font-family: inherit;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.search input::placeholder { color: var(--text-mute); }
.search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 10px 26px -12px var(--cat-glow, rgba(220,100,64,.5));
  transform: translateY(-1px);
}
.search .ic-search { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--text-mute); width: 19px; height: 19px; pointer-events: none; transition: color .2s; }
.search:focus-within .ic-search { color: var(--accent); }
.search .ic-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--border); color: var(--text-soft); cursor: pointer;
  display: none; place-items: center; font-size: 16px; line-height: 1; transition: background .2s;
}
.search .ic-clear:hover { background: var(--border-strong); }
.search.has-text .ic-clear { display: grid; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 13px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-soft); cursor: pointer; display: grid; place-items: center;
  transition: all .22s cubic-bezier(.34, 1.56, .64, 1);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px) rotate(-6deg); }
.icon-btn svg { width: 20px; height: 20px; }

/* ----------------------------- 主体布局 ----------------------------- */
.layout {
  max-width: var(--maxw); margin: 0 auto; padding: 30px 24px 64px;
  display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start;
}

/* 侧边栏 */
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + 30px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 15px; box-shadow: var(--shadow-sm);
}
.sidebar-title {
  font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--text-mute);
  text-transform: uppercase; padding: 4px 10px 14px;
}
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-soft); font-size: 14.5px; font-weight: 700;
  border: 1.5px solid transparent; transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.cat-item .cat-emoji { font-size: 19px; width: 24px; text-align: center; flex: none; transition: transform .3s; }
.cat-item .cat-count {
  margin-left: auto; font-size: 11px; font-weight: 800; color: var(--text-mute);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 9px;
}
.cat-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(4px); }
.cat-item:hover .cat-emoji { transform: scale(1.2) rotate(-6deg); }
.cat-item.active {
  background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 10px 24px -14px var(--cat-glow, rgba(220,100,64,.6));
}
.cat-item.active .cat-count { color: var(--accent); background: var(--surface); border-color: transparent; }

.sidebar-stat {
  margin-top: 16px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--grad-brand); color: #fff; font-size: 12.5px; line-height: 1.65; box-shadow: var(--shadow-sm);
}
.sidebar-stat b { font-size: 16px; }

/* ----------------------------- 内容区 ----------------------------- */
.content { min-width: 0; }

.hero {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 34px; margin-bottom: 30px; box-shadow: var(--shadow-sm);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none; z-index: 0; }
.hero-glow.glow-a {
  top: -130px; right: -60px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(232,99,63,.28), transparent 65%);
  animation: blob 14s ease-in-out infinite;
}
.hero-glow.glow-b {
  bottom: -150px; left: -50px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(245,158,11,.22), transparent 65%);
  animation: blob 18s ease-in-out infinite reverse;
}
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-26px, 22px) scale(1.12); }
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge-top {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border: 1.5px solid color-mix(in srgb, var(--accent) 32%, transparent);
  padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 10px; font-size: 30px; font-weight: 800; letter-spacing: .01em; line-height: 1.25; color: var(--text);
}
.grad-text {
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p { margin: 0; color: var(--text-soft); font-size: 14.5px; line-height: 1.65; }
.hero-badges { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.hero-badge {
  font-size: 12.5px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border: 1.5px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 7px 14px; border-radius: var(--radius-pill); white-space: nowrap;
  transition: transform .25s, box-shadow .25s; cursor: default;
}
.hero-badge:hover { transform: translateY(-3px); box-shadow: 0 10px 22px -12px var(--cat-glow, rgba(220,100,64,.6)); }

/* 分类区块 */
.section { margin-bottom: 34px; scroll-margin-top: calc(var(--topbar-h) + 18px); }
.section-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.section-head .sec-emoji { font-size: 24px; }
.section-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .02em; }
.section-head .sec-desc { color: var(--text-mute); font-size: 13px; }
.section-head .sec-count {
  margin-left: auto; font-size: 12px; font-weight: 800; color: var(--text-soft);
  border: 1.5px solid var(--border); border-radius: var(--radius-pill); padding: 3px 12px;
}

/* 工具卡片网格（平板大卡） */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px 16px; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  opacity: 0; transform: translateY(18px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.22, 1, .36, 1),
    box-shadow .3s ease, border-color .3s ease;
  transition-delay: var(--d, 0ms);
}
.card.in { opacity: 1; transform: none; }
.card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%;
  background: var(--cat, var(--accent)); transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.card:hover {
  transform: translateY(-7px) scale(1.018); border-color: color-mix(in srgb, var(--cat, var(--accent)) 45%, transparent);
  box-shadow: var(--shadow-md), 0 18px 40px -22px var(--cat-glow, rgba(220,100,64,.5));
}
.card:hover::after { transform: scaleX(1); }

.card-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-size: 27px; line-height: 1;
  background: var(--cat-soft, var(--surface-2));
  border: 1.5px solid color-mix(in srgb, var(--cat, var(--border-strong)) 22%, var(--border));
  flex: none; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.card:hover .card-icon { transform: scale(1.14) rotate(-5deg); }
.card-name { font-size: 15px; font-weight: 800; color: var(--text); }
.card-info {
  font-size: 12.5px; color: var(--text-soft); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px;
}
.card-go {
  margin-top: auto; font-size: 12px; font-weight: 800; color: var(--cat, var(--accent));
  display: flex; align-items: center; gap: 5px; opacity: .85; transition: gap .25s, opacity .25s;
}
.card:hover .card-go { opacity: 1; gap: 9px; }
.card-go svg { width: 14px; height: 14px; }

.card.hidden { display: none; }
.section.hidden { display: none; }

/* 空状态 */
.empty { display: none; text-align: center; padding: 70px 20px; color: var(--text-mute); }
.empty.show { display: block; animation: popIn .4s ease; }
.empty .big { font-size: 46px; margin-bottom: 10px; animation: floaty 3s ease-in-out infinite; }
.empty p { margin: 4px 0; }
@keyframes popIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ----------------------------- 页脚 ----------------------------- */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 56px;
  border-top: 1px solid var(--border); color: var(--text-mute); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
}
.footer a { color: var(--text-soft); }
.footer a:hover { color: var(--accent); }
.footer .spacer { flex: 1; }

/* ----------------------------- 模态框 ----------------------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 22, 55, .5);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; animation: modalPop .32s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes modalPop { from { transform: scale(.9) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head .m-emoji { font-size: 22px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-head .m-close {
  margin-left: auto; width: 34px; height: 34px; border-radius: 11px; border: none;
  background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 19px; transition: all .18s;
}
.modal-head .m-close:hover { background: #ffd9d9; color: #e23b3b; }
.modal-body { padding: 20px; }

/* 计算器 */
.calc-display {
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 16px;
  padding: 16px 18px; text-align: right; font-size: 28px; font-weight: 800;
  font-variant-numeric: tabular-nums; min-height: 34px; word-break: break-all; color: var(--text);
  margin-bottom: 14px;
}
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.calc-keys button {
  height: 52px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s; font-family: inherit;
}
.calc-keys button:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); }
.calc-keys button:active { transform: scale(.93); }
.calc-keys .op { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.calc-keys .eq { background: var(--grad-brand); color: #fff; border-color: transparent; grid-column: span 2; box-shadow: 0 10px 24px -12px var(--cat-glow, rgba(220,100,64,.6)); }
.calc-keys .clr { background: #ffeaea; color: #e23b3b; border-color: transparent; }

/* 单位换算 */
.conv-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.conv-row input, .conv-row select {
  height: 48px; border: 1.5px solid var(--border-strong); border-radius: 13px;
  background: var(--surface-2); color: var(--text); font-size: 15px; font-family: inherit; padding: 0 12px; width: 100%;
}
.conv-row input:focus, .conv-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.conv-arrow { color: var(--accent); font-size: 22px; flex: none; }
.conv-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.conv-tabs button {
  padding: 8px 15px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--text-soft); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .18s;
}
.conv-tabs button:hover { transform: translateY(-2px); }
.conv-tabs button.active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px var(--cat-glow, rgba(220,100,64,.6)); }

/* 退休倒计时 */
.retire-form { display: flex; gap: 12px; margin-bottom: 18px; align-items: flex-end; }
.retire-form label { font-size: 13px; color: var(--text-soft); display: block; margin-bottom: 7px; font-weight: 700; }
.retire-form input {
  height: 48px; border: 1.5px solid var(--border-strong); border-radius: 13px;
  background: var(--surface-2); color: var(--text); font-size: 15px; padding: 0 12px; width: 100%;
}
.retire-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.retire-result { background: var(--accent-soft); border-radius: 18px; padding: 22px; text-align: center; animation: popIn .4s ease; }
.retire-result .big { font-size: 38px; font-weight: 800; color: var(--accent); }
.retire-result .lbl { font-size: 13px; color: var(--text-soft); margin-top: 6px; }
.retire-detail { margin-top: 12px; font-size: 13px; color: var(--text-soft); }

/* ----------------------------- 响应式 ----------------------------- */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { position: static; margin-bottom: 24px; }
  .sidebar-stat { display: none; }
  .cat-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .cat-item { border: 1.5px solid var(--border); }
  .cat-item .cat-count { display: none; }
  .brand-sub { display: none; }
}

@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .brand-name { font-size: 16px; }
  .layout { padding: 18px 14px 50px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 22px; }
  .hero-badges { margin-left: 0; width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .card { padding: 16px 13px; }
  .card-icon { width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
}

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .card { opacity: 1; transform: none; }
}
