/* ====== 工具页面通用样式 ====== */
/* 基于index.html的样式变量，保持一致性 */

:root {
  --primary: #6c63ff;
  --secondary: #00d4ff;
  --accent: #ff6b6b;
  --accent2: #ffd93d;
  --dark: #0a0e1a;
  --dark2: #111827;
  --dark3: #1f2937;
  --card: rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.08);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --gradient1: linear-gradient(135deg, #6c63ff, #00d4ff);
  --gradient2: linear-gradient(135deg, #ff6b6b, #ffd93d);
  --gradient3: linear-gradient(135deg, #00d4ff, #06ffa5);
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ====== 导航栏（复用index.html样式） ====== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.95);
  border-bottom: 1px solid var(--card-border);
  padding: 0 5%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}

nav.scrolled {
  background: rgba(10, 14, 26, 0.97);
  box-shadow: 0 4px 30px rgba(108,99,255,0.15);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* ====== 工具页面容器 ====== */
.tool-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}

/* ====== 工具头部 ====== */
.tool-header {
  text-align: center;
  margin-bottom: 40px;
}

.tool-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: var(--gradient1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ====== 工具卡片 ====== */
.tool-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.tool-card-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ====== 按钮样式 ====== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient1);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(108,99,255,0.4);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: var(--dark3);
}

.btn-danger {
  background: var(--gradient2);
  color: white;
}

.btn-copy {
  background: var(--gradient3);
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ====== 输入框和文本区域 ====== */
textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 16px;
  background: var(--dark3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

textarea:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 200px;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* ====== 选项区域 ====== */
.options-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-group label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ====== 结果显示区域 ====== */
.result-area {
  margin-top: 20px;
  padding: 20px;
  background: var(--dark2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  min-height: 100px;
  position: relative;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.result-title {
  font-size: 1rem;
  color: var(--text-muted);
}

.copy-btn {
  position: absolute;
  top: 15px;
  right: 15px;
}

/* ====== 使用教程 ====== */
.tutorial-section {
  margin-top: 60px;
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

.tutorial-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.tutorial-section h3 {
  font-size: 1.2rem;
  margin: 20px 0 10px;
  color: var(--text);
}

.tutorial-section p, .tutorial-section li {
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.8;
}

.tutorial-section ul {
  padding-left: 20px;
}

/* ====== FAQ区域 ====== */
.faq-section {
  margin-top: 40px;
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

.faq-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.faq-answer {
  color: var(--text-muted);
  line-height: 1.8;
}

/* ====== Footer（复用index.html样式） ====== */
footer {
  background: var(--dark2);
  border-top: 1px solid var(--card-border);
  padding: 60px 5% 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 20px;
  color: var(--text);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  margin-top: 40px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ====== 响应式设计 ====== */
@media (max-width: 768px) {
  .tool-container {
    padding: 80px 15px 40px;
  }

  .tool-header h1 {
    font-size: 1.8rem;
  }

  .tool-card {
    padding: 20px;
  }

  .options-row {
    flex-direction: column;
  }

  .nav-links {
    display: none;
  }

  textarea {
    min-height: 150px;
  }
}

/* ====== 动画 ====== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ====== 浅色主题 ====== */
body.light-theme {
  --dark: #ffffff;
  --dark2: #f8fafc;
  --dark3: #e2e8f0;
  --card: rgba(0,0,0,0.02);
  --card-border: rgba(0,0,0,0.08);
  --text: #1e293b;
  --text-muted: #64748b;
}

body.light-theme .tool-card,
body.light-theme .tutorial-section,
body.light-theme .faq-section {
  background: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

body.light-theme textarea,
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme select {
  background: white;
  border-color: #e2e8f0;
  color: #1e293b;
}

body.light-theme .result-area {
  background: #f8fafc;
  border-color: #e2e8f0;
}
