/* ==========================================================================
   ClashOS BaseTrace Guide Stylesheet (basetrace-guide.css?v=2)
   Matches canonical ClashOS guide design system.
   Responsive, high-contrast, clean typography, framed annotated screenshots.
   ========================================================================== */

:root {
  --bg-page: #0a0a0a;
  --bg-card: #121212;
  --bg-frame: #161616;
  --bg-subtle: #1a1a1a;
  --gold: #F4C542;
  --gold-hover: #e0b02e;
  --gold-glow: rgba(244, 197, 66, 0.2);
  --gold-border: rgba(244, 197, 66, 0.3);
  --green: #22C55E;
  --green-glow: rgba(34, 197, 94, 0.15);
  --red: #EF4444;
  --blue: #3B82F6;
  --text-main: #EAEAEA;
  --text-muted: #A1A1AA;
  --text-dim: #71717A;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-frame: rgba(255, 255, 255, 0.14);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body.guide-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Breadcrumbs ── */
.guide-breadcrumbs {
  background: transparent;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.guide-breadcrumbs__inner {
  max-width: 880px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-breadcrumbs__inner a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.guide-breadcrumbs__inner a:hover {
  color: var(--gold);
}

.guide-breadcrumbs__inner span.current {
  color: var(--gold);
  font-weight: 600;
}

/* ── Container ── */
.guide-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── Hero Block ── */
.guide-hero {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 28px;
}

.guide-kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(244, 197, 66, 0.1);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  margin-bottom: 16px;
}

.guide-hero-h1 {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 16px;
}

@media (max-width: 640px) {
  .guide-hero-h1 {
    font-size: 1.75rem;
  }
}

.gold-accent {
  color: var(--gold);
}

.guide-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.guide-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guide-term {
  font-weight: 700;
  color: #fff;
}

/* ── Table of Contents ── */
.guide-toc {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 32px 0;
}

.guide-toc-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 16px;
}

.guide-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px;
}

.guide-toc-link {
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-toc-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ── Typography & Content ── */
h2.bt-section-title,
h2.guide-section-h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2.bt-section-title::before,
h2.guide-section-h2::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

h3.guide-h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 28px 0 12px;
}

p {
  margin: 0 0 18px;
  color: var(--text-main);
  line-height: 1.7;
}

p.lead {
  font-size: 1.1rem;
  color: #fff;
}

strong {
  color: #fff;
  font-weight: 700;
}

a.guide-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.guide-link:hover {
  color: var(--gold-hover);
}

ul.guide-list, ol.guide-list {
  margin: 0 0 24px;
  padding-left: 24px;
  color: var(--text-main);
}

ul.guide-list li, ol.guide-list li {
  margin-bottom: 10px;
  line-height: 1.65;
}

/* ── Callout Boxes ── */
.pro-tip-box {
  background: var(--bg-card);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
  box-shadow: var(--card-shadow);
}

.pro-tip-box h4 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pro-tip-box p:last-child {
  margin-bottom: 0;
}

.caution-box {
  background: rgba(239, 68, 68, 0.06);
  border-left: 4px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
  box-shadow: var(--card-shadow);
}

.caution-box h4 {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.caution-box p:last-child {
  margin-bottom: 0;
}

.tldr-box {
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
  box-shadow: var(--card-shadow);
}

.tldr-box h4 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tldr-box p:last-child {
  margin-bottom: 0;
}

/* ── Framed Annotated Screenshots ── */
.guide-img-frame {
  position: relative;
  background: var(--bg-frame);
  border: 1px solid var(--border-frame);
  border-radius: 12px;
  padding: 14px;
  margin: 28px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.guide-img-frame .guide-img-wrap {
  position: relative;
  width: 100%;
  display: block;
}

.guide-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #000;
}

.guide-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px #0a0a0a, 0 4px 10px rgba(0, 0, 0, 0.7);
  z-index: 10;
  user-select: none;
  cursor: default;
}

.guide-pin-legend {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.guide-pin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
}

.guide-pin-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-weight: 900;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Step Cards ── */
.guide-step {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin: 22px 0;
  box-shadow: var(--card-shadow);
}

.guide-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.guide-step-num {
  background: rgba(244, 197, 66, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.guide-step-body {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.7;
}

.guide-see-box {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--green);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin-top: 14px;
  font-size: 0.95rem;
  color: #f0fdf4;
}

.guide-see-box strong {
  color: #86efac;
}

.guide-trouble-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin-top: 12px;
  font-size: 0.95rem;
  color: #fef3c7;
}

.guide-trouble-box strong {
  color: #fde68a;
}

/* ── Task Grid & Journey Cards (Hub) ── */
.guide-journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.guide-journey-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.guide-journey-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
}

.guide-journey-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  align-self: flex-start;
}

.badge-visitor { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-saver { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-creator { background: rgba(244, 197, 66, 0.15); color: var(--gold); border: 1px solid var(--gold-border); }

.guide-journey-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}

.guide-journey-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

.guide-journey-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guide-task-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 24px 0 40px;
}

.guide-task-link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-main);
  transition: border-color 0.15s, background 0.15s;
}

.guide-task-link-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-subtle);
}

.guide-task-link-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.guide-task-link-arrow {
  color: var(--gold);
  font-weight: 800;
  font-size: 1.1rem;
}

/* ── Next / Back Task Footer ── */
.guide-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.guide-nav-btn {
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-frame);
  background: var(--bg-card);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.guide-nav-btn:hover {
  border-color: var(--gold-border);
  background: var(--bg-frame);
  color: var(--gold);
}

.guide-nav-btn.primary {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.guide-nav-btn.primary:hover {
  background: var(--gold-hover);
  color: #000;
}

/* ── Responsive Tables ── */
.guide-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

table.guide-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

table.guide-table th {
  background: var(--bg-subtle);
  color: var(--gold);
  font-weight: 800;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

table.guide-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  line-height: 1.6;
}

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

table.guide-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── SVG Flow Diagram ── */
.guide-flow-wrap {
  background: var(--bg-frame);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  display: flex;
  justify-content: center;
}

.guide-flow-wrap svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Site Footer (touch targets) ── */
.cg-site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  box-sizing: border-box;
  color: var(--text-muted);
}

.cg-site-footer__nav a:hover {
  color: var(--gold);
}

