/* =============================================
   Unit Conversion & Physical Models - Guide CSS
   Modern, Responsive, Mobile-First Design
   ============================================= */

/* Inherit from tool.css variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #0f172a;
    --accent-color: #06b6d4;
    --text-color: #334155;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --max-width: 1280px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--secondary-color);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
}

.logo i {
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-desktop { display: none; }
.nav-desktop ul { display: flex; gap: 0.5rem; }
.nav-desktop li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}
.nav-desktop li a:hover { background: var(--bg-light); color: var(--primary-color); }

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    z-index: 1001;
}
.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary-color);
    transition: all var(--transition-fast);
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-mobile {
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 100px 2rem 2rem;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
}
.nav-mobile.active { transform: translateX(0); }
.nav-mobile ul { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-mobile li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-size: 1.125rem;
    font-weight: 500;
    background: var(--bg-light);
    transition: all var(--transition-fast);
}
.nav-mobile li a:hover { background: var(--gradient-primary); color: white; }

/* Guide Hero */
.guide-hero {
    padding: 120px 0 60px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.guide-hero-content {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.guide-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}
.guide-breadcrumb a { color: var(--primary-color); }
.guide-breadcrumb a:hover { text-decoration: underline; }

.guide-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.guide-tag {
    padding: 0.375rem 0.75rem;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}
.guide-reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.guide-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.guide-excerpt {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
}

.guide-hero-image {
    display: none;
}
.guide-hero-image img {
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
}

/* Article Content */
.guide-content {
    padding: 60px 0;
}

.guide-layout {
    display: grid;
    gap: 2rem;
}

.article-content {
    background: var(--bg-color);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.article-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.8;
}

.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-light);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    font-style: italic;
    color: var(--text-light);
}

.article-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.info-box {
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    margin: 1.5rem 0;
}
.info-box.tip {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
}
.info-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.info-box-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.info-box.tip .info-box-title { color: var(--primary-color); }
.info-box.warning .info-box-title { color: #f59e0b; }
.info-box p { margin: 0; }

.formula-highlight {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    margin: 1.5rem 0;
}
.formula-highlight .formula {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}
.formula-highlight .description {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Sidebar */
.guide-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .guide-sidebar {
        position: sticky;
        top: 92px;
        height: fit-content;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

.sidebar-card {
    background: var(--bg-color);
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}
.sidebar-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-card h3 i { color: var(--primary-color); }

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toc-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-color);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}
.toc-list a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.related-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.related-list a:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}
.related-list a i {
    color: var(--primary-color);
}

/* Footer (Matching Index Page) */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    gap: 2rem;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 25px 0;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
    color: white;
}

/* Responsive */
@media (min-width: 640px) {
    .footer-content { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 768px) {
    .guide-hero-content { grid-template-columns: 1fr 1fr; gap: 3rem; }
    .guide-hero-image { display: block; }
    .guide-layout { grid-template-columns: 1fr 280px; }
}

@media (min-width: 1024px) {
    .mobile-menu-btn { display: none; }
    .nav-desktop { display: block; }
    .footer-content { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .guide-layout { grid-template-columns: 1fr 320px; }
}
