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

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

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --accent: #06b6d4;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== 导航栏 ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar-brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px;
}
.navbar-brand span { font-size: 18px; font-weight: 700; color: var(--text); }
.navbar-links { display: flex; align-items: center; gap: 8px; }
.navbar-links a {
  padding: 8px 16px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.navbar-links a:hover { color: var(--text); background: var(--bg-muted); }
.navbar-links a.active { color: var(--primary); background: rgba(59,130,246,0.08); }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

/* ===== Hero区域 ===== */
.hero {
  text-align: center; padding: 80px 24px 40px;
  max-width: 680px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 999px;
  background: var(--bg-muted); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; margin-bottom: 24px;
}
.hero h1 { font-size: 40px; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 17px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; }
.hero-actions { display: flex; align-items: center; gap: 12px; justify-content: center; }

/* ===== 搜索栏 ===== */
.search-bar {
  max-width: 480px; margin: 0 auto 16px; position: relative;
}
.search-bar input {
  width: 100%; padding: 12px 16px 12px 44px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 15px; outline: none; background: var(--bg);
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ===== 分类标签 ===== */
.category-tabs {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap;
  padding: 0 24px;
}
.category-tab {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-secondary);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.category-tab:hover { border-color: var(--primary); color: var(--primary); }
.category-tab.active {
  background: var(--text); color: #fff; border-color: var(--text);
}

/* ===== 工具卡片 ===== */
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto; padding: 0 24px 60px;
}
.tool-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: all 0.2s; cursor: pointer; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.tool-card:hover {
  border-color: var(--primary); box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.tool-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--bg-muted); display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 20px;
}
.tool-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.tool-card .category-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: rgba(59,130,246,0.08); color: var(--primary);
  font-size: 12px; font-weight: 500; margin-bottom: 10px;
}
.tool-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; flex: 1; }
.tool-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light);
}
.tool-card-footer a {
  color: var(--primary); font-size: 14px; font-weight: 500;
  text-decoration: none; display: flex; align-items: center; gap: 4px;
}
.tool-card-footer a:hover { gap: 8px; }

/* ===== 工具计数 ===== */
.tools-count {
  text-align: center; padding: 20px; color: var(--text-muted); font-size: 14px;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center; padding: 32px 24px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted); font-size: 13px;
}

/* ===== 激活页面 ===== */
.activate-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); padding: 24px;
}
.activate-card {
  background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 48px; max-width: 440px; width: 100%;
  text-align: center;
}
.activate-card .icon-wrap {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 28px; color: #fff;
}
.activate-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.activate-card .subtitle { color: var(--text-secondary); font-size: 15px; margin-bottom: 32px; }
.activate-card input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 16px; text-align: center;
  letter-spacing: 2px; font-weight: 600; outline: none;
  transition: border-color 0.2s;
}
.activate-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.activate-card .btn { width: 100%; justify-content: center; margin-top: 16px; padding: 14px; font-size: 16px; }
.activate-card .error-msg {
  color: #ef4444; font-size: 14px; margin-top: 12px; display: none;
}
.activate-card .success-msg {
  color: #10b981; font-size: 14px; margin-top: 12px; display: none;
}
.activate-card .back-link {
  display: block; margin-top: 24px; color: var(--text-muted);
  font-size: 14px; text-decoration: none;
}
.activate-card .back-link:hover { color: var(--primary); }

/* ===== 管理后台 ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--text); color: #fff;
  padding: 24px 0; flex-shrink: 0;
}
.admin-sidebar .brand {
  padding: 0 20px 24px; font-size: 18px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.admin-sidebar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
}
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: rgba(255,255,255,0.6);
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.admin-sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.admin-sidebar nav a.active { color: #fff; background: rgba(255,255,255,0.1); border-right: 3px solid var(--primary); }
.admin-main { flex: 1; background: var(--bg-soft); padding: 32px; overflow-y: auto; }
.admin-header { margin-bottom: 32px; }
.admin-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.admin-header p { color: var(--text-secondary); font-size: 15px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg); border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border);
}
.stat-card .label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .value.blue { color: var(--primary); }
.stat-card .value.green { color: #10b981; }
.stat-card .value.orange { color: #f59e0b; }
.stat-card .value.purple { color: #8b5cf6; }

/* 表格 */
.card { background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.card-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }
table { width: 100%; border-collapse: collapse; }
table th {
  text-align: left; padding: 12px 16px; font-size: 13px;
  font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border-light); }
table tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-gray { background: var(--bg-muted); color: var(--text-secondary); }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* 模态框 */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 32px; max-width: 500px; width: 90%;
}
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* 管理员登录 */
.admin-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--text);
}
.admin-login-card {
  background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 48px; max-width: 400px; width: 100%;
}
.admin-login-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.admin-login-card .subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; text-align: center; }
.admin-login-card .form-group { margin-bottom: 20px; }
.admin-login-card .btn { width: 100%; justify-content: center; padding: 14px; }

/* 工具页面通用 */
.tool-page { min-height: 100vh; background: var(--bg-soft); }
.tool-page .tool-header {
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 16px 24px; display: flex; align-items: center; justify-content: space-between;
}
.tool-page .tool-header h1 { font-size: 18px; font-weight: 600; }
.tool-page .tool-content { max-width: 900px; margin: 40px auto; padding: 0 24px; }

/* 文件上传区域 */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 60px 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary); background: rgba(59,130,246,0.02);
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 16px; color: var(--text-muted); }
.upload-zone h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.upload-zone p { color: var(--text-secondary); font-size: 14px; }
.upload-zone input[type="file"] { display: none; }

/* 处理结果 */
.result-card {
  background: var(--bg); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 32px; margin-top: 24px;
}
.result-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.result-card .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-card .info-item { padding: 12px; background: var(--bg-soft); border-radius: var(--radius-sm); }
.result-card .info-item .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.result-card .info-item .value { font-size: 15px; font-weight: 600; }

/* 进度条 */
.progress-bar { height: 6px; background: var(--bg-muted); border-radius: 3px; overflow: hidden; margin: 20px 0; }
.progress-bar .fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px; transition: width 0.3s; width: 0%;
}

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--text); color: #fff; font-size: 14px;
  margin-bottom: 8px; animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 404页面 */
.page-404 {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.page-404 h1 { font-size: 120px; font-weight: 700; color: var(--bg-muted); line-height: 1; }
.page-404 h2 { font-size: 24px; font-weight: 600; margin: 16px 0 8px; }
.page-404 p { color: var(--text-secondary); margin-bottom: 32px; }

/* 会员状态栏 */
.member-bar {
  display: flex; align-items: center; gap: 8px;
}
.member-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
}

/* 响应式 */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .tools-grid { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .navbar-links { display: none; }
  .result-card .info-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
