:root,
[data-theme="light"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #22c55e;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px
}

[data-theme="dark"] {
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #252542;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #2e2e4a;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3)
}

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

html {
    scroll-behavior: smooth
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
    transition: background .3s, color .3s
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px
}

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px)
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px
}

.logo-icon {
    font-size: 1.8rem
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px
}

nav ul {
    display: flex;
    list-style: none;
    gap: 24px
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .95rem;
    transition: color .2s
}

nav a:hover {
    color: var(--primary)
}

.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all .2s
}

.theme-toggle:hover {
    background: var(--primary);
    color: #fff
}

@media(max-width:768px) {
    nav ul {
        display: none
    }
}

.toc-section {
    background: var(--bg-card);
    padding: 16px 0;
    border-bottom: 1px solid var(--border)
}

.toc-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    list-style: none;
    margin: 0;
    padding: 0
}

.toc-list li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .9rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all .2s;
    display: inline-block
}

.toc-list li a:hover {
    color: var(--text);
    background: var(--bg-input)
}

@media(max-width:600px) {
    .toc-list {
        gap: 8px 12px
    }

    .toc-list li a {
        font-size: .8rem;
        padding: 6px 12px
    }
}

.disclaimer-section {
    padding: 24px 0;
    background: var(--bg)
}

.disclaimer-text {
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: .8
}

.hero {
    padding: 60px 0 40px;
    text-align: center;
    background: var(--bg-card)
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 16px;
    line-height: 1.7
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    opacity: .9
}

.generator-section {
    padding: 40px 0 60px
}

.generator-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border)
}

.generator-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center
}

.generator-form {
    max-width: 600px;
    margin: 0 auto
}

.form-group {
    margin-bottom: 20px
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text)
}

.required {
    color: #ef4444
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: border-color .2s, box-shadow .2s
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .2)
}

.form-group input::placeholder {
    color: var(--text-muted)
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

@media(max-width:600px) {
    .form-row {
        grid-template-columns: 1fr
    }
}

.tone-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px
}

.tone-option input {
    display: none
}

.tone-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
    text-align: center
}

.tone-option input:checked+.tone-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, .1)
}

.tone-card:hover {
    border-color: var(--primary-light)
}

.tone-emoji {
    font-size: 1.8rem;
    margin-bottom: 6px
}

.tone-label {
    font-weight: 600;
    font-size: .95rem
}

.tone-desc {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 4px
}

.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    margin-top: 8px
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, .4)
}

.generate-btn:active {
    transform: translateY(0)
}

.generate-btn:disabled {
    opacity: .7;
    cursor: not-allowed
}

.output-container {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    animation: fadeIn .3s ease
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px
}

.output-header h3 {
    font-size: 1.1rem
}

#character-output {
    color: var(--primary)
}

.output-actions {
    display: flex;
    gap: 12px
}

.action-btn {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success)
}

.headcanon-list {
    list-style: none
}

.headcanon-list li {
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
    line-height: 1.7
}

.headcanon-list li:last-child {
    margin-bottom: 0
}

.share-prompt {
    margin-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem
}

.ad-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center
}

.content-section {
    padding: 60px 0
}

.content-section.alt-bg {
    background: var(--bg-card)
}

.content-section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 24px;
    text-align: center
}

.content-section h3 {
    font-size: 1.25rem;
    margin: 24px 0 12px;
    color: var(--primary)
}

.section-intro {
    text-align: center;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 32px
}

.content-text {
    max-width: 800px;
    margin: 0 auto
}

.content-text p {
    margin-bottom: 16px;
    color: var(--text);
    opacity: .95
}

.comparison-table-wrapper {
    overflow-x: auto;
    margin: 32px 0
}

.comparison-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--bg-input);
    border-radius: var(--radius);
    overflow: hidden
}

.comparison-table th,
.comparison-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border)
}

.comparison-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600
}

.comparison-table tr:last-child td {
    border-bottom: none
}

.comparison-table tr:hover td {
    background: rgba(99, 102, 241, .05)
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px
}

.example-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border)
}

.example-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem
}

.example-list {
    list-style: none
}

.example-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: .95rem;
    color: var(--text-muted)
}

.example-list li:last-child {
    border-bottom: none
}

.examples-cta {
    text-align: center;
    margin-top: 32px;
    font-size: 1.1rem
}

.examples-cta a {
    color: var(--primary);
    text-decoration: underline
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0
}

.step-card {
    background: var(--bg-input);
    padding: 24px;
    border-radius: var(--radius);
    position: relative;
    border: 1px solid var(--border)
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 12px
}

.step-card h3 {
    margin: 0 0 8px;
    color: var(--text)
}

.step-card p {
    color: var(--text-muted);
    font-size: .95rem
}

.transparency-note {
    background: var(--bg-input);
    padding: 24px;
    border-radius: var(--radius);
    border-left: 4px solid var(--success);
    margin-top: 32px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto
}

.transparency-note h3 {
    margin: 0 0 12px;
    color: var(--success)
}

.transparency-note p {
    color: var(--text-muted);
    margin: 0
}

.faq-list {
    max-width: 800px;
    margin: 0 auto
}

.faq-item {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: var(--bg-card);
    border: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background .2s
}

.faq-question:hover {
    background: var(--bg-input)
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform .3s
}

.faq-item.active .faq-icon {
    transform: rotate(45deg)
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease
}

.faq-item.active .faq-answer {
    max-height: 500px
}

.faq-answer p {
    padding: 20px 24px;
    background: var(--bg-input);
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0
}

footer {
    background: var(--bg-card);
    padding: 60px 0 24px;
    border-top: 1px solid var(--border);
    margin-top: 60px
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 48px;
    margin-bottom: 40px
}

@media(max-width:768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px
    }
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 12px;
    font-size: .95rem
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px
}

.footer-col h4 {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text)
}

.footer-col ul {
    list-style: none
}

.footer-col li {
    margin-bottom: 10px
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .9rem;
    transition: color .2s
}

.footer-col a:hover {
    color: var(--primary)
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border)
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: .85rem
}

.legal-page {
    padding: 60px 0
}

.legal-page h1 {
    margin-bottom: 32px;
    text-align: center
}

.legal-content {
    max-width: 800px;
    margin: 0 auto
}

.legal-content h2 {
    margin: 32px 0 16px;
    text-align: left;
    font-size: 1.3rem
}

.legal-content p {
    margin-bottom: 16px;
    color: var(--text-muted)
}

.legal-content ul {
    margin: 16px 0;
    padding-left: 24px;
    color: var(--text-muted)
}

.legal-content li {
    margin-bottom: 8px
}

.legal-content a {
    color: var(--primary)
}

@media(max-width:768px) {
    .mobile-sticky-ad {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: 10px;
        border-top: 1px solid var(--border);
        z-index: 99
    }
}

.text-center {
    text-align: center
}

.mb-0 {
    margin-bottom: 0
}

.mt-4 {
    margin-top: 32px
}