* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #eff6ff 0, #ffffff 35%, #f8fafc 100%);
    color: #0f172a;
}

.front-page {
    --hero-start: #0f172a;
    --hero-end: #1d4ed8;
    --hero-shadow: rgba(37, 99, 235, 0.2);
    --hero-text: rgba(255, 255, 255, 0.82);
    --pill-bg: rgba(255, 255, 255, 0.16);
    --button-text: #1d4ed8;
    --button-bg: #fff;
    --button-secondary-bg: rgba(255, 255, 255, 0.14);
    --button-secondary-text: #fff;
    --tag-bg: #dbeafe;
    --tag-color: #1d4ed8;
    --card-top: #ffffff;
    --card-bottom: #ffffff;
    --body-grad-start: #eff6ff;
    --body-grad-mid: #ffffff;
    --body-grad-end: #f8fafc;
    background: linear-gradient(180deg, var(--body-grad-start) 0, var(--body-grad-mid) 35%, var(--body-grad-end) 100%);
}

.theme-origin {
    --hero-start: #0f172a;
    --hero-end: #1d4ed8;
    --hero-shadow: rgba(37, 99, 235, 0.2);
    --hero-text: rgba(255, 255, 255, 0.82);
    --pill-bg: rgba(255, 255, 255, 0.16);
    --button-text: #1d4ed8;
    --button-bg: #fff;
    --button-secondary-bg: rgba(255, 255, 255, 0.14);
    --button-secondary-text: #fff;
    --tag-bg: #dbeafe;
    --tag-color: #1d4ed8;
}

.theme-atlas {
    --hero-start: #0f4c81;
    --hero-end: #3b82f6;
    --hero-shadow: rgba(14, 116, 216, 0.24);
    --hero-text: rgba(239, 246, 255, 0.92);
    --pill-bg: rgba(255, 255, 255, 0.2);
    --button-text: #0f4c81;
    --button-bg: #f8fbff;
    --button-secondary-bg: rgba(255, 255, 255, 0.18);
    --button-secondary-text: #fff;
    --tag-bg: #e0f2fe;
    --tag-color: #0369a1;
    --card-top: #f8fbff;
    --card-bottom: #ffffff;
    --body-grad-start: #edf6ff;
    --body-grad-mid: #f8fbff;
    --body-grad-end: #eef6ff;
}

.theme-studio {
    --hero-start: #134e4a;
    --hero-end: #0f766e;
    --hero-shadow: rgba(15, 118, 110, 0.2);
    --hero-text: rgba(236, 253, 245, 0.88);
    --pill-bg: rgba(255, 255, 255, 0.18);
    --button-text: #115e59;
    --button-bg: #f8fffe;
    --button-secondary-bg: rgba(255, 255, 255, 0.16);
    --button-secondary-text: #fff;
    --tag-bg: #ccfbf1;
    --tag-color: #0f766e;
    --card-top: #f4fffd;
    --card-bottom: #ffffff;
    --body-grad-start: #effcf9;
    --body-grad-mid: #f8fffd;
    --body-grad-end: #f2fbff;
}

.theme-draft {
    --hero-start: #1e3a8a;
    --hero-end: #2563eb;
    --hero-shadow: rgba(59, 130, 246, 0.22);
    --hero-text: rgba(239, 246, 255, 0.9);
    --pill-bg: rgba(255, 255, 255, 0.18);
    --button-text: #1e40af;
    --button-bg: #f8fbff;
    --button-secondary-bg: rgba(255, 255, 255, 0.16);
    --button-secondary-text: #fff;
    --tag-bg: #dbeafe;
    --tag-color: #1d4ed8;
    --card-top: #f8fbff;
    --card-bottom: #ffffff;
}

.front-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.front-slider,
.front-page-links,
.front-grid,
.content-meta-grid {
    display: grid;
    gap: 18px;
}

.front-slider {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 22px;
}

.front-page-links {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 20px;
}

.front-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 28px;
}

.front-grid-compact,
.content-meta-grid {
    grid-template-columns: repeat(2, 1fr);
}

.slide-card,
.page-link-card,
.front-page-card,
.front-card,
.feature-card,
.mini-card,
.content-meta-item {
    background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
    border: 1px solid rgba(228, 236, 248, 0.95);
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(16, 39, 77, 0.06);
}

.slide-card,
.page-link-card,
.front-card,
.feature-card,
.mini-card {
    padding: 20px;
}

.slide-card,
.page-link-card,
.content-link,
.front-back,
.front-button {
    text-decoration: none;
}

.slide-card,
.page-link-card {
    color: #0f172a;
}

.slide-card {
    display: grid;
    gap: 10px;
}

.slide-card strong,
.page-link-card strong,
.front-card h2,
.feature-card h2,
.mini-card h3,
.related-card h3,
.content-meta-panel h2,
.related-panel h2 {
    font-size: 15px;
    font-weight: 700;
}

.slide-card p,
.page-link-card p,
.front-card p,
.feature-card p,
.mini-card p,
.page-summary,
.page-body,
.auth-card p,
.content-meta-item span {
    color: #475569;
    line-height: 1.8;
    font-size: 13px;
}

.slide-card span,
.meta,
.panel-title-row span,
.content-template {
    color: #94a3b8;
    font-size: 11px;
}

.front-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 32px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
    color: #fff;
    box-shadow: 0 24px 60px var(--hero-shadow);
}

.eyebrow,
.tag,
.hero-note span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
}

.eyebrow {
    padding: 6px 10px;
    background: var(--pill-bg);
    font-size: 11px;
}

.front-hero h1,
.front-page-card h1 {
    margin: 16px 0 12px;
    font-size: 21px;
    font-weight: 700;
}

.front-hero p {
    margin: 0;
    color: var(--hero-text);
    font-size: 13px;
    line-height: 1.7;
}

.hero-note,
.hero-actions,
.content-topbar,
.content-meta-strip,
.panel-title-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-note {
    margin-top: 14px;
}

.hero-note span {
    min-height: 28px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
}

.front-button,
.content-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.front-button {
    background: var(--button-bg);
    color: var(--button-text);
}

.front-button.secondary {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.tag {
    padding: 5px 10px;
    background: var(--tag-bg);
    color: var(--tag-color);
    font-size: 11px;
}

.meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.95fr;
    gap: 18px;
    margin-top: 28px;
}

.feature-card.lead {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
}

.feature-card.lead h2,
.studio-card.studio-lead h2 {
    font-size: 21px;
}

.feature-stack {
    display: grid;
    gap: 18px;
}

.studio-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr;
    gap: 18px;
    margin-top: 28px;
}

.studio-card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.studio-card.studio-lead {
    min-height: 420px;
    padding: 28px;
}

.front-page-card {
    padding: 28px;
}

.page-summary {
    margin: 0 0 18px;
}

.page-body {
    color: #334155;
    white-space: normal;
    word-break: break-word;
}

.front-back {
    display: inline-flex;
    margin-bottom: 10px;
    color: #2563eb;
    font-size: 13px;
}

.content-link {
    margin-top: 16px;
    background: #eff6ff;
    color: #1d4ed8;
}

.content-page-card {
    display: grid;
    gap: 18px;
}

.content-topbar,
.panel-title-row {
    justify-content: space-between;
    align-items: center;
}

.content-meta-strip {
    margin-top: 0;
    color: #64748b;
    font-size: 12px;
}

.content-meta-panel {
    padding: 20px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #e5edff;
}

.content-meta-item {
    padding: 14px 16px;
}

.content-meta-item strong {
    display: block;
    font-size: 12px;
}

.content-meta-item span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
}

.content-meta-plain {
    color: #94a3b8;
}

.content-image-card,
.content-gallery-card {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #e5edff;
}

.content-image-box,
.content-gallery-item {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #dbe4ff;
    background: #f8fbff;
}

.content-image-box {
    margin-top: 10px;
}

.content-image-box img,
.content-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}

.content-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.content-inline-link {
    display: inline-flex;
    margin-top: 10px;
    color: #1d4ed8;
    font-size: 12px;
    text-decoration: none;
    word-break: break-all;
}

.related-panel {
    margin-top: 26px;
}

.related-card h3 {
    margin: 0;
    line-height: 1.6;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    max-width: 680px;
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(228, 236, 248, 0.95);
    box-shadow: 0 14px 36px rgba(16, 39, 77, 0.06);
}

.auth-card h1 {
    margin: 0 0 16px;
    font-size: 21px;
}

@media (max-width: 1000px) {
    .front-slider,
    .front-page-links,
    .front-grid,
    .front-grid-compact,
    .studio-grid,
    .feature-grid,
    .content-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-card.lead {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .front-hero,
    .content-topbar,
    .panel-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions {
        width: 100%;
    }

    .front-slider,
    .front-page-links,
    .front-grid,
    .front-grid-compact,
    .studio-grid,
    .feature-grid,
    .content-meta-grid {
        grid-template-columns: 1fr;
    }

    .studio-card.studio-lead {
        min-height: 300px;
    }

    .content-gallery-grid {
        grid-template-columns: 1fr;
    }
}
