/* ========================================
   txtool.tools — Brand Theme
   Dark code-editor aesthetic + teal accent
   ======================================== */

:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2335;
  --bg-input: #0d1220;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --text: #e8e8e8;
  --text-secondary: #8892a4;
  --border: #1e293b;
  --border-accent: #00d4aa44;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

/* === HEADER === */
.b-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.b-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.b-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.b-logo small { color: var(--text-secondary); font-weight: 400; font-size: 14px; }
.b-nav {
  display: flex;
  gap: 20px;
  flex: 1;
}
.b-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.2s;
}
.b-nav a:hover { color: var(--accent); }
.b-lang-switch {
  margin-left: auto;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  appearance: auto;
}
.b-lang-switch option { background: var(--bg-card); color: var(--text); }

/* === MAIN === */
.b-main { min-height: calc(100vh - 120px); }

/* === HERO (Homepage) === */
.h-hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
}
.h-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 800px 400px at 50% 0%, rgba(0, 212, 170, 0.08), transparent);
  pointer-events: none;
}
.h-hero-content { position: relative; max-width: 720px; margin: 0 auto; }
.h-hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.h-hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.5;
}

/* === SEARCH === */
.h-search {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}
.h-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.h-search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.h-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* === TOOL GRID === */
.h-tools {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.h-section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}
.h-cat-title {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text-secondary);
}

/* Hot tools */
.h-hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.hc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text) !important;
  transition: all 0.25s;
}
.hc-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.hc-hot .hc-card {
  border-color: var(--accent);
  border-width: 1.5px;
}
.hc-icon { font-size: 18px; margin-bottom: 4px; }
.hc-name { font-weight: 600; font-size: 14px; }
.hc-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

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

/* === TOOL PAGE === */
.t-section { padding: 48px 24px; }
.t-container { max-width: 960px; margin: 0 auto; }
.t-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  margin-bottom: 8px;
}
.t-desc { color: var(--text-secondary); font-size: 16px; margin-bottom: 32px; }
.t-subtitle { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }

.t-toolbox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
@media (max-width: 768px) {
  .t-toolbox { grid-template-columns: 1fr; }
}

.t-input-area { display: flex; flex-direction: column; gap: 12px; }
.t-dual-input {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.t-dual-input > div { flex: 1; }
.t-input-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; display: block; }

.t-textarea {
  width: 100%;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.3s;
}
.t-textarea:focus { outline: none; border-color: var(--accent); }

.t-extra-input {
  width: 120px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

.t-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.t-btn {
  padding: 10px 24px;
  background: var(--accent);
  color: #0a0e1a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.t-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.t-btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.t-output-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.t-output-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.t-output {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 60px;
  color: var(--accent);
}

/* Result rows */
.tr-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tr-label { color: var(--text-secondary); }
.tr-val { font-weight: 600; color: var(--accent); }
.tr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-table th, .tr-table td { padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.tr-table th { color: var(--text-secondary); font-weight: 500; }
.tr-diff td { width: 50%; }
.tr-removed { background: rgba(255,0,0,0.1); color: #ff6b6b; }
.tr-added { background: rgba(0,255,0,0.1); color: #51cf66; }
.tr-compare { font-size: 13px; }
.tr-line { display: flex; padding: 4px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.tr-line.diff { background: rgba(255,255,0,0.05); }
.tr-num { color: var(--text-secondary); width: 30px; flex-shrink: 0; }
.tr-left, .tr-right { flex: 1; white-space: pre; overflow-x: auto; }
.tr-line.diff .tr-left { color: #ff6b6b; }
.tr-line.diff .tr-right { color: #51cf66; }

/* === RELATED === */
.t-related { max-width: 960px; margin: 0 auto 40px; padding: 0 24px; }
.t-related h3 { margin-bottom: 16px; font-size: 18px; }
.t-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

/* === FAQ === */
.t-faq { max-width: 960px; margin: 0 auto 60px; padding: 0 24px; }
.t-faq h3 { margin-bottom: 20px; font-size: 18px; }
.t-faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.t-faq-item h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  cursor: pointer;
  color: var(--text);
}
.t-faq-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === STATIC PAGES === */
.s-section { padding: 60px 24px; }
.s-container { max-width: 720px; margin: 0 auto; }
.s-container h1 { font-size: 32px; font-weight: 800; margin-bottom: 24px; }
.s-container p { color: var(--text-secondary); font-size: 16px; line-height: 1.8; margin-bottom: 16px; }

/* === FOOTER === */
.b-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  background: rgba(10, 14, 26, 0.6);
}
.b-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.b-footer-links { display: flex; gap: 16px; }
.b-footer-links a { color: var(--text-secondary); font-size: 13px; }
.b-footer-copy { color: var(--text-secondary); font-size: 12px; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .b-header-inner { padding: 0 16px; gap: 12px; }
  .b-nav a { font-size: 13px; }
  .h-hero { padding: 48px 16px 40px; }
  .h-tools { padding: 0 16px 60px; }
  .t-section { padding: 32px 16px; }
  .h-tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .h-hot-grid { grid-template-columns: repeat(2, 1fr); }
}
