:root {
    --bg-color: #09090b;
    --bg-gradient: none;
    --card-bg: #111115;
    --card-bg-solid: #111115;
    --card-hover: #16161c;
    --card-border: rgba(255, 255, 255, 0.08);
    --text-color: #fafafa;
    --text-muted: #a1a1aa;
    --header-color: #f8fafc;
    --primary-color: #ec0f5d;
    --primary-rgb: 236, 15, 93;
    --primary-glow: transparent;
    --code-bg: rgba(0, 0, 0, 0.3);
    --warning-bg: rgba(255, 111, 97, 0.1);
    --warning-text: #ff8a80;
    --success-color: #22c55e;
    --success-text: #22c55e;
    --nav-bg: rgba(9, 9, 11, 0.75);
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --bg-gradient: none;
    --card-bg: #ffffff;
    --card-bg-solid: #ffffff;
    --card-hover: #f8fafc;
    --card-border: rgba(0, 0, 0, 0.08);
    --text-color: #0f172a;
    --text-muted: #64748b;
    --header-color: #000000;
    --primary-color: #ec0f5d;
    --primary-rgb: 236, 15, 93;
    --primary-glow: transparent;
    --code-bg: #f1f5f9;
    --warning-bg: rgba(220, 38, 38, 0.1);
    --warning-text: #ef4444;
    --success-color: #16a34a;
    --success-text: #16a34a;
    --nav-bg: rgba(241, 245, 249, 0.8);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.25s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
}

header.hero {
    text-align: center;
    margin-bottom: 3.5rem;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--header-color);
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

h1 span {
    color: var(--primary-color);
}

.intro-text {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
}

section {
    margin-bottom: 4rem;
    scroll-margin-top: 5.5rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    color: var(--header-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: "";
    display: block;
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 3px;
    flex-shrink: 0;
}

h3 {
    color: var(--header-color);
    font-weight: 700;
    margin: 1.25rem 0 0.75rem;
}

p, li {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

ul, ol {
    padding-left: 1.35rem;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    color: var(--text-color);
}

.content-card,
.img-frame {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    margin: 1.25rem 0;
    transition: border-color 0.15s ease;
    position: relative;
}

.content-card:hover,
.img-frame:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
}

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

.code-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

[data-theme="light"] .code-header {
    background: rgba(0, 0, 0, 0.03);
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-weight: 600;
}

.copy-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

pre {
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 0;
    color: var(--text-color);
    background: var(--code-bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.55;
}

pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.warning-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--warning-text);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 1.5rem 0;
    text-align: left;
}

.warning-box .warning-icon,
.warning-box svg {
    flex-shrink: 0;
    color: var(--warning-text);
    margin-top: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.guide-link {
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}

.guide-link:hover {
    border-color: rgba(var(--primary-rgb), 0.5);
}

.guide-link h3 {
    font-size: 1.15rem;
    color: var(--header-color);
    margin: 0 0 0.4rem 0;
}

.guide-link span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    html, body { overflow-x: hidden; width: 100%; }
    .site-header { height: auto; min-height: 3.2rem; padding: 0.3rem 0; }
    .navbar { padding: 0.2rem 0.5rem; flex-direction: row; justify-content: flex-start; }
    .nav-links { width: 100%; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; gap: 0.75rem; padding: 4px 6px; -webkit-overflow-scrolling: touch; }
    .nav-link { font-size: 0.85rem; padding: 3px 6px; }
    .container { padding: 1.25rem 0.85rem; }
    h1 { font-size: 1.75rem; line-height: 1.25; word-break: break-word; }
    h2 { font-size: 1.35rem; word-break: break-word; }
    pre { max-width: 100%; overflow-x: auto; font-size: 0.82rem; padding: 0.9rem; -webkit-overflow-scrolling: touch; }
}
