/* ========== 捷帮 - 小工具站 全局样式 ========== */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4F46E5;
  --primary-light: #818CF8;
  --primary-dark: #3730A3;
  --accent: #F59E0B;
  --bg: #F9FAFB;
  --bg-white: #FFFFFF;
  --text: #1F2937;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Header */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.site-slogan {
  font-size: 14px;
  color: var(--text-light);
}

/* Navigation */
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-size: 15px;
  color: var(--text-light);
  transition: color 0.2s;
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 60px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Tool Grid */
.tools-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
  color: inherit;
}

.tool-card .tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

.tool-card .tool-icon.blue { background: #EEF2FF; }
.tool-card .tool-icon.green { background: #ECFDF5; }
.tool-card .tool-icon.yellow { background: #FFFBEB; }
.tool-card .tool-icon.purple { background: #F5F3FF; }
.tool-card .tool-icon.red { background: #FEF2F2; }
.tool-card .tool-icon.cyan { background: #ECFEFF; }
.tool-card .tool-icon.orange { background: #FFF7ED; }
.tool-card .tool-icon.pink { background: #FDF2F8; }

.tool-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Tool Page Layout */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}

.tool-header {
  margin-bottom: 32px;
}

.tool-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-header p {
  font-size: 15px;
  color: var(--text-light);
}

.tool-body {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group textarea,
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--bg);
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

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

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

.btn-accent:hover {
  background: #D97706;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Result Display */
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.result-box h4 {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 600;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 12px;
}

.stat-item .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-item .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Color Preview */
.color-preview {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  transition: background-color 0.3s;
}

.color-values {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.color-value-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.color-value-item .label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
}

.color-value-item .value {
  font-size: 14px;
  font-weight: 500;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* QR Code */
#qrcode-output {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin-top: 20px;
}

#qrcode-output canvas,
#qrcode-output img {
  border-radius: 8px;
}

/* Password Display */
.password-display {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 22px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  word-break: break-all;
  letter-spacing: 2px;
  margin-bottom: 16px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Password Options */
.password-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.password-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.password-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Unit Converter */
.converter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.converter-row input {
  flex: 1;
}

.converter-row select {
  width: 160px;
}

.swap-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.swap-btn:hover {
  background: var(--primary-dark);
  transform: rotate(180deg);
}

/* Share Section */
.share-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 20px;
  text-align: center;
}

.share-section p {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 20px;
}

.share-qr {
  display: inline-block;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px 16px;
  box-shadow: var(--shadow);
}

.share-qr #site-qrcode {
  display: flex;
  justify-content: center;
}

.share-qr #site-qrcode img,
.share-qr #site-qrcode canvas {
  border-radius: 8px;
}

.share-tip {
  font-size: 13px !important;
  color: var(--text-light) !important;
  margin-top: 12px !important;
  margin-bottom: 0 !important;
}

/* Footer */
.site-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-top: 60px;
}

.site-footer a {
  color: var(--text-light);
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 26px;
  }

  .hero p {
    font-size: 15px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-body {
    padding: 20px;
  }

  .password-options {
    grid-template-columns: 1fr;
  }

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

  .converter-row select {
    width: 100%;
  }

  .nav-links {
    display: none;
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}
