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

:root {
  --bg: #0c0e14;
  --bg-card: #13161f;
  --bg-card-hover: #191d29;
  --bg-highlight: linear-gradient(135deg, #151a2e 0%, #1a1f33 100%);
  --border: #1e2333;
  --border-light: #2a3050;
  --text: #e2e6f0;
  --text-dim: #8891a8;
  --text-muted: #5a6380;
  --accent: #4f8fff;
  --accent-hover: #6ca0ff;
  --accent-glow: rgba(79, 143, 255, 0.15);
  --accent-2: #7c5cff;
  --accent-3: #00d4aa;
  --warning: #ffb340;
  --warning-bg: rgba(255, 179, 64, 0.08);
  --warning-border: rgba(255, 179, 64, 0.2);
  --error: #ff5c5c;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.2s ease;
  --max-w: 860px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 140px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  background: rgba(79, 143, 255, 0.1);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 20, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 16px;
  display: block;
  line-height: 1.2;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  line-height: 1.2;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(79, 143, 255, 0.1);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.header-btn:hover {
  background: rgba(79, 143, 255, 0.18);
  color: var(--accent-hover);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 60px 20px 40px;
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 143, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(124, 92, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(79, 143, 255, 0.12);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== Tab Navigation ===== */
.tab-nav {
  position: sticky;
  top: 64px;
  z-index: 90;
  background: rgba(12, 14, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.tab-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav-inner::-webkit-scrollbar { display: none; }

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.tab-btn.active svg { opacity: 1; }

/* ===== Main Content ===== */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.tab-panel {
  display: none;
  animation: fadeInPanel 0.3s ease;
}
.tab-panel.active { display: block; }

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

/* ===== Content Cards ===== */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}
.content-card:hover { border-color: var(--border-light); }

.content-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}

.content-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: #fff;
}

.content-card p {
  color: var(--text-dim);
  margin-bottom: 12px;
}

.highlight-card {
  background: var(--bg-highlight);
  border-color: var(--border-light);
}

/* ===== Concept Grid ===== */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.concept-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all var(--transition);
}
.concept-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(79, 143, 255, 0.1);
}

.concept-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.concept-item h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.concept-item p {
  font-size: 13px;
  margin: 0 0 8px;
}

.concept-tag {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(79, 143, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

/* ===== Scenario Block ===== */
.scenario-block {
  border-left: 3px solid var(--border-light);
  padding-left: 20px;
  margin: 20px 0;
}
.scenario-block:last-child { margin-bottom: 0; }

.scenario-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.scenario-number {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scenario-header h3 {
  margin: 0;
  font-size: 16px;
}

/* ===== Step List ===== */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.step {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-dim);
}

.step-label {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(79, 143, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Tip Box ===== */
.tip-box {
  padding: 14px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 143, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dim);
  margin: 12px 0;
  line-height: 1.6;
}

.tip-box.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.tip-box strong {
  color: var(--text);
}

/* ===== Guide Steps ===== */
.guide-steps {
  counter-reset: guide;
  list-style: none;
  padding: 0;
}

.guide-steps > li {
  counter-increment: guide;
  position: relative;
  padding-left: 36px;
  margin-bottom: 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.guide-steps > li::before {
  content: counter(guide);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(79, 143, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-steps > li strong { color: var(--text); }

.guide-steps > li ul {
  margin-top: 8px;
  padding-left: 20px;
}
.guide-steps > li ul li {
  margin-bottom: 4px;
}

/* ===== Image Frame ===== */
.img-frame {
  margin: 12px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0c12;
}

.img-frame img {
  cursor: zoom-in;
  transition: opacity var(--transition);
}
.img-frame img:hover { opacity: 0.88; }

.img-caption {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-align: center;
}

.img-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

/* ===== Download Link ===== */
.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(79, 143, 255, 0.1);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  transition: all var(--transition);
}
.download-link:hover {
  background: rgba(79, 143, 255, 0.18);
}

/* ===== Params Table ===== */
.params-table {
  margin: 12px 0;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.params-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.params-table th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.params-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.params-table tr:last-child td { border-bottom: none; }

.params-table.compact table { font-size: 13px; }

/* ===== Tips Grid ===== */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.tip-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tip-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-card p {
  font-size: 14px;
  margin: 0;
}

/* ===== Schedule Examples ===== */
.example-schedules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.schedule-ex {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dim);
}

.sched-time {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  min-width: 50px;
}

/* ===== Save Steps ===== */
.save-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.save-step h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.save-step p {
  font-size: 14px;
}

/* ===== Flow Steps (UI tab) ===== */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
  position: relative;
}

.flow-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  position: relative;
}

.flow-step::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 48px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}

.flow-step:last-child::before { display: none; }

.flow-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.flow-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.flow-content p {
  font-size: 14px;
}

/* ===== Telegram Box ===== */
.telegram-box {
  margin-top: 20px;
  text-align: center;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(42, 171, 238, 0.3);
}
.telegram-link:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(42, 171, 238, 0.4);
}

/* ===== Code Examples ===== */
.code-example {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-example h4 {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.code-example pre {
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0;
}

.code-example code {
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.6;
}

.code-block {
  margin: 10px 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.code-block code {
  background: none;
  padding: 0;
  font-size: 13px;
  word-break: break-all;
}

/* ===== Type Tags ===== */
.type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.type-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

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

.footer-sub {
  margin-top: 6px;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Guide Section spacing ===== */
.guide-section {
  margin-top: 24px;
}
.guide-section:first-child { margin-top: 0; }

.guide-section h3 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-inner { padding: 10px 16px; }
  .logo-text { font-size: 14px; }
  .header-btn span { display: none; }

  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: 22px; }
  .hero-desc { font-size: 14px; }

  .tab-btn { padding: 12px 12px; font-size: 13px; }
  .tab-btn svg { width: 16px; height: 16px; }

  .main-content { padding: 16px 12px 40px; }
  .content-card { padding: 20px 16px; }

  .concept-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .concept-item { padding: 12px; }

  .img-grid-2 { grid-template-columns: 1fr; }

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

  .flow-step { gap: 12px; }
  .flow-num { width: 32px; height: 32px; font-size: 14px; }
  .flow-step::before { left: 15px; top: 44px; }
}
