/* ===== zqf.ltd 全局样式 v2.0 - 现代化 UI ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* 主色调 - 深空蓝 */
  --primary: #6366f1;
  --primary-light: #eef2ff;
  --primary-hover: #4f46e5;
  --primary-dark: #3730a3;

  /* 辅助色 */
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --pink: #ec4899;
  --pink-light: #fdf2f8;

  /* 中性色 */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-muted: #f5f5f5;
  --bg-dark: #0f0f1a;
  --text: #18181b;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  --border: #f0f0f3;
  --border-hover: #d4d4d8;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.05), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.06), 0 8px 10px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(99,102,241,0.15);

  /* 渐变 */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-cool: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-pink: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  --grad-hero: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);

  /* 过渡 */
  --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--t-fast);
}

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

::selection { background: var(--primary); color: #fff; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Layout ===== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.80);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  transition: box-shadow var(--t-normal);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.navbar-brand .brand-text {
  color: var(--text);
}

.navbar-brand .brand-text .accent {
  color: var(--primary);
}

.navbar-brand .tld {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 18px;
}

.navbar-nav {
  display: flex;
  gap: 4px;
  list-style: none;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: var(--radius-full);
}

.navbar-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all var(--t-normal);
  border-bottom: none;
}

.navbar-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.7);
}

.navbar-nav a.active {
  color: var(--primary);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 96px 0 56px;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 24px;
  position: relative;
}

.hero .hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  100% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 20px;
  position: relative;
}

.hero h1 .accent {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
  position: relative;
}

.hero-search {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 15px;
  outline: none;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transition: all var(--t-normal);
}

.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1), var(--shadow-lg);
}

.hero-search .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  position: relative;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

.hero-stat .label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Category Section ===== */
.section {
  padding: 40px 0;
}

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

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
}

.section-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Tool Grid ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--t-normal);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity var(--t-normal);
}

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

.tool-card:hover::before {
  opacity: 1;
}

.tool-card .tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  transition: transform var(--t-normal);
}

.tool-card:hover .tool-icon {
  transform: scale(1.08);
}

.tool-card .tool-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.tool-card .tool-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tool-card .tool-arrow {
  position: absolute;
  bottom: 20px;
  right: 20px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--t-normal);
  color: var(--text-muted);
  font-size: 16px;
}

.tool-card:hover .tool-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* category colors */
.cat-utility .tool-icon { background: var(--success-light); color: var(--success); }
.cat-utility .dot { background: var(--success); }
.cat-utility .tool-card::before { background: var(--grad-cool); }

.cat-fun .tool-icon { background: var(--warning-light); color: var(--warning); }
.cat-fun .dot { background: var(--warning); }
.cat-fun .tool-card::before { background: var(--grad-warm); }

.cat-text .tool-icon { background: var(--pink-light); color: var(--pink); }
.cat-text .dot { background: var(--pink); }
.cat-text .tool-card::before { background: var(--grad-pink); }

.cat-storage .tool-icon { background: var(--primary-light); color: var(--primary); }
.cat-storage .dot { background: var(--primary); }
.cat-storage .tool-card::before { background: var(--grad-primary); }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  margin-top: 64px;
  background: var(--bg-soft);
}

.footer-brand {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-brand .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--grad-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.footer p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}

.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer .footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Tool Page Layout ===== */
.tool-page {
  padding: 48px 0;
}

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

.tool-header .back {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  transition: all var(--t-fast);
}

.tool-header .back:hover {
  background: var(--border);
  color: var(--text);
}

.tool-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

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

.tool-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  letter-spacing: -0.2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== Forms ===== */
textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: all var(--t-fast);
}

textarea:focus, input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

textarea {
  min-height: 200px;
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  line-height: 1.6;
}

input[type="range"] {
  accent-color: var(--primary);
}

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

select {
  cursor: pointer;
}

/* ===== File Drop Zone ===== */
.drop-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 56px 24px;
  text-align: center;
  transition: all var(--t-normal);
  cursor: pointer;
  background: var(--bg-soft);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
}

.drop-zone .dz-icon {
  font-size: 52px;
  margin-bottom: 16px;
  display: inline-block;
  transition: transform var(--t-normal);
}

.drop-zone:hover .dz-icon {
  transform: translateY(-4px);
}

.drop-zone .dz-text {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-zone .dz-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== File List ===== */
.file-list { margin-top: 24px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--t-fast);
  background: #fff;
}

.file-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.file-item .file-icon { font-size: 24px; }
.file-item .file-info { flex: 1; }
.file-item .file-name { font-size: 14px; font-weight: 600; }
.file-item .file-meta { font-size: 12px; color: var(--text-muted); }

/* ===== Result Box ===== */
.result-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: none;
}

.result-box.show { display: block; }

.result-box .result-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

/* ===== Stats Row ===== */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: all var(--t-fast);
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transition: transform var(--t-slow);
  pointer-events: none;
  box-shadow: var(--shadow-xl);
}

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

/* ===== Fade In Animation ===== */
.fade-in {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .hero { padding: 64px 0 40px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-stats { gap: 32px; }
  .hero-stat .num { font-size: 22px; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .tool-content { padding: 24px; border-radius: var(--radius-lg); }
  .tool-header h1 { font-size: 26px; }
  .section-title { font-size: 18px; }
}

@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; }
  .navbar-brand .tld { display: none; }
  .hero h1 { font-size: 28px; }
  .tool-card { padding: 20px; }
}
