/* === 主题色变量 (Theme: Lavender Purple & Rose Gold) === */
:root {
    --color-primary: #9d4edd;
    --color-primary-light: #e0aaff;
    --color-primary-dark: #7b2cbf;
    --color-accent: #ff8fab;
    --color-accent-hover: #ff5c8a;
    --color-bg: #fdf8f5;
    --color-bg-card: rgba(255, 255, 255, 0.85);
    --color-text: #2b2d42;
    --color-text-light: #5c677d;
    --color-border: #e2e8f0;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(157, 78, 221, 0.08);
    --shadow-md: 0 8px 24px rgba(157, 78, 221, 0.12);
    --shadow-lg: 0 16px 32px rgba(157, 78, 221, 0.15);

    --max-width: 1200px;
    --sidebar-width: 320px;
    --header-height: 70px;
}

/* === Reset & Base === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 40px;
    margin: 40px auto;
    align-items: start;
}

/* === Header & Navigation === */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #fca311 100%);
    background: linear-gradient(135deg, #fdf8f5 0%, #f3e8ff 100%);
    padding: 80px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-mini {
    padding: 60px 0 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 143, 171, 0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--color-primary-dark);
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

.hero-shape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.hero-shape svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 40px;
}

.hero-shape .shape-fill {
    fill: var(--color-bg);
}

/* === Cards & Tools === */
.tool-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-header {
    margin-bottom: 30px;
    text-align: center;
}

.tool-header h2 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.tool-header p {
    color: var(--color-text-light);
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background-color: #fff;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c677d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.radio-label:hover,
.checkbox-label:hover {
    border-color: var(--color-primary-light);
    background-color: rgba(157, 78, 221, 0.05);
}

.radio-label input:checked,
.checkbox-label input:checked {
    accent-color: var(--color-primary);
}

.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
    border-color: var(--color-primary);
    background-color: rgba(157, 78, 221, 0.05);
}

.unit-toggle {
    display: inline-flex;
    background: var(--color-border);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 20px;
}

.unit-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.unit-btn.active {
    background: #fff;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.4);
}

/* === Results Panel === */
.result-panel {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #fdf8f5, #fff);
    border-radius: var(--radius-md);
    border: 2px dashed var(--color-primary-light);
    text-align: center;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-panel.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.result-value {
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1;
    margin: 10px 0;
}

.result-desc {
    font-size: 1.1rem;
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: 15px;
}

.result-note {
    font-size: 0.9rem;
    color: var(--color-text-light);
    background: rgba(255, 143, 171, 0.1);
    padding: 10px;
    border-radius: var(--radius-sm);
}

/* === Ads === */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hide scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 0px;
}

.ad-slot {
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.ad-slot::before {
    content: 'Advertisement';
    position: absolute;
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.ad-slot-sidebar {
    width: 100%;
    aspect-ratio: 300 / 250;
}

.ad-slot-incontent {
    width: 100%;
    max-width: 728px;
    aspect-ratio: 728 / 90;
    margin: 40px auto;
}

/* === Grid Layouts for inputs === */
.input-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* === Footer === */
.site-footer {
    background-color: var(--color-text);
    color: #fff;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* === Misc Pages Content === */
.page-content {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.page-content h2 {
    margin: 30px 0 15px;
    color: var(--color-primary-dark);
}

.page-content h3 {
    margin: 20px 0 10px;
    font-size: 1.25rem;
}

.page-content p,
.page-content ul {
    margin-bottom: 15px;
}

.page-content ul {
    padding-left: 20px;
}

.page-content li {
    margin-bottom: 8px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.contact-info {
    background: var(--color-bg);
    padding: 30px;
    border-radius: var(--radius-md);
}

.contact-item {
    margin-bottom: 20px;
}

.contact-item strong {
    display: block;
    color: var(--color-primary-dark);
    margin-bottom: 5px;
}

/* === Animations === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive Design === */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: none;
        /* Hide sidebar on small screens or show differently */
    }

    /* Show sidebar ad slots in content stream for mobile if needed, or keep hidden */
    .sidebar.mobile-visible {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 15px;
    }

    .ad-slot-sidebar {
        width: 300px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .nav-links {
        display: none;
        /* In real app, implement mobile menu logic */
    }

    .mobile-menu-btn {
        display: block;
    }

    .input-grid-2 {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .tool-section {
        padding: 24px;
    }

    .ad-slot-incontent {
        aspect-ratio: 300 / 250;
        /* Fallback for mobile ad sizes */
    }
}