/* ══════════════════════════════════════════
   AIToolHub · main.css
   Industrial / Utilitarian Aesthetic
══════════════════════════════════════════ */

:root {
  --bg:       #0D0D0D;
  --surface:  #161616;
  --surface2: #1E1E1E;
  --border:   #2A2A2A;
  --border2:  #383838;
  --accent:   #F97316;
  --accent2:  #FB923C;
  --text:     #E5E5E5;
  --text2:    #9CA3AF;
  --text3:    #6B7280;
  --green:    #22C55E;
  --red:      #EF4444;
  --blue:     #38BDF8;
  --yellow:   #FBBF24;
  --radius:   8px;
  --sidebar-w: 240px;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: 'DM Sans', 'Segoe UI', sans-serif;
  --shadow:   0 4px 24px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ─── Ticker ─── */
.ticker-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 28px; background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #f97316 100%);
  background-size: 200% 200%;
  overflow: hidden;
  border-bottom: 1px solid rgba(194, 86, 10, 0.5);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.3);
}
.ticker-content {
  display: inline-flex; align-items: center; gap: 0;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  height: 28px; padding-left: 100%;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: #0D0D0D; letter-spacing: .5px;
}
.ticker-content span { padding: 0 12px; }
.ticker-content .sep { color: rgba(0,0,0,.4); padding: 0 4px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ─── Layout ─── */
.layout {
  display: flex;
  margin-top: 28px;
  min-height: calc(100vh - 28px);
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(22, 22, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(42, 42, 42, 0.6);
  display: flex; flex-direction: column;
  position: fixed; top: 28px; left: 0; bottom: 0;
  overflow-y: auto; z-index: 50;
  padding: 20px 0 12px;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #0D0D0D; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
  transition: transform 0.2s ease;
}
.logo-icon:hover {
  transform: scale(1.08);
}
.logo-name {
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -.5px;
}
.logo-sub { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box i { color: var(--text3); font-size: 12px; flex-shrink: 0; }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 12px; width: 100%;
}
.search-box input::placeholder { color: var(--text3); }

.nav-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase;
  padding: 0 18px; margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 18px; font-size: 13px; color: var(--text2);
  border-left: 2px solid transparent; transition: all .15s;
  position: relative;
}
.nav-item i { width: 14px; text-align: center; font-size: 12px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--surface2); border-left-color: var(--border2); }
.nav-item.active { color: var(--accent); background: rgba(249,115,22,.08); border-left-color: var(--accent); }
.nav-badge {
  margin-left: auto; font-size: 10px; font-family: var(--font-mono);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; color: var(--text3);
}
.nav-item.active .nav-badge { background: rgba(249,115,22,.15); border-color: rgba(249,115,22,.3); color: var(--accent); }

.sidebar-footer {
  margin-top: auto; padding: 16px 18px 0;
  border-top: 1px solid var(--border);
}
.stat-row { display: flex; gap: 0; margin-bottom: 10px; }
.stat-item { flex: 1; text-align: center; }
.stat-num { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 10px; color: var(--text3); margin-top: 2px; }
.version-tag { font-size: 10px; color: var(--text3); font-family: var(--font-mono); text-align: center; }

/* ─── Main ─── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; padding: 0 28px 40px;
  min-height: calc(100vh - 28px);
}

/* ─── Topbar ─── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px; gap: 12px;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; }
.page-title {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  color: var(--text); letter-spacing: -.5px;
}
.result-count {
  font-size: 12px; color: var(--text3); font-family: var(--font-mono);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.sort-btns { display: flex; gap: 4px; }
.sort-btn {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text3); font-size: 12px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.sort-btn.active, .sort-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(249,115,22,.08); }
.btn-login {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #0D0D0D;
  font-size: 12px; font-weight: 600; padding: 6px 14px;
  border-radius: 6px; font-family: var(--font-mono); transition: background .2s;
}
.btn-login:hover { background: var(--accent2); }
.user-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; color: var(--text2);
}
.user-chip button { color: var(--text3); font-size: 11px; margin-left: 4px; transition: color .15s; }
.user-chip button:hover { color: var(--red); }

/* ─── Hot Strip ─── */
.hot-strip {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.hot-label {
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  color: var(--accent); letter-spacing: .5px; flex-shrink: 0;
}
.hot-label i { margin-right: 4px; }
.hot-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.hot-tag {
  font-size: 11px; font-family: var(--font-mono);
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(22, 22, 22, 0.9) 100%);
  border: 1px solid rgba(42, 42, 42, 0.6);
  border-radius: 20px; padding: 4px 12px; color: var(--text2);
  cursor: pointer; transition: all .2s ease;
  backdrop-filter: blur(4px);
}
.hot-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(251, 146, 60, 0.05) 100%);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
  transform: translateY(-1px);
}

/* ─── Tool Grid ─── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tool-card {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.6) 0%, rgba(22, 22, 22, 0.8) 100%);
  border: 1px solid rgba(42, 42, 42, 0.4);
  border-radius: 12px;
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(8px);
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: transparent; transition: background .2s;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
}
.tool-card:hover::before { opacity: 1; background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent)); }
.tool-card:hover {
  border-color: rgba(249, 115, 22, 0.5);
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(22, 22, 22, 0.9) 100%);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(249, 115, 22, 0.1);
}
.tool-card:hover::before { background: var(--accent); }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tool-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.tool-card:hover .tool-icon {
  transform: scale(1.1);
}
.tool-icon.c-orange { background: linear-gradient(135deg, rgba(249,115,22,0.2) 0%, rgba(249,115,22,0.1) 100%); color: var(--accent); }
.tool-icon.c-blue   { background: linear-gradient(135deg, rgba(56,189,248,0.2) 0%, rgba(56,189,248,0.1) 100%); color: var(--blue); }
.tool-icon.c-green  { background: linear-gradient(135deg, rgba(34,197,94,0.2) 0%, rgba(34,197,94,0.1) 100%);  color: var(--green); }
.tool-icon.c-red    { background: linear-gradient(135deg, rgba(239,68,68,0.2) 0%, rgba(239,68,68,0.1) 100%);  color: var(--red); }
.tool-icon.c-yellow { background: linear-gradient(135deg, rgba(251,191,36,0.2) 0%, rgba(251,191,36,0.1) 100%); color: var(--yellow); }
.tool-icon.c-text3  { background: linear-gradient(135deg, rgba(107,114,128,0.2) 0%, rgba(107,114,128,0.1) 100%); color: var(--text2); }

.tool-cat-tag {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .5px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text3);
}
.tool-name {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3;
}
.tool-desc { font-size: 12px; color: var(--text2); line-height: 1.5; flex: 1; }
.tool-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tool-use-btn {
  font-size: 11px; font-family: var(--font-mono); font-weight: 600;
  color: var(--accent); background: rgba(249,115,22,.1);
  border: 1px solid rgba(249,115,22,.25); border-radius: 5px;
  padding: 4px 10px; transition: all .15s;
}
.tool-card:hover .tool-use-btn { background: rgba(249,115,22,.2); border-color: var(--accent); }
.tool-fav-btn {
  width: 26px; height: 26px; border-radius: 5px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text3); font-size: 11px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.tool-fav-btn.faved { color: var(--yellow); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.tool-fav-btn:hover { border-color: var(--yellow); color: var(--yellow); }

/* List View */
.tool-grid.list-view { grid-template-columns: 1fr; gap: 8px; }
.tool-grid.list-view .tool-card {
  flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px;
}
.tool-grid.list-view .tool-card-top { flex: 0 0 auto; }
.tool-grid.list-view .tool-cat-tag { display: none; }
.tool-grid.list-view .tool-desc { display: none; }
.tool-grid.list-view .tool-name { font-size: 13px; }
.tool-grid.list-view .tool-footer { margin-top: 0; }

/* Empty */
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text3);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: rgba(22, 22, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 56, 56, 0.6);
  border-radius: 16px; width: 90%; max-width: 720px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(249, 115, 22, 0.1);
  transform: translateY(16px) scale(.98); transition: transform .25s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title-row { display: flex; align-items: center; gap: 10px; }
.modal-icon { font-size: 20px; }
.modal-title { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.modal-actions { display: flex; align-items: center; gap: 6px; }
.modal-fav {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text3); font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-fav:hover { border-color: var(--yellow); color: var(--yellow); }
.modal-fav.faved { color: var(--yellow); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.modal-close {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text3); font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* ─── Tool Inner Components ─── */
.tool-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
label.t-label {
  font-size: 11px; font-family: var(--font-mono); color: var(--text3);
  letter-spacing: .5px; text-transform: uppercase;
}
textarea.t-area, input.t-input, select.t-select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 13px;
  padding: 10px 12px; outline: none; transition: border-color .15s; resize: vertical;
  font-family: var(--font-mono);
}
textarea.t-area { min-height: 90px; }
textarea.t-area:focus, input.t-input:focus, select.t-select:focus { border-color: var(--accent); }
select.t-select { cursor: pointer; }
select.t-select option { background: var(--surface2); }

.t-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #0D0D0D;
  font-size: 12px; font-weight: 700; font-family: var(--font-mono);
  border-radius: 6px; padding: 8px 16px; transition: background .15s;
}
.t-btn:hover { background: var(--accent2); }
.t-btn.outline {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border);
}
.t-btn.outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(249,115,22,.06); }
.t-btn.danger { background: var(--red); color: #fff; }
.t-btn.danger:hover { background: #dc2626; }
.t-btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.t-out {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; font-size: 13px;
  font-family: var(--font-mono); color: var(--text2);
  min-height: 44px; word-break: break-all; white-space: pre-wrap; line-height: 1.6;
}

.t-divider {
  width: 100%; height: 1px; background: var(--border); margin: 8px 0;
}

/* ─── Upload Zone ─── */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: 8px;
  padding: 22px 16px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--surface2); margin-bottom: 8px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: rgba(249,115,22,.05); }
.upload-zone .uz-icon { font-size: 26px; color: var(--text3); margin-bottom: 6px; }
.upload-zone .uz-hint { font-size: 11px; color: var(--text3); line-height: 1.5; }
.upload-zone .uz-name { font-size: 12px; color: var(--accent); margin-top: 6px; font-family: var(--font-mono); }

/* ─── AWR Specific ─── */
.awr-section { margin-top: 12px; }
.awr-section-title {
  font-size: 10px; font-family: var(--font-mono); font-weight: 700;
  color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 6px;
}
.awr-metric {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; margin-bottom: 4px; font-size: 12px;
}
.awr-metric .k { color: var(--text2); }
.awr-metric .v { font-weight: 700; font-family: var(--font-mono); }
.awr-metric .v.ok   { color: var(--green); }
.awr-metric .v.warn { color: var(--yellow); }
.awr-metric .v.bad  { color: var(--red); }
.awr-advice {
  background: rgba(249,115,22,.06); border: 1px solid rgba(249,115,22,.2);
  border-radius: 8px; padding: 12px 14px; margin-top: 10px; font-size: 12px; line-height: 1.7;
}
.awr-advice strong { color: var(--accent); display: block; margin-bottom: 6px; font-family: var(--font-mono); }
.awr-advice ul { padding-left: 16px; }
.awr-empty { color: var(--text3); font-size: 12px; font-style: italic; }

/* ─── Auth page ─── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; width: 100%; max-width: 420px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-logo-icon {
  width: 40px; height: 40px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: #0D0D0D; font-size: 18px;
}
.auth-logo-name { font-family: var(--font-mono); font-size: 18px; font-weight: 700; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.auth-tab {
  flex: 1; padding: 9px; text-align: center; font-size: 13px; font-family: var(--font-mono);
  font-weight: 600; color: var(--text3); cursor: pointer; transition: all .15s;
  background: var(--surface2);
}
.auth-tab.active { background: var(--accent); color: #0D0D0D; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field label { font-size: 11px; font-family: var(--font-mono); color: var(--text3); letter-spacing: .5px; }
.auth-submit {
  width: 100%; background: var(--accent); color: #0D0D0D;
  font-size: 14px; font-weight: 700; font-family: var(--font-mono);
  border-radius: 7px; padding: 11px; margin-top: 6px; transition: background .15s;
}
.auth-submit:hover { background: var(--accent2); }
.auth-msg { font-size: 12px; margin-top: 12px; text-align: center; min-height: 18px; }
.auth-msg.ok { color: var(--green); }
.auth-msg.err { color: var(--red); }
.auth-back { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text3); }
.auth-back a { color: var(--accent); }
.auth-back a:hover { text-decoration: underline; }

/* ─── Translate ─── */
.lang-swap-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lang-swap-row select { flex: 1; }
.swap-btn {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text3); font-size: 13px; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.swap-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Markdown 工具 ─── */
.md-wrap { display: flex; gap: 10px; height: 300px; }
.md-editor-pane, .md-preview-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.md-pane-label { font-size: 10px; font-family: var(--font-mono); color: var(--text3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.md-editor { flex: 1; resize: none; font-family: var(--font-mono); font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 10px; line-height: 1.6; outline: none; }
.md-editor:focus { border-color: var(--border2); }
.md-preview { flex: 1; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; font-size: 13px; line-height: 1.75; color: var(--text2); }
.md-preview h1,.md-preview h2,.md-preview h3,.md-preview h4 { color: var(--text); margin: 10px 0 6px; font-family: var(--font-mono); }
.md-preview h1 { font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.md-preview h2 { font-size: 15px; }
.md-preview h3 { font-size: 13px; }
.md-preview strong { color: var(--text); }
.md-preview a { color: var(--accent); }
.md-preview blockquote { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--text3); margin: 6px 0; }
.md-preview hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.md-preview ul,.md-preview ol { padding-left: 18px; }
.md-preview li { margin: 2px 0; }
.md-preview table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.md-preview td,.md-preview th { border: 1px solid var(--border); padding: 5px 8px; }
.md-preview th { background: var(--surface2); color: var(--text); }
.md-code { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 10px; margin: 6px 0; overflow-x: auto; font-size: 11px; font-family: var(--font-mono); color: var(--green); }
.md-inline-code { background: var(--surface2); padding: 1px 5px; border-radius: 3px; font-family: var(--font-mono); font-size: 11px; color: var(--accent); }

/* ─── 图片压缩 ─── */
.img-compare { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; flex-wrap: wrap; }
.img-stat { display: flex; flex-direction: column; gap: 2px; }

/* ─── JWT 解析 ─── */
.jwt-status { padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; margin-bottom: 8px; }
.jwt-section { margin-bottom: 8px; }
.jwt-section-title { font-size: 11px; font-family: var(--font-mono); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.jwt-pre { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 8px 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text2); white-space: pre; overflow-x: auto; }

/* ─── 番茄钟 ─── */
.pomo-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0; }
.pomo-mode-row { display: flex; gap: 8px; }
.pomo-mode { background: var(--surface); border: 1px solid var(--border); color: var(--text3); padding: 6px 14px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: all .15s; font-family: var(--font-sans); }
.pomo-mode:hover { border-color: var(--accent); color: var(--accent); }
.pomo-mode.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.pomo-clock { position: relative; width: 160px; height: 160px; }
.pomo-ring { width: 160px; height: 160px; }
.pomo-time { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -58%); font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--text); letter-spacing: 2px; }
.pomo-label { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.pomo-btn-row { display: flex; gap: 8px; }
.pomo-sessions { font-size: 12px; }

/* ─── Todo Tool ─── */
.todo-toolbar { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.todo-filter-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px; flex-wrap: wrap;
}
.todo-filter {
  background: none; border: 1px solid var(--border); color: var(--text3);
  padding: 3px 10px; border-radius: 20px; font-size: 11px; cursor: pointer;
  font-family: var(--font-sans); transition: all .15s;
}
.todo-filter:hover { border-color: var(--accent); color: var(--accent); }
.todo-filter.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.todo-count { font-size: 11px; color: var(--text3); margin-left: 4px; }
.todo-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.todo-list::-webkit-scrollbar { width: 4px; }
.todo-list::-webkit-scrollbar-track { background: transparent; }
.todo-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; transition: all .15s;
}
.todo-item:hover { border-color: var(--border2); }
.todo-item.done { opacity: .5; }
.todo-check {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--text3); flex-shrink: 0; padding: 0; transition: color .15s;
  line-height: 1;
}
.todo-check:hover { color: var(--accent); }
.todo-item.done .todo-check { color: var(--green); }
.todo-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.todo-text { font-size: 13px; color: var(--text); word-break: break-all; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text3); }
.todo-meta { display: flex; gap: 10px; align-items: center; }
.todo-del {
  background: none; border: none; cursor: pointer; font-size: 12px;
  color: var(--border2); padding: 4px; border-radius: 4px; flex-shrink: 0;
  transition: color .15s;
}
.todo-del:hover { color: var(--red); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 0 14px 40px; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .modal { width: 96%; max-height: 92vh; }
}
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* ─── SQL 代码生成 ─── */
.sc-out { min-height: 200px; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; }

/* ─── Linux 命令速查 ─── */
.lc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}
.lc-grid::-webkit-scrollbar { width: 4px; }
.lc-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.lc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.lc-item:hover { border-color: var(--accent); background: rgba(249,115,22,.04); }
.lc-cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.lc-cmd code {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  background: rgba(249,115,22,.1); border-radius: 3px; padding: 1px 6px;
  word-break: break-all; flex: 1;
}
.lc-copy-icon { font-size: 11px; color: var(--border2); flex-shrink: 0; transition: color .15s; }
.lc-item:hover .lc-copy-icon { color: var(--text3); }
.lc-meta { display: flex; align-items: center; gap: 8px; }
.lc-cat {
  font-size: 10px; font-family: var(--font-mono); color: var(--text3);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px; flex-shrink: 0;
}
.lc-desc { font-size: 11px; color: var(--text2); line-height: 1.4; }

/* ─── 汇率换算 ─── */
.er-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
}
.er-input-group { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.er-amount { font-size: 20px; font-family: var(--font-mono); color: var(--accent); text-align: center; }
.er-result {
  font-size: 22px; font-family: var(--font-mono); color: var(--green);
  text-align: center; font-weight: 700; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.er-select { font-size: 12px; }

/* ─── 身份证/手机号生成 ─── */
.idgen-wrap { display: flex; flex-direction: column; gap: 14px; }
.idgen-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
}
.idgen-title {
  font-size: 13px; font-weight: 600; font-family: var(--font-mono);
  color: var(--text); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.idgen-out {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto; margin-top: 8px;
}
.idgen-out::-webkit-scrollbar { width: 4px; }
.idgen-out::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.idgen-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px;
}
.idgen-value {
  font-family: var(--font-mono); font-size: 13px; color: var(--text); flex: 1;
  letter-spacing: .5px;
}
.idgen-area {
  font-size: 10px; color: var(--text3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 6px; flex-shrink: 0;
}
.idgen-copy-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text3); font-size: 11px; padding: 3px 7px;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.idgen-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.idgen-tip {
  background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.2);
  border-radius: 7px; padding: 10px 14px; font-size: 11px; color: var(--text3);
  line-height: 1.6; display: flex; align-items: flex-start; gap: 8px;
}
.idgen-tip strong { color: var(--yellow); }
