/* PowerTab Official Website - Theme Aware Styles */

/* ===== Dark Theme (Default) ===== */
:root, html.dark, html[data-theme="dark"] {
  --bg: #0f0f23;
  --bg-elevated: #151530;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: rgba(255,255,255,0.08);
  --header-bg: rgba(15,15,35,0.8);
  --hero-grad-1: rgba(99,102,241,0.15);
  --hero-grad-2: rgba(139,92,246,0.1);
  --cta-grad: rgba(99,102,241,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(99,102,241,0.3);
  --shadow-hover: 0 6px 28px rgba(99,102,241,0.4);
  --logo-color: #f1f5f9;
}

/* ===== Light Theme ===== */
html.light, html[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255,255,255,0.7);
  --bg-card-hover: rgba(255,255,255,0.9);
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --header-bg: rgba(248,250,252,0.85);
  --hero-grad-1: rgba(99,102,241,0.08);
  --hero-grad-2: rgba(139,92,246,0.05);
  --cta-grad: rgba(99,102,241,0.06);
  --shadow: 0 4px 20px rgba(99,102,241,0.15);
  --shadow-hover: 0 6px 28px rgba(99,102,241,0.2);
  --logo-color: #0f172a;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }

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

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--logo-color);
  transition: color 0.3s;
}

.logo-link img { height: 32px; }

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav { display: flex; align-items: center; gap: 32px; }

.nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* Theme Toggle */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

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

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

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 160px 0 100px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--hero-grad-1), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, var(--hero-grad-2), transparent);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: background 0.3s, border-color 0.3s;
}

.hero-badge span {
  display: inline-block;
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 36px;
}

.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s;
}

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

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

.hero-img {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, background 0.3s;
}

.hero-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--hero-grad-1), var(--hero-grad-2));
  pointer-events: none;
}

.hero-img-inner {
  position: relative;
  width: 90%; height: 85%;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #1e1b4b 0%, #0f0f23 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-bar {
  height: 36px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

.tab-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
}

.tab-search {
  width: 70%;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  border: 1px solid var(--border);
}

.tab-icons { display: flex; gap: 16px; }
.tab-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

/* ===== Sections ===== */
.section { padding: 100px 0; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}

.section-header h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 17px;
  color: var(--text-muted);
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.2);
}

.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

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

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Widgets ===== */
.widgets-showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.widget-item {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.3s;
}

.widget-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99,102,241,0.2);
}

.widget-item .emoji { font-size: 36px; margin-bottom: 12px; display: block; }

.widget-item h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

.widget-item p { font-size: 13px; color: var(--text-muted); }

/* ===== CTA ===== */
.cta {
  position: relative;
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, var(--cta-grad), transparent);
  pointer-events: none;
}

.cta h2 { font-size: 36px; font-weight: 700; margin-bottom: 16px; }

.cta p { font-size: 17px; color: var(--text-muted); margin-bottom: 32px; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  transition: border-color 0.3s;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  transition: border-color 0.3s;
}

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

.footer-bottom a {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom a:hover { color: var(--text); }

/* ===== Mobile Menu ===== */
.mobile-menu-btn {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.mobile-menu-btn.active {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* ===== WeChat QR Code ===== */
.qrcode-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.qrcode-placeholder {
  width: 100px; height: 100px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
}
.qrcode-placeholder svg {
  width: 80%; height: 80%;
  opacity: 0.7;
}
.qrcode-box p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Privacy Page ===== */
.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

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

.privacy-content .updated {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.privacy-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
}

.privacy-content p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}

.privacy-content ul {
  margin: 0 0 16px 24px;
  color: var(--text-muted);
}

.privacy-content li {
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.8;
}

/* ===== Icon Generator Page ===== */
.gen-body {
  padding: 40px 24px;
  max-width: 800px;
  margin: 0 auto;
}

.gen-body h1 { font-size: 28px; margin-bottom: 8px; }
.gen-body > p { color: var(--text-muted); margin-bottom: 32px; }

.gen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }

.gen-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: background 0.3s, border-color 0.3s;
}

.gen-card h3 { font-size: 16px; margin-bottom: 16px; }

.gen-card canvas {
  display: block;
  margin: 0 auto 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #1e1b4b;
}

.gen-info {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  transition: background 0.3s, border-color 0.3s;
}

.gen-info strong { color: var(--text); }

.gen-info code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin: 0 auto 36px; }
  .hero-btns { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-img { max-width: 600px; margin: 0 auto; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .widgets-showcase { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .qrcode-box { align-items: center; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { height: 56px; }

  .mobile-menu-btn { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px;
    gap: 0;
    display: none;
  }
  .nav.mobile-open { display: flex; }
  .nav a {
    display: block !important;
    padding: 12px 0;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }
  .nav a:last-of-type { border-bottom: none; }
  .nav .theme-toggle {
    align-self: flex-start;
    margin: 8px 0;
  }
  .nav .btn {
    width: 100%;
    margin-top: 8px;
    text-align: center;
  }

  .hero { padding: 100px 0 60px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; max-width: 100%; }
  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn { width: 100%; }
  .hero-stats { gap: 24px; justify-content: space-around; margin-top: 32px; padding-top: 24px; }
  .hero-stats .num { font-size: 24px; }

  .section { padding: 60px 0; }
  .section-header { margin-bottom: 40px; }
  .section-header h2 { font-size: 28px; }
  .section-header p { font-size: 16px; }

  .feature-card { padding: 24px; }

  .widgets-showcase { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .widget-item { padding: 16px 12px; }
  .widget-item .emoji { font-size: 28px; margin-bottom: 8px; }
  .widget-item h4 { font-size: 14px; }
  .widget-item p { font-size: 12px; }

  .cta { padding: 60px 0; }
  .cta h2 { font-size: 28px; }
  .cta p { font-size: 16px; }
  .cta .btn { width: 100%; }

  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 32px; margin-bottom: 32px; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
  .footer-brand p { max-width: 100%; }
  .footer-col { text-align: center; }
  .footer-col h4 { margin-bottom: 12px; }
  .qrcode-box { align-items: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 8px; padding-top: 20px; }
}
