/* AI Toolbox - 统一暗色现代风格 */
:root {
  --bg: #0a0e1a;
  --bg-card: #131826;
  --bg-hover: #1a2138;
  --border: #232a3d;
  --text: #e6e9f0;
  --text-dim: #8a92a8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #10b981;
  --error: #ef4444;
  --radius: 10px;
  --max-w: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon { font-size: 24px; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { color: var(--text-dim); font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--text); }
.lang-switch {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

/* Main container */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 640px;
  margin: 0 auto;
}

/* Search */
.search-box {
  max-width: 560px;
  margin: 24px auto 0;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  transition: border-color .15s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Category section */
.category {
  margin: 48px 0 24px;
}
.category h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .2s;
  display: block;
  color: var(--text);
}
.tool-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.tool-card .icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.tool-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}
.tool-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Tool page */
.tool-header {
  text-align: center;
  margin-bottom: 32px;
}
.tool-header .icon { font-size: 48px; margin-bottom: 12px; }
.tool-header h1 { font-size: 32px; margin-bottom: 8px; }
.tool-header p { color: var(--text-dim); }

.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.input-row label { color: var(--text-dim); font-size: 14px; }

textarea, input[type=text], input[type=number], input[type=password], select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color .15s;
}
textarea { min-height: 200px; line-height: 1.5; }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: var(--accent-hover); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.stats {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}
.stat-item strong { color: var(--text); margin-right: 4px; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--success);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity .2s;
  z-index: 1000;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* Article (about, etc) */
.article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
}
.article h1 { margin-bottom: 16px; }
.article h2 { margin: 24px 0 12px; font-size: 20px; }
.article p, .article ul { margin-bottom: 12px; color: var(--text-dim); }
.article ul { padding-left: 24px; }
.article code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
  color: var(--accent-hover);
}

/* Related tools */
.related {
  margin-top: 40px;
}
.related h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-dim);
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 60px;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent-hover); }

/* Responsive */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .nav { gap: 14px; }
  .container { padding: 20px 16px; }
  .hero { padding: 30px 10px 20px; }
  .article { padding: 20px; }
}
