/* ============================================
   ToolSite 2.0 - 多功能在线工具站
   Multi-function Online Tool Site
   Features: Dark Mode, Search, Animations
   ============================================ */

/* ===== CSS Variables: Light Mode (Default) ===== */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --nav-bg: rgba(255,255,255,0.85);
  --success: #22c55e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --nav-height: 64px;
  --max-width: 1200px;
  --input-bg: #f8fafc;
  --result-bg: #f1f5f9;
  --result-content-bg: #ffffff;
  --badge-success-bg: #dcfce7;
  --badge-success-text: #166534;
  --badge-info-bg: #dbeafe;
  --badge-info-text: #1e40af;
  --hero-gradient: linear-gradient(135deg, #1e293b, #6366f1);
  --shadow-card-hover: 0 20px 40px rgba(99,102,241,0.12), 0 8px 16px rgba(0,0,0,0.08);
  --category-bg: transparent;
  --search-bg: #ffffff;
  --footer-bg: transparent;
  --scrollbar-bg: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
}

/* ===== CSS Variables: Dark Mode ===== */
.dark-mode {
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-light: #1e1b4b;
  --bg: #0b1120;
  --card-bg: #111827;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #1e293b;
  --nav-bg: rgba(11,17,32,0.88);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.45);
  --input-bg: #0f172a;
  --result-bg: #0f172a;
  --result-content-bg: #111827;
  --badge-success-bg: #052e16;
  --badge-success-text: #86efac;
  --badge-info-bg: #172554;
  --badge-info-text: #93c5fd;
  --hero-gradient: linear-gradient(135deg, #818cf8, #c084fc);
  --shadow-card-hover: 0 20px 40px rgba(129,140,248,0.15), 0 8px 16px rgba(0,0,0,0.3);
  --category-bg: rgba(129,140,248,0.06);
  --search-bg: #111827;
  --footer-bg: transparent;
  --scrollbar-bg: #0f172a;
  --scrollbar-thumb: #1e293b;
}

* { 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;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Fade-in Animation ===== */
.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Navigation ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 1.2rem;
  transition: color 0.3s ease;
}

.nav-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem;
  transition: background 0.3s ease;
}

.nav-links {
  display: flex; align-items: center; gap: 8px;
}

.nav-links a {
  text-decoration: none; color: var(--text-secondary);
  padding: 6px 14px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover { background: var(--primary-light); color: var(--primary); }

.lang-toggle {
  background: var(--border); border: none;
  padding: 6px 12px; border-radius: 8px;
  cursor: pointer; font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); transition: all 0.2s;
  font-family: var(--font);
}

.lang-toggle:hover { background: var(--primary); color: white; }

/* ===== Dark Mode Toggle Button ===== */
.dark-toggle {
  background: var(--border); border: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.dark-toggle:hover { background: var(--primary-light); }

/* ===== Ad Slots ===== */
.ad-slot {
  background: var(--result-bg);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 24px 0;
  text-align: center;
  border: 1px dashed var(--border);
}

.ad-slot-horizontal { min-height: 120px; }
.ad-slot-sidebar { min-height: 300px; }

/* ===== Main Content ===== */
main {
  padding-top: calc(var(--nav-height) + 32px);
  padding-bottom: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Search Bar ===== */
.search-section {
  max-width: 550px;
  margin: 0 auto 32px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--search-bg);
  color: var(--text);
  outline: none;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ===== Tool Count ===== */
.tool-count {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.tool-count span { font-weight: 700; color: var(--primary); }

/* ===== Category Sections ===== */
.category-section {
  margin-bottom: 36px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 16px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.category-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.category-header .category-icon {
  font-size: 1.5rem;
}

/* ===== Tool Grid ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
  display: block;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--primary);
}

.tool-card-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
  transition: transform 0.3s;
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.1);
}

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Hidden (for search filtering) ===== */
.tool-card.hidden {
  display: none;
}

.category-section.hidden {
  display: none;
}

/* ===== Tool Page ===== */
.tool-page { max-width: 800px; margin: 0 auto; }

.tool-header {
  text-align: center;
  padding: 24px 0 32px;
}

.tool-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--text-secondary);
}

.tool-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.tool-box textarea,
.tool-box input[type="text"],
.tool-box input[type="number"],
.tool-box input[type="url"],
.tool-box input[type="datetime-local"],
.tool-box select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.tool-box textarea:focus,
.tool-box input:focus,
.tool-box select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.tool-box textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

.btn-secondary {
  background: var(--result-bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34,197,94,0.35);
}

.btn-group {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
}

.result-area {
  margin-top: 20px;
  padding: 16px;
  background: var(--result-bg);
  border-radius: var(--radius-sm);
  display: none;
  transition: background 0.3s ease;
}

.result-area.show { display: block; }

.result-area .result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.result-area .result-content {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  line-height: 1.6;
  background: var(--result-content-bg);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.result-area .result-copy {
  margin-top: 10px;
}

/* ===== Stats Grid (tool page) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  background: var(--result-bg);
  border-radius: var(--radius-sm);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
  transition: border-color 0.3s ease;
}

footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.footer-stats {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.footer-stats strong {
  color: var(--primary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}

.footer-links a {
  font-size: 0.85rem;
}

/* ===== SEO-related content blocks ===== */
.seo-content {
  margin-top: 40px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.8;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.seo-content p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.seo-content:last-child p:last-child {
  margin-bottom: 0;
}

/* ===== Status Badge ===== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.success { background: var(--badge-success-bg); color: var(--badge-success-text); }
.status-badge.info { background: var(--badge-info-bg); color: var(--badge-info-text); }

/* ===== Back to Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
  transition: all 0.3s;
  z-index: 99;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.45);
}

/* ===== 404 Page ===== */
.error-page {
  text-align: center;
  padding-top: 80px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--border);
  margin-bottom: 16px;
  line-height: 1;
}

.error-page h1 {
  margin-bottom: 12px;
  font-size: 1.8rem;
}

.error-page p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-search {
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}

/* ===== IP Lookup Styles ===== */
.ip-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ip-info-item {
  padding: 12px 16px;
  background: var(--result-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.ip-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.ip-info-value {
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-all;
}

.ip-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary);
}

.ip-loading .spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Timestamp Styles ===== */
.ts-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ts-mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  transition: all 0.2s;
  background: var(--input-bg);
  color: var(--text-secondary);
}

.ts-mode-btn.active {
  background: var(--primary);
  color: white;
}

.ts-mode-btn:not(.active):hover {
  background: var(--border);
}

/* ===== UUID Styles ===== */
.uuid-options {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.uuid-count-input {
  width: 100px !important;
  text-align: center;
}

.uuid-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.uuid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--result-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.uuid-item .uuid-text {
  word-break: break-all;
  margin-right: 8px;
}

.uuid-item .uuid-copy-btn {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.uuid-item .uuid-copy-btn:hover {
  background: var(--primary);
  color: white;
}

/* ===== Case Convert Styles ===== */
.case-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.case-btn {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  transition: all 0.2s;
}

.case-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.case-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-box { padding: 20px; }
  .nav-links a { padding: 6px 10px; font-size: 0.8rem; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .form-row { flex-direction: column; }
  .form-row .form-group { margin-bottom: 12px; }
  .ip-info-grid { grid-template-columns: 1fr; }
  .case-buttons { grid-template-columns: repeat(2, 1fr); }
  .uuid-options { flex-direction: column; align-items: flex-start; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
  .ts-mode-toggle { flex-direction: column; border-radius: var(--radius-sm); }
}

@media (max-width: 480px) {
  .hero { padding: 24px 0; }
  .hero h1 { font-size: 1.5rem; }
  .nav-inner { padding: 0 16px; }
  main { padding-left: 16px; padding-right: 16px; }
  .category-header h2 { font-size: 1.1rem; }
}

/* ===== Beautification & Animations ===== */

/* Stagger fade-in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.tool-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }
.tool-card:nth-child(7) { animation-delay: 0.35s; }
.tool-card:nth-child(8) { animation-delay: 0.4s; }
.tool-card:nth-child(9) { animation-delay: 0.45s; }
.tool-card:nth-child(10) { animation-delay: 0.5s; }
.tool-card:nth-child(n+11) { animation-delay: 0.55s; }

/* Glow border on hover */
.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15), 0 0 15px rgba(107, 70, 193, 0.3);
  border-color: #6b46c1;
}

.dark-mode .tool-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px rgba(107, 70, 193, 0.5);
}

/* Smooth theme toggle transition */
.theme-btn {
  transition: transform 0.3s ease;
}
.theme-btn:hover {
  transform: rotate(30deg);
}

/* Search icon styling */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
  margin: 0 20px;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.6;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: transparent;
}

.search-input:focus {
  border-color: #6b46c1;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.dark-mode .search-input {
  border-color: #444;
  color: #e0e0e0;
}

.dark-mode .search-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Tool page breadcrumb */
.breadcrumb {
  padding: 10px 0;
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}
.breadcrumb a { color: #6b46c1; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.dark-mode .breadcrumb { color: #999; }
.dark-mode .breadcrumb a { color: #8b5cf6; }

/* Tool page styling */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.tool-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .tool-container { grid-template-columns: 1fr; }
}

.input-section, .output-section {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #eee;
}

.dark-mode .input-section,
.dark-mode .output-section {
  background: #1e1e1e;
  border-color: #333;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #555;
}

.dark-mode .output-header { color: #aaa; }

.tool-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
  background: #fff;
  color: #333;
}

.dark-mode .tool-input {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #444;
}

.tool-input:focus {
  border-color: #6b46c1;
}

.btn-primary, .btn-secondary {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 8px;
}

.btn-primary {
  background: #6b46c1;
  color: white;
}
.btn-primary:hover {
  background: #5533a0;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}
.btn-secondary:hover {
  background: #ccc;
}

.dark-mode .btn-secondary {
  background: #444;
  color: #ddd;
}
.dark-mode .btn-secondary:hover {
  background: #555;
}

.btn-group {
  margin: 10px 0;
}

.output-area {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  min-height: 100px;
  border: 1px solid #eee;
}

.dark-mode .output-area {
  background: #2a2a2a;
  border-color: #444;
}

.output-area pre {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  color: #333;
}

.dark-mode .output-area pre {
  color: #e0e0e0;
}

.copy-btn {
  padding: 4px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: #6b46c1;
  color: white;
  border-color: #6b46c1;
}
.dark-mode .copy-btn {
  border-color: #555;
  color: #aaa;
}
.dark-mode .copy-btn:hover {
  background: #6b46c1;
  color: white;
  border-color: #6b46c1;
}

/* No result */
.no-result {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}
.no-result.hidden { display: none; }
.no-result.visible { display: block; }

/* Timer display */
.timer-display {
  font-size: 48px;
  font-weight: bold;
  text-align: center;
  padding: 20px;
  color: #6b46c1;
  font-family: 'Consolas', monospace;
}

.dark-mode .timer-display { color: #8b5cf6; }

/* Markdown preview */
.markdown-preview {
  margin-top: 15px;
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  min-height: 100px;
}
.dark-mode .markdown-preview {
  background: #2a2a2a;
  border-color: #444;
}

/* Ad placeholder */
.ad-placeholder {
  text-align: center;
  padding: 20px;
  margin: 20px 0;
  background: #f5f5f5;
  border-radius: 8px;
  border: 2px dashed #ddd;
  color: #aaa;
  font-size: 14px;
}
.dark-mode .ad-placeholder {
  background: #1e1e1e;
  border-color: #333;
  color: #666;
}

/* SEO content section */
.seo-content {
  margin: 30px 0;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  line-height: 1.8;
}
.dark-mode .seo-content {
  background: #1e1e1e;
}
.seo-content h2 { color: #333; margin-bottom: 10px; }
.dark-mode .seo-content h2 { color: #ddd; }
.seo-content p { color: #666; }
.dark-mode .seo-content p { color: #999; }

/* Checkbox group styling */
.checkbox-group label {
  display: block;
  margin: 5px 0;
  font-size: 14px;
  cursor: pointer;
}
.checkbox-group input { margin-right: 6px; }

/* Responsive */
@media (max-width: 600px) {
  .nav-search { display: none; }
  .timer-display { font-size: 32px; }
}

/* Calculator */
.calc-display {
  width: 100%;
  padding: 20px;
  font-size: 32px;
  text-align: right;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin-bottom: 15px;
  font-family: 'Consolas', monospace;
  box-sizing: border-box;
  min-height: 70px;
  color: #333;
}
.dark-mode .calc-display {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.calc-btn {
  padding: 18px;
  font-size: 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.calc-btn:active { transform: scale(0.95); }
.calc-num { background: #f0f0f0; color: #333; }
.calc-num:hover { background: #e0e0e0; }
.dark-mode .calc-num { background: #3a3a3a; color: #e0e0e0; }
.dark-mode .calc-num:hover { background: #4a4a4a; }
.calc-op { background: #e8e0f0; color: #6b46c1; }
.calc-op:hover { background: #ddd0ec; }
.dark-mode .calc-op { background: #2a2050; color: #8b5cf6; }
.dark-mode .calc-op:hover { background: #3a3060; }
.calc-eq { background: #6b46c1; color: white; }
.calc-eq:hover { background: #5533a0; }
.calc-clear { background: #ffe0e0; color: #d32f2f; }
.calc-clear:hover { background: #ffcccc; }
.dark-mode .calc-clear { background: #402020; color: #ff6b6b; }
.dark-mode .calc-clear:hover { background: #503030; }
.calc-zero { grid-column: span 2; }