/* ==========================================================================
   百宝箱 — Neo-Brutalist Design System
   100% 离线本地运行 · 无需联网 · 零外部字体依赖
   ========================================================================== */

:root {
  --paper: #fff8f4;
  --paper-2: #f4ecff;
  --surface: #ffffff;
  --surface-2: #fcebe2;
  --field: #ffffff;

  --ink: #221738;
  --ink-rgb: 34 23 56;
  --ink-2: #493b66;
  --ink-3: #6e5f8c;
  --ink-4: #a598be;

  --line-soft: rgba(34, 23, 56, 0.14);
  --line-mid: rgba(34, 23, 56, 0.30);
  --hover: rgba(140, 102, 255, 0.08);
  --active: rgba(140, 102, 255, 0.15);
  --shadow-color: #221738;

  --accent: #8c66ff;
  --accent-fg: #ffffff;
  --focus: #8c66ff;
  --peach: #ffad87;
  --peach-soft: #ffd9c7;
  --purple: #b799ff;
  --purple-soft: #e7dcff;
  --success: #12804a;
  --success-bg: #7ee8b7;
  --warning: #9a6500;
  --danger: #d4291b;

  /* 12 Category Accent Colors (Harmonized with Purple & Peach) */
  --cat-images: #8c66ff;
  --cat-pdf: #ff8a7a;
  --cat-data: #9be870;
  --cat-developer: #b799ff;
  --cat-text: #ffbe88;
  --cat-design: #ff99cc;
  --cat-files: #72e0b4;
  --cat-utilities: #ffad70;
  --cat-business: #e8b08a;
  --cat-social: #ff85b3;
  --cat-security: #75d8f0;
  --cat-media: #d98aff;

  --cat: #ffad87;
  --on-cat: #221738;

  --bw: 2px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 14px;

  --sh-sm: 2px 2px 0 var(--shadow-color);
  --sh: 4px 4px 0 var(--shadow-color);
  --sh-lg: 6px 6px 0 var(--shadow-color);
  --sh-xl: 8px 8px 0 var(--shadow-color);

  --sidebar-w: 256px;
  --topbar-h: 58px;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --paper: #161124;
  --paper-2: #1f1833;
  --surface: #251d3d;
  --surface-2: #31264f;
  --field: #120d1f;

  --ink: #fbf4ff;
  --ink-rgb: 251 244 255;
  --ink-2: #dfd2f5;
  --ink-3: #b3a2d4;
  --ink-4: #786799;

  --line-soft: rgba(251, 244, 255, 0.16);
  --line-mid: rgba(251, 244, 255, 0.34);
  --hover: rgba(183, 153, 255, 0.12);
  --active: rgba(183, 153, 255, 0.2);
  --shadow-color: #090612;

  --accent: #b799ff;
  --accent-fg: #161124;
  --focus: #ffad87;
  --peach: #ffad87;
  --peach-soft: #3d2730;
  --purple: #b799ff;
  --purple-soft: #2e2352;
  --success: #7ee8b7;
  --success-bg: #5fd99a;
  --warning: #ffd275;
  --danger: #ff8a80;
}

/* Category Contexts */
[data-cat="images"]    { --cat: var(--cat-images);    --on-cat: #ffffff; }
[data-cat="pdf"]       { --cat: var(--cat-pdf);       --on-cat: #111111; }
[data-cat="data"]      { --cat: var(--cat-data);      --on-cat: #111111; }
[data-cat="developer"] { --cat: var(--cat-developer); --on-cat: #111111; }
[data-cat="text"]      { --cat: var(--cat-text);      --on-cat: #111111; }
[data-cat="design"]    { --cat: var(--cat-design);    --on-cat: #111111; }
[data-cat="files"]     { --cat: var(--cat-files);     --on-cat: #111111; }
[data-cat="utilities"] { --cat: var(--cat-utilities); --on-cat: #111111; }
[data-cat="business"]  { --cat: var(--cat-business);  --on-cat: #111111; }
[data-cat="social"]    { --cat: var(--cat-social);    --on-cat: #111111; }
[data-cat="security"]  { --cat: var(--cat-security);  --on-cat: #111111; }
[data-cat="media"]     { --cat: var(--cat-media);     --on-cat: #111111; }

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

code, pre, .mono {
  font-family: var(--font-mono);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* Patterns */
.stripes {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 8px,
    rgba(17, 17, 17, 0.065) 8px 10px
  );
}
[data-theme="dark"] .stripes {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 8px,
    rgba(17, 17, 17, 0.14) 8px 10px
  );
}

.checker {
  background-image:
    linear-gradient(45deg, rgba(128,128,128,0.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(128,128,128,0.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(128,128,128,0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(128,128,128,0.16) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--paper-2);
  border-right: var(--bw) solid var(--ink);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width 160ms var(--ease), transform 200ms var(--ease);
}

.sidebar.collapsed {
  width: 68px;
}

.sidebar-head {
  height: var(--topbar-h);
  padding: 0 14px;
  border-bottom: var(--bw) solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: var(--ink);
  border-radius: 5px;
  flex-shrink: 0;
}

.brand-logo span {
  border-radius: 2px;
  display: block;
}
.brand-logo span:nth-child(1) { background: #ff6b5e; }
.brand-logo span:nth-child(2) { background: #ffd84d; }
.brand-logo span:nth-child(3) { background: #4d6fff; }
.brand-logo span:nth-child(4) { background: #5ce1a3; }

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-count,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .search-trigger-text,
.sidebar.collapsed .kbd-group,
.sidebar.collapsed .sidebar-note-text {
  display: none;
}

.sidebar.collapsed .sidebar-head {
  justify-content: center;
  padding: 0 8px;
}

.sidebar.collapsed .brand {
  display: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: var(--bw) solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 90ms var(--ease);
}

.icon-btn:hover {
  background: var(--hover);
  border-color: var(--ink);
}

.icon-btn.bordered {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

.icon-btn.bordered:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--sh);
}

.icon-btn.bordered:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.sidebar-search-wrap {
  padding: 12px 12px 8px;
  flex-shrink: 0;
}

.search-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease);
}

.search-trigger:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--sh);
  color: var(--ink);
}

.search-trigger:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.sidebar.collapsed .search-trigger {
  justify-content: center;
  padding: 8px;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
}

.kbd-group {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
}

.nav-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 12px 8px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r);
  border: var(--bw) solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: left;
  transition: background-color 100ms var(--ease), border-color 100ms var(--ease);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--ink);
}

.nav-item.active {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: var(--sh-sm);
  color: var(--ink);
  font-weight: 700;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px;
}

.cat-badge {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1.8px solid var(--ink);
  background: var(--cat);
  color: var(--on-cat);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-badge.lg {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  border-width: 2px;
  box-shadow: var(--sh-sm);
}

.cat-badge.xl {
  width: 48px;
  height: 48px;
  border-radius: 9px;
  border-width: 2px;
  box-shadow: var(--sh);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}

.sidebar-foot {
  border-top: var(--bw) solid var(--ink);
  padding: 10px;
  background: var(--paper-2);
  flex-shrink: 0;
}

.cathy-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffb38e, #c5a8ff);
  color: #221738;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  font-weight: 800;
  font-size: 13px;
  text-align: left;
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease);
}

.cathy-banner:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--sh);
}

.cathy-banner:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.sidebar.collapsed .cathy-banner {
  justify-content: center;
  padding: 8px;
}

/* Main Column */
.main-col {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 160ms var(--ease);
}

.sidebar.collapsed ~ .main-col {
  margin-left: 68px;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--paper);
  border-bottom: var(--bw) solid var(--ink);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
}

.topbar-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-cat-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  line-height: 1.1;
}

.topbar-cat-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.topbar-h {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.shortcut-hints {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
  margin-right: 6px;
}

.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.local-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--success-bg);
  color: #111111;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  font-size: 12px;
  font-weight: 800;
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease);
}

.local-pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--sh);
}

.local-pill:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.local-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #111111;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 24px 28px 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Buttons & Tactile Components
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 800;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-sm);
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease), background-color 120ms var(--ease);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--sh);
}

.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: #ffad87;
  color: #221738;
}

.btn-purple {
  background: #c5a8ff;
  color: #221738;
}

.btn-accent {
  background: var(--cat);
  color: var(--on-cat);
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-danger {
  background: #ff6b5e;
  color: #111111;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 11px 20px;
  font-size: 14.5px;
}

/* Cards */
.card {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
}

.card-sm {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
}

.card-interactive {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease);
}

.card-interactive:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--sh-lg);
}

.card-interactive:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* Form Controls */
.input, .select, .textarea {
  width: 100%;
  background: var(--field);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.input:focus, .select:focus, .textarea:focus {
  box-shadow: var(--sh-sm);
  border-color: var(--ink);
}

.textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.textarea.code {
  font-family: var(--font-mono);
  font-size: 13px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink-2);
}

.range-input {
  width: 100%;
  accent-color: var(--ink);
  cursor: pointer;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 700;
  border: var(--bw) solid transparent;
  border-radius: var(--r);
  color: var(--ink-2);
  background: var(--paper-2);
  transition: background-color 100ms var(--ease), border-color 100ms var(--ease);
}

.tab-btn:hover {
  color: var(--ink);
  border-color: var(--line-mid);
}

.tab-btn.active {
  background: var(--cat);
  color: var(--on-cat);
  border-color: var(--ink);
  box-shadow: var(--sh-sm);
}

/* ==========================================================================
   Dashboard (Home)
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.hero-h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.hero-mark {
  display: inline-block;
  background: #ffad87;
  color: #221738;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  padding: 1px 12px 3px;
  box-shadow: var(--sh);
  transform: rotate(-1.5deg);
  margin-left: 4px;
}

.love-dedication {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  margin-bottom: 14px;
  background: var(--purple-soft);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--sh-sm);
  font-size: 13px;
  font-weight: 800;
}

.hero-rabbit-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
}

.hero-rabbit-mascot {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, #ffd9c7, #e7dcff);
  border: var(--bw) solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--sh);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-3deg);
}

.feedback-banner {
  background: linear-gradient(135deg, #f4ecff 0%, #ffe6d9 100%);
  color: #221738;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

[data-theme="dark"] .feedback-banner {
  background: linear-gradient(135deg, #2b2147 0%, #3d2732 100%);
  color: #fbf4ff;
}

.disclaimer-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1.5px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.65;
  width: 100%;
}

.hero-sub {
  font-size: 15.5px;
  color: var(--ink-2);
  max-width: 520px;
  margin: 0 0 20px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding-top: 16px;
  border-top: var(--bw) solid var(--line-soft);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}

/* Universal Drop Card */
.drop-card {
  background: linear-gradient(145deg, #ffc3a6 0%, #d4bfff 100%);
  color: #221738;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
  position: relative;
}

.drop-card:hover, .drop-card.dragover {
  transform: translate(-2px, -2px);
  box-shadow: var(--sh-xl);
}

.drop-card.dragover {
  background: linear-gradient(145deg, #ffad87 0%, #b799ff 100%);
}

.drop-plus {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #fffdf8;
  color: #111111;
  border: var(--bw) solid #111111;
  box-shadow: 3px 3px 0 #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  transform: rotate(-5deg);
}

.drop-title {
  font-size: 22px;
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
}

.drop-sub {
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(17, 17, 17, 0.78);
  margin: 0;
}

.drop-kinds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 340px;
}

.drop-kind {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  background: rgba(255, 253, 248, 0.82);
  border: 1.5px solid #111111;
  border-radius: 4px;
}

.drop-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.drop-foot {
  font-size: 11.5px;
  font-weight: 800;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Quick Actions Row */
.section-block {
  margin-bottom: 34px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 20px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.02em;
}

.section-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 3px 0 0;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  font-weight: 700;
  font-size: 13px;
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease);
}

.quick-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--sh);
}

.quick-chip:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.quick-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1.5px solid var(--ink);
  background: var(--cat);
}

/* Workspace Row (Recent + Favorites) */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.workspace-panel {
  padding: 18px;
}

.workspace-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.workspace-panel-title {
  font-size: 15px;
  font-weight: 900;
  margin: 0;
}

.empty-box {
  padding: 18px 14px;
  background: var(--paper);
  border: 1.5px dashed var(--line-mid);
  border-radius: var(--r);
  color: var(--ink-3);
  font-size: 13px;
}

.mini-tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
}

.mini-tool-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  transition: transform 80ms var(--ease), background-color 80ms var(--ease);
}

.mini-tool-btn:hover {
  background: var(--surface);
  transform: translate(-1px, -1px);
  box-shadow: var(--sh-sm);
}

/* Category Summary Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cat-tile {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.cat-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-tile-name {
  font-size: 16px;
  font-weight: 900;
  margin: 0;
}

.cat-tile-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.45;
}

/* Tool Card Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tool-card {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  position: relative;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-card-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

.tool-card-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.45;
}

.tool-card-cat {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}

/* Category Page Banner */
.cat-banner {
  background: var(--cat);
  color: var(--on-cat);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 24px 26px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cat-banner h1 {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 6px;
}

.cat-banner p {
  margin: 0;
  font-size: 14.5px;
  opacity: 0.9;
}

/* ==========================================================================
   Tool Workspace Layout
   ========================================================================== */
.tool-workspace {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: 24px;
}

.tool-body {
  padding: 20px;
}

.tool-statusbar {
  padding: 8px 16px;
  background: var(--paper-2);
  border-top: var(--bw) solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.status-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.tool-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tool-split-side {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.file-dropzone {
  border: 2px dashed var(--ink);
  border-radius: var(--r-lg);
  background: var(--paper);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms var(--ease), transform 90ms var(--ease);
}

.file-dropzone:hover, .file-dropzone.dragover {
  background: color-mix(in srgb, var(--cat) 18%, var(--surface));
}

.file-dropzone h3 {
  margin: 10px 0 6px;
  font-size: 17px;
  font-weight: 900;
}

.file-dropzone p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink-3);
}

.preview-box {
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  padding: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: var(--paper);
}

.preview-box img, .preview-box canvas {
  max-width: 100%;
  max-height: 460px;
  height: auto;
  display: block;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.kv-card {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  padding: 10px 12px;
}

.kv-card-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.kv-card-val {
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  word-break: break-all;
}

.result-list {
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1.5px solid var(--line-soft);
}

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

.result-row:hover {
  background: var(--hover);
}

/* Tool Help / Related Section */
.tool-help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.help-card {
  padding: 18px;
}

.help-card h3 {
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 10px;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ==========================================================================
   Modals & Popovers & Toast
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.52);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 24px;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  overflow: hidden;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}

.modal-head {
  padding: 14px 16px;
  border-bottom: var(--bw) solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper-2);
}

.modal-title {
  font-size: 15px;
  font-weight: 900;
  margin: 0;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.modal-foot {
  padding: 10px 16px;
  border-top: var(--bw) solid var(--ink);
  background: var(--paper-2);
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Command Palette */
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: var(--bw) solid var(--ink);
  background: var(--field);
}

.cmd-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r);
  border: 1.5px solid transparent;
  text-align: left;
}

.cmd-item:hover, .cmd-item.selected {
  background: var(--paper-2);
  border-color: var(--ink);
}

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

.cmd-item-name {
  font-weight: 800;
  font-size: 13.5px;
}

.cmd-item-desc {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--ink);
  color: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 700;
  max-width: 340px;
}

/* Data Table */
.data-table-wrap {
  overflow: auto;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  max-height: 400px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th, .data-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--paper-2);
  font-weight: 800;
  position: sticky;
  top: 0;
  border-bottom: var(--bw) solid var(--ink);
}

/* Footer */
.site-footer {
  border-top: var(--bw) solid var(--ink);
  padding: 24px 28px;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-3);
}

/* Sidebar mobile overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  z-index: 35;
}

/* Print styles (for Invoice / Receipt / Markdown printing) */
@media print {
  .sidebar, .topbar, .site-footer, .tool-toolbar, .tool-statusbar, .tool-help-grid, .no-print {
    display: none !important;
  }
  .main-col { margin-left: 0 !important; }
  .main-content { padding: 0 !important; max-width: none !important; }
  .tool-workspace { border: none !important; box-shadow: none !important; }
  body { background: #ffffff !important; color: #111111 !important; }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-split, .tool-split-side, .tool-help-grid, .workspace-grid {
    grid-template-columns: 1fr;
  }
  .shortcut-hints { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .main-col {
    margin-left: 0 !important;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .main-content {
    padding: 16px 14px 36px;
  }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   XiaoTuTu Rabbit Brand & Alipay Donation Modal
   ========================================================================== */
.rabbit-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffc3a6, #d4bfff);
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--shadow-color);
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-3);
  margin-left: 3px;
}

.alipay-card {
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: #f0f7ff;
  color: #111111;
  padding: 18px;
  text-align: center;
  box-shadow: var(--sh);
}

.alipay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1677ff;
  color: #ffffff;
  border: 2px solid #111111;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.alipay-qr-wrap {
  display: inline-block;
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: var(--r-lg);
  padding: 10px;
  box-shadow: 4px 4px 0 #111111;
  margin: 8px 0 12px;
}

.alipay-qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: contain;
  border-radius: 6px;
}

/* Language Switcher (🇨🇳 中文 / 🇦🇺 EN / 🇮🇩 ID) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--ink);
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1.1;
  transition: background 120ms ease, color 120ms ease;
}
.lang-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.lang-btn.active {
  background: var(--purple, #8b5cf6);
  color: #ffffff;
}
@media (max-width: 640px) {
  .lang-btn { padding: 4px 6px; font-size: 11.5px; }
  .lang-btn span { display: none; }
  .topbar { height: 54px; padding: 0 10px; }
  .topbar-right { gap: 6px; }
  .local-pill { display: none; }
  .love-dedication { font-size: 11.5px; padding: 6px 11px; align-items: flex-start; line-height: 1.45; }
  .hero-rabbit-row { gap: 12px; }
  .hero-rabbit-mascot svg { width: 56px; height: 56px; }
  .hero-h1 { font-size: 27px; line-height: 1.15; }
  .hero-sub { font-size: 14px; line-height: 1.55; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-actions #home-search-btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .hero-actions .btn { justify-content: center; padding: 10px 10px; font-size: 13.5px; }
  .hero-stats { gap: 10px; padding-top: 12px; }
  .stat-num { font-size: 22px; }
  .drop-card { padding: 18px 14px; }
  .input, .select, .textarea, .cmd-input { font-size: 16px; }
  .tool-split { grid-template-columns: 1fr !important; }
}

@media (hover: none) and (pointer: coarse) {
  #universal-drop .drop-btns span:last-child { display: none; }
}
