/* === 抖音视频提取器 - 新中式风格 === */
:root {
  --red: #C43A31;
  --red-dark: #9B2C25;
  --red-light: #F0D6D4;
  --ink: #1a1a1a;
  --ink-light: #3a3a3a;
  --paper: #f5f0e8;
  --paper-white: #fdfaf3;
  --gold: #b8860b;
  --gold-light: #f5e6c8;
  --gray: #888;
  --border: #e0d8cc;
  --green: #2d7d46;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --transition: 0.2s ease;
}

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

@font-face {
  font-family: 'ZCOOL';
  src: local('ZCOOL KuaiLe'), local('Ma Shan Zheng'), local('Noto Serif SC');
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--paper-white);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }

/* === Nav === */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  font-size: 20px; font-weight: 700; color: var(--red);
  letter-spacing: 2px;
}
.nav-brand span { color: var(--ink); font-weight: 400; font-size: 14px; margin-left: 8px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  color: var(--ink-light); font-size: 14px; transition: var(--transition);
}
.nav-links a:hover { color: var(--red); }
.nav-user { font-size: 13px; color: var(--gray); }

/* === Floating Nav (右侧浮动导航) === */
.float-nav {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 6px;
}
.float-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 10px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none; font-size: 13px;
  color: var(--ink-light); white-space: nowrap;
  transform: translateX(0);
}
.float-nav-item:hover {
  transform: translateX(-6px);
  background: var(--red); border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 20px rgba(196,58,49,0.28);
  padding: 8px 16px;
}
.float-nav-item.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.float-nav-icon { font-size: 15px; flex-shrink: 0; line-height: 1; }
.float-nav-label { font-weight: 500; }

/* === Buttons === */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  transition: var(--transition); text-align: center;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-outline { border: 2px solid var(--red); color: var(--red); background: transparent; }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

/* === Hero (Homepage) === */
.hero {
  padding: 100px 24px 80px; text-align: center;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-white) 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(196,58,49,0.03) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(184,134,11,0.03) 0%, transparent 50%);
  pointer-events: none;
}
.hero-badge {
  display: inline-block; padding: 6px 18px; border-radius: 20px;
  background: var(--red-light); color: var(--red-dark);
  font-size: 13px; font-weight: 600; margin-bottom: 24px;
}
.hero h1 {
  font-size: 52px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--red) 0%, var(--ink) 60%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 16px;
}
.hero p {
  font-size: 18px; color: var(--gray); max-width: 600px; margin: 0 auto 40px;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* === Features === */
.features {
  padding: 80px 24px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: #fff; border-radius: 12px; padding: 40px 32px;
  box-shadow: var(--shadow); text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.10);
}
.feature-icon {
  font-size: 40px; margin-bottom: 20px; display: block;
}
.feature-card h3 { font-size: 20px; margin-bottom: 12px; color: var(--ink); }
.feature-card p { font-size: 14px; color: var(--gray); line-height: 1.8; }

/* === Footer === */
.footer {
  text-align: center; padding: 40px 24px;
  border-top: 1px solid var(--border); color: var(--gray); font-size: 13px;
  background: transparent;
}
.footer-cr { margin-bottom: 4px; color: var(--gray); }
.footer-icp { font-size: 12px; }
.footer-icp a { color: #999; text-decoration: none; }
.footer-icp a:hover { color: var(--ink-light); }

/* === Auth Pages === */
.auth-page {
  display: flex; min-height: calc(100vh - 64px); align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-white) 100%);
}
.auth-card {
  background: #fff; border-radius: 16px; padding: 48px 40px;
  width: 420px; max-width: 90vw;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.auth-card h2 {
  font-size: 28px; text-align: center; margin-bottom: 8px;
  color: var(--ink); letter-spacing: 2px;
}
.auth-card .subtitle { text-align: center; color: var(--gray); font-size: 14px; margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink-light);
}
.form-group input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px; transition: var(--transition);
  background: var(--paper-white);
}
.form-group input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,58,49,0.1); }
.auth-card .btn { width: 100%; padding: 12px; font-size: 16px; margin-top: 8px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--gray); }

/* === Alert === */
.alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px;
}
.alert-error { background: #fce8e6; color: var(--red-dark); border: 1px solid #f5c6c0; }
.alert-success {
  background: #e6f4ea; color: var(--green); border: 1px solid #c4e6ce;
}
.key-display-box {
  background: var(--paper); border: 2px dashed var(--gold);
  padding: 16px; border-radius: var(--radius); margin: 16px 0;
  font-family: "SF Mono", "Fira Code", monospace; font-size: 16px;
  text-align: center; word-break: break-all; color: var(--ink);
}

/* === Dashboard === */
.dashboard { padding: 40px 24px; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 28px; color: var(--ink); }
.page-header p { color: var(--gray); font-size: 14px; margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 28px 24px;
  box-shadow: var(--shadow); border-left: 4px solid var(--red);
}
.stat-card.key { border-left-color: var(--gold); }
.stat-card.follows { border-left-color: var(--ink); }
.stat-label { font-size: 13px; color: var(--gray); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--ink); }
.stat-value.small { font-size: 14px; font-weight: 400; word-break: break-all; }
.stat-meta { font-size: 12px; color: var(--gray); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Usage bar */
.usage-bar {
  height: 8px; background: #eee; border-radius: 4px; margin-top: 12px; overflow: hidden;
}
.usage-bar .fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.usage-bar .fill.low { background: var(--green); }
.usage-bar .fill.mid { background: var(--gold); }
.usage-bar .fill.high { background: var(--red); }
.usage-text { font-size: 12px; color: var(--gray); margin-top: 6px; }

/* === Page Sections === */
.section {
  background: #fff; border-radius: 12px; padding: 32px;
  box-shadow: var(--shadow); margin-bottom: 24px;
  border: 1px solid var(--border);
}
.section h2 { font-size: 20px; margin-bottom: 20px; color: var(--ink); }

/* === Table === */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--paper); font-weight: 600; color: var(--ink-light); }
tr:hover td { background: #fdfaf5; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.badge.douyin { background: #111; color: #fff; }
.badge.tiktok { background: #fe2c55; color: #fff; }

/* === Tool Cards === */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.tool-card {
  background: #fff; border-radius: 12px; padding: 32px 24px;
  box-shadow: var(--shadow); text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.tool-card .icon { font-size: 36px; margin-bottom: 16px; }
.tool-card h3 { font-size: 18px; margin-bottom: 8px; }
.tool-card p { font-size: 13px; color: var(--gray); margin-bottom: 20px; }

/* === Forms === */
.form-inline { display: flex; gap: 12px; }
.form-inline input { flex: 1; }
textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; resize: vertical;
  min-height: 160px; background: var(--paper-white);
  font-family: "SF Mono", "Fira Code", monospace;
}
textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,58,49,0.1); }

/* === Result Cards === */
.result-card {
  background: var(--paper); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--border);
}
.result-card .title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.result-card .meta { font-size: 13px; color: var(--gray); }
.result-card video, .result-card img { max-width: 100%; border-radius: 6px; margin-top: 12px; }

/* === Loading === */
.loading { text-align: center; padding: 32px; color: var(--gray); }
.loading::after {
  content: ''; display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--red);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 { font-size: 36px; }
  .features { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .nav { padding: 0 16px; }
  .nav-links { gap: 12px; }
}

/* === Empty State === */
.empty { text-align: center; padding: 48px; color: var(--gray); }
.empty .icon { font-size: 48px; display: block; margin-bottom: 16px; }

/* === Modal === */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 480px; max-width: 90vw; box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.modal h3 { font-size: 22px; margin-bottom: 24px; }
.modal .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px; background: var(--paper-white);
}
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-tab {
  padding: 6px 16px; border-radius: 20px; font-size: 13px;
  border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
  background: #fff; color: var(--ink-light);
}
.filter-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-tab:hover:not(.active) { border-color: var(--ink); }

/* === AI Settings Button === */
.ai-settings-btn {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--ink-light); font-size: 12px;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.ai-settings-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.ai-settings-btn.has-config { border-color: var(--green); }
.ai-settings-btn.has-config::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); margin-left: 6px; vertical-align: middle;
}

/* === Modal preset buttons === */
.modal .preset-btn { font-size: 12px; padding: 4px 10px; }
.modal .preset-btn:hover { border-color: var(--red); color: var(--red); }

/* === Profile List (compact cards) === */
.profile-summary {
  display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 12px 16px;
  background: var(--paper); border-radius: 10px; font-size: 14px;
}
.profile-author { color: var(--ink); font-weight: 600; }
.profile-count { color: var(--gray); font-size: 13px; }
.count-select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; background: #fff; color: var(--ink); cursor: pointer;
}

.profile-list { margin-top: 16px; }
.p-item {
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px;
  overflow: hidden; background: #fff; transition: all 0.2s;
}
.p-item:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.p-item-main {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; user-select: none;
}
.p-item-main:hover { background: var(--paper); }
.p-item-cover {
  width: 60px; height: 80px; border-radius: 6px; overflow: hidden;
  background: var(--paper); flex-shrink: 0;
}
.p-item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-item-body { flex: 1; min-width: 0; }
.p-item-title {
  font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 6px;
}
.p-item-stats { display: flex; gap: 12px; font-size: 12px; color: var(--gray); flex-wrap: wrap; }
.p-stat { white-space: nowrap; }
.p-item-expand {
  flex-shrink: 0; font-size: 12px; color: var(--red); cursor: pointer;
  padding: 4px 10px; border-radius: 6px; transition: var(--transition);
}
.p-item-expand:hover { background: var(--red-light); }
.p-item-expand i { font-size: 11px; }

.p-item-detail { border-top: 1px solid var(--border); background: var(--paper-white); }
.p-item-detail-inner { padding: 16px; }
.p-detail-meta { font-size: 13px; color: var(--gray); margin-bottom: 16px; }

/* URL rows */
.url-row {
  background: var(--paper); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 6px;
}
.url-row-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.url-row-label { font-size: 12px; font-weight: 600; color: var(--ink); }
.url-row-input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; background: #fff; color: var(--ink-light);
}

/* AI transcribe in profile items */
.p-ai-row { margin-top: 12px; }
.p-ai-loading {
  display: none; font-size: 12px; color: var(--gray); margin-left: 8px;
}
.p-ai-result {
  display: none; margin-top: 10px; background: #fff; padding: 12px;
  border-radius: 8px; font-size: 14px; line-height: 1.7; white-space: pre-wrap;
}
.p-ai-error {
  display: none; margin-top: 10px; color: var(--red); font-size: 13px;
}
