:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --accent: #ff6f00;
    --accent-light: #ffa000;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #212121;
    --text-light: #616161;
    --border: #e0e0e0;
    --success: #2e7d32;
    --warning: #f57f17;
    --danger: #c62828;
}

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

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
}

/* Navigation */
.navbar {
    background: var(--primary);
    color: white;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo span {
    color: var(--accent-light);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 1.2rem 1rem;
    display: block;
    font-size: 0.95rem;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--accent-light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 8rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width=60 height=60 viewBox=0 0 60 60 xmlns=http://www.w3.org/2000/svg%3E%3Cg fill=none fill-rule=evenodd%3E%3Cg fill=%23ffffff fill-opacity=0.05%3E%3Cpath d=M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
    display: inline-block;
}

.card h3 {
    color: var(--primary-light);
    margin: 1.5rem 0 0.8rem;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Feature Cards */
.feature-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--accent-light);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: var(--primary);
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: #f8f9ff;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Steps */
.steps {
    position: relative;
    padding-left: 3rem;
}

.steps::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 3px;
}

.step {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.step::before {
    content: attr(data-step);
    position: absolute;
    left: -2.5rem;
    top: 1.5rem;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.step h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Severity Rating */
.severity {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.severity-high { background: var(--danger); }
.severity-med { background: var(--warning); }
.severity-low { background: var(--success); }

/* Timeline */
.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.timeline-year {
    min-width: 80px;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.timeline-content {
    flex: 1;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 2rem;
    margin-top: 64px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.breadcrumb a {
    color: var(--primary-light);
    text-decoration: none;
}

.breadcrumb span {
    color: var(--text-light);
    margin: 0 0.5rem;
}

/* Footer */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    padding: 3rem 2rem;
    margin-top: 3rem;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    font-size: 0.9rem;
}

/* Callout */
.callout {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.callout-info {
    background: #e3f2fd;
    border-color: #1976d2;
}

.callout-warning {
    background: #fff3e0;
    border-color: #f57c00;
}

.callout-success {
    background: #e8f5e9;
    border-color: #388e3c;
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem 1.5rem;
    background: #f8f9ff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary);
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #eef0ff;
}

.accordion-body {
    padding: 1.5rem;
    display: none;
}

.accordion-item.active .accordion-body {
    display: block;
}

.accordion-header::after {
    content: "+";
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.accordion-item.active .accordion-header::after {
    content: "−";
}

/* RPN Calculator */
.rpn-calc {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
}

.rpn-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.rpn-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.rpn-group select,
.rpn-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.rpn-group select:focus,
.rpn-group input:focus {
    border-color: var(--primary-light);
    outline: none;
}

.rpn-result {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.rpn-result .rpn-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.rpn-result .rpn-level {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 1rem 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .rpn-inputs {
        grid-template-columns: 1fr;
    }
}
