/* ToolMatrix — 全局样式（极简 + 移动端适配 + AdSense 广告位规范） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: #1a1a2e; background: #f8f9fb; line-height: 1.6; }
.container { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: #1a1a2e; color: #fff; padding: 14px 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-header a { color: #fff; text-decoration: none; }
.logo { font-weight: 700; font-size: 1.2rem; }
.logo span { color: #4ecdc4; }
.nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.9rem; }
.nav a:hover { color: #4ecdc4; }

/* Main */
main { padding: 28px 0 40px; }
h1 { font-size: 1.7rem; margin-bottom: 8px; color: #1a1a2e; }
h2 { font-size: 1.2rem; margin: 24px 0 10px; }
p.subtitle { color: #5a5a72; margin-bottom: 20px; font-size: 0.98rem; }

/* Tool card / box */
.tool-box { background: #fff; border: 1px solid #e5e7f0; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.tool-box label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
textarea, input[type="text"], input[type="number"], select { width: 100%; padding: 10px 12px; border: 1px solid #cfd4e6; border-radius: 8px; font-size: 0.95rem; font-family: 'SF Mono', Consolas, 'Courier New', monospace; background: #fbfbfe; }
textarea { min-height: 120px; resize: vertical; }
textarea.short { min-height: 70px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.btn { background: #1a1a2e; color: #fff; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 0.92rem; font-weight: 600; }
.btn:hover { background: #2d2d4e; }
.btn.secondary { background: #e5e7f0; color: #1a1a2e; }
.btn.secondary:hover { background: #d3d7e6; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.output-box { background: #f4f5fa; border: 1px dashed #c3c9e0; border-radius: 8px; padding: 12px; min-height: 48px; font-family: 'SF Mono', Consolas, 'Courier New', monospace; font-size: 0.9rem; word-break: break-all; white-space: pre-wrap; margin-top: 8px; }
.result-msg { font-size: 0.85rem; margin-top: 6px; min-height: 20px; }
.ok { color: #1a9e5c; }
.err { color: #d64545; }

/* FAQ */
.faq-item { background: #fff; border: 1px solid #e5e7f0; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.faq-item h3 { font-size: 0.98rem; margin-bottom: 4px; }
.faq-item p { font-size: 0.9rem; color: #4a4a60; }

/* Related tools */
.related { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.related a { background: #eef0f8; border: 1px solid #e0e4f0; padding: 8px 14px; border-radius: 8px; text-decoration: none; color: #1a1a2e; font-size: 0.88rem; }
.related a:hover { background: #e0e4f5; }

/* Ad slots — 视觉分离，标注 Ad（合规 A5）*/
.ad-slot { background: #fafafa; border: 1px dashed #d5d5e0; border-radius: 8px; padding: 12px; text-align: center; color: #999; font-size: 0.75rem; margin: 16px 0; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.ad-slot::before { content: 'Ad'; position: relative; font-weight: 700; color: #bbb; margin-right: 8px; }

/* Footer */
.site-footer { background: #1a1a2e; color: #9a9ab0; padding: 18px 0; font-size: 0.82rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer a { color: #9a9ab0; text-decoration: none; }
.site-footer a:hover { color: #4ecdc4; }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #1a1a2e; color: #fff; padding: 12px 20px; display: none; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; z-index: 1000; }
.cookie-banner .btn { padding: 6px 16px; font-size: 0.82rem; }
.cookie-banner a { color: #4ecdc4; }

/* Tool index grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { background: #fff; border: 1px solid #e5e7f0; border-radius: 10px; padding: 16px; text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s; }
.tool-card:hover { border-color: #4ecdc4; box-shadow: 0 4px 14px rgba(78, 205, 196, .15); }
.tool-card h3 { font-size: 1rem; margin-bottom: 4px; }
.tool-card p { font-size: 0.85rem; color: #5a5a72; }

/* Responsive */
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .row { flex-direction: column; }
  .row > * { min-width: 0; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}
