:root {
    --md-sys-color-primary: #8B5000;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #FFDCBE;
    --md-sys-color-on-primary-container: #2A1700;
    --md-sys-color-secondary: #765B4A;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #FFDCCF;
    --md-sys-color-on-secondary-container: #2B160D;
    --md-sys-color-tertiary: #5F6138;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #E4E5B9;
    --md-sys-color-on-tertiary-container: #1B1D00;
    --md-sys-color-error: #BA1A1A;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #f9dedc;
    --md-sys-color-background: #FFF8F5;
    --md-sys-color-on-background: #1F1B18;
    --md-sys-color-surface: #FFF8F5;
    --md-sys-color-on-surface: #1F1B18;
    --md-sys-color-surface-variant: #F2DFD5;
    --md-sys-color-on-surface-variant: #51443D;
    --md-sys-color-outline: #84746A;
    --md-sys-color-outline-variant: #D6C3B8;
    --md-sys-color-surface-container-lowest: #FFFFFF;
    --md-sys-color-surface-container-low: #FFF1EB;
    --md-sys-color-surface-container: #FCEEE8;
    --md-sys-color-surface-container-high: #F7E8E0;
    --md-sys-color-surface-container-highest: #F2E2D8;
    --md-sys-color-inverse-surface: #362F2B;
    --md-sys-color-inverse-on-surface: #FCEEE8;
    --md-sys-color-inverse-primary: #FFB873;

    --md-sys-shape-corner-extra-large: 24px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-medium: 20px;

    --md-sys-typescale-headline-large: 700 32px/40px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-headline-medium: 500 28px/36px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-headline-small: 500 24px/32px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-title-large: 500 22px/28px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-title-medium: 500 16px/24px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-title-small: 500 14px/20px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-body-large: 400 16px/24px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-body-medium: 400 14px/20px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-body-small: 400 12px/16px 'Noto Sans SC', sans-serif;
    --md-sys-typescale-label-large: 500 14px/20px 'Noto Sans SC', sans-serif;

    --md-sys-elevation-0: none;

    --md-sys-spacing-page: 16px;
    --md-sys-spacing-card-padding: 20px;
    --md-sys-spacing-card-gap: 16px;
    --md-sys-spacing-form: 16px;
    --md-sys-spacing-small: 8px;

    --md-ref-typeface-brand: 'Noto Sans SC', sans-serif;
    --md-ref-typeface-plain: 'Noto Sans SC', sans-serif;

    --md-icon-font: 'Material Symbols Outlined';
    --md-sys-color-scrim: rgba(255, 255, 255, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #FFB873;
        --md-sys-color-on-primary: #4A2800;
        --md-sys-color-primary-container: #6A3A00;
        --md-sys-color-on-primary-container: #FFDCBE;
        --md-sys-color-secondary: #E5C3B3;
        --md-sys-color-on-secondary: #432B1E;
        --md-sys-color-secondary-container: #5C4133;
        --md-sys-color-on-secondary-container: #FFDCCF;
        --md-sys-color-tertiary: #C9C99E;
        --md-sys-color-on-tertiary: #303218;
        --md-sys-color-tertiary-container: #46492D;
        --md-sys-color-on-tertiary-container: #E4E5B9;
        --md-sys-color-error: #FFB4AB;
        --md-sys-color-on-error: #690005;
        --md-sys-color-error-container: #4a0002;
        --md-sys-color-background: #1F1B18;
        --md-sys-color-on-background: #F2E2D8;
        --md-sys-color-surface: #1F1B18;
        --md-sys-color-on-surface: #F2E2D8;
        --md-sys-color-surface-variant: #51443D;
        --md-sys-color-on-surface-variant: #D6C3B8;
        --md-sys-color-outline: #9E8D82;
        --md-sys-color-outline-variant: #51443D;
        --md-sys-color-surface-container-lowest: #1A1613;
        --md-sys-color-surface-container-low: #1F1B18;
        --md-sys-color-surface-container: #241F1C;
        --md-sys-color-surface-container-high: #2E2925;
        --md-sys-color-surface-container-highest: #3A342F;
        --md-sys-color-inverse-surface: #F2E2D8;
        --md-sys-color-inverse-on-surface: #1F1B18;
        --md-sys-color-inverse-primary: #8B5000;
        --md-sys-color-scrim: rgba(0, 0, 0, 0.4);
    }
}

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

html {
    height: 100%;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--md-sys-color-outline) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--md-sys-color-outline);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--md-sys-color-primary);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    min-height: 100%;
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-background);
    background-color: var(--md-sys-color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.top-app-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--md-sys-color-surface);
}

.top-app-bar__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding: 0 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: var(--md-sys-color-surface-container);
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.2s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle-btn:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.sidebar-toggle-btn .material-symbols-outlined {
    font-size: 24px;
}

.sidebar-toggle-btn.is-hidden {
    display: none !important;
}

body:not(.auth-logged) .sidebar-toggle-btn {
    display: none !important;
}

.top-app-bar__leading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-app-bar__icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.top-app-bar__title {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
}

.top-app-bar__trailing {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-button {
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 0 16px;
    height: 40px;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-button--outlined {
    background: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

.nav-button--outlined:hover {
    background-color: var(--md-sys-color-primary-container);
}

.nav-button--filled {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.nav-button--filled:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.nav-button--text {
    background: transparent;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-button--text:hover {
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface-container);
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 120px var(--md-sys-spacing-page) 80px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-section {
    text-align: center;
    margin-bottom: 48px;
    max-width: 800px;
}

/* ============================================
   Mode Switcher Animations
   ============================================ */

.hero-section__title {
    font: var(--md-sys-typescale-headline-large);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 12px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-section__title.animate-out {
    opacity: 0;
    transform: translateY(-10px);
}

.hero-section__title.animate-in {
    animation: fadeInUp 0.3s ease forwards;
}

.hero-section__subtitle {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-section__subtitle.animate-out {
    opacity: 0;
    transform: translateY(-10px);
}

.hero-section__subtitle.animate-in {
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.input-card.animate-in {
    animation: cardFadeIn 0.3s ease forwards;
}

.mode-switcher__tab:active {
    transform: scale(0.97);
}

.hero-section__aigc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    margin-top: 20px;
    background: linear-gradient(135deg, #FFB873 0%, #8B5000 100%);
    border-radius: var(--md-sys-shape-corner-extra-large);
    box-shadow: 0 4px 12px rgba(139, 80, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-section__aigc-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 80, 0, 0.35);
}

.hero-section__aigc-icon {
    font-size: 24px;
    color: #ffffff;
}

.hero-section__aigc-text {
    font: var(--md-sys-typescale-title-medium);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 1px;
}

.hero-section__aigc-desc {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 16px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.mode-switcher {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 6px;
    margin-bottom: 16px;
    gap: 4px;
}

.mode-switcher__tab {
    position: relative;
    z-index: 1;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mode-switcher__tab:hover {
    color: var(--md-sys-color-on-surface);
}

.mode-switcher__tab--active {
    color: var(--md-sys-color-primary);
}

.mode-switcher__icon {
    font-size: 18px;
}

.mode-switcher__indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(50% - 8px);
    height: calc(100% - 12px);
    background-color: var(--md-sys-color-surface-container-lowest);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.mode-switcher__indicator--right {
    transform: translateX(calc(100% + 4px));
}

.mode-switcher__quota {
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    margin-top: -8px;
    margin-bottom: 16px;
    padding: 0 4px;
    text-align: center;
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.7;
    line-height: 1.6;
}

.quota-highlight {
    color: var(--md-sys-color-primary);
    font-weight: 500;
}

.quota-daily-flash {
    background: linear-gradient(135deg, #8B5000, #FF8C00, #FFB873, #FF8C00, #8B5000);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    animation: quotaGoldShift 2.5s ease-in-out infinite;
}

@keyframes quotaGoldShift {
    0%, 100% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 3px rgba(255, 140, 0, 0.4));
    }
    50% {
        background-position: 100% 50%;
        filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.7));
    }
}

.input-card {
    width: 100%;
    max-width: 720px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 16px;
    margin-bottom: 80px;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.input-card--aigc {
}

.input-card--aigc.initial-load {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.aigc-input-card__upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    border: 2px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-low);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    margin-bottom: 16px;
}

.aigc-input-card__upload:hover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.aigc-input-card__upload--dragover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.aigc-input-card__upload-icon {
    font-size: 40px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
}

.aigc-input-card__upload-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 4px 0;
}

.aigc-input-card__upload-hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.aigc-input-card__file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    margin-bottom: 16px;
}

.aigc-input-card__file-info .material-symbols-outlined {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
}

.aigc-input-card__file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.aigc-input-card__file-name {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aigc-input-card__file-size {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.aigc-input-card__file-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    transition: background-color 0.2s, color 0.2s;
}

.aigc-input-card__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.aigc-input-card__file-delete .material-symbols-outlined {
    font-size: 20px;
}

.aigc-input-card__params {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.aigc-input-card__param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.aigc-input-card__param-label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    flex-shrink: 0;
}

.aigc-input-card__param-select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    background-color: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.aigc-input-card__param-select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.aigc-chip-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.aigc-chip {
    padding: 6px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font: var(--md-sys-typescale-body-medium);
    transition: background-color 200ms, border-color 200ms;
    font-family: 'Noto Sans SC', sans-serif;
    white-space: nowrap;
}

.aigc-chip:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.aigc-chip--selected {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: var(--md-sys-color-secondary-container);
}

.input-card__actions-row--aigc {
    justify-content: center;
    margin-top: 4px;
}

.input-card__actions-row--aigc .generate-button {
    width: 100%;
}

.input-card__selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.selector-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 34px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 17px;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.selector-chip:hover {
    background-color: var(--md-sys-color-surface-container-highest);
    border-color: var(--md-sys-color-primary);
}

.selector-chip__icon {
    font-size: 14px;
}

.selector-chip__separator {
    color: var(--md-sys-color-outline);
    font-size: 14px;
    font-weight: 300;
}

.selector-chip__arrow {
    font-size: 14px;
}

.input-card__textarea-wrapper {
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 12px;
    background-color: transparent;
    transition: border-color 0.2s ease;
}

.input-card__textarea-wrapper:focus-within {
    border-color: var(--md-sys-color-primary);
}

.input-card__textarea {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    resize: vertical;
    min-height: 100px;
}

.input-card__textarea::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.input-card__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
}

.generate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 40px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin-top: 20px;
}

.generate-button:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.generate-button:active {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
}

.generate-button__icon {
    font-size: 16px;
}

.generate-button__text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.features-section {
    width: 100%;
    margin-top: 48px;
    margin-bottom: 80px;
}

.features-section__title {
    font: var(--md-sys-typescale-headline-medium);
    color: var(--md-sys-color-on-surface);
    text-align: center;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--md-sys-spacing-card-gap);
}

.feature-card {
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-card-padding);
}

.feature-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-radius: 16px;
    margin-bottom: 16px;
}

.feature-card__icon .material-symbols-outlined {
    font-size: 28px;
}

.feature-card__title {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
}

.feature-card__description {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.feature-card--highlight {
    position: relative;
    border: 2px solid var(--md-sys-color-primary);
    background: linear-gradient(135deg, var(--md-sys-color-surface-container-lowest) 0%, var(--md-sys-color-primary-container) 100%);
}

.feature-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font: var(--md-sys-typescale-label-small);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
}

.workflow-step--highlight {
    border: 2px solid var(--md-sys-color-primary);
    background: linear-gradient(135deg, var(--md-sys-color-surface-container-lowest) 0%, var(--md-sys-color-primary-container) 100%);
}

.workflow-section {
    width: 100%;
    margin-bottom: 80px;
}

.workflow-section__title {
    font: var(--md-sys-typescale-headline-medium);
    color: var(--md-sys-color-on-surface);
    text-align: center;
    margin-bottom: 48px;
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-card-gap);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.workflow-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-card-padding);
}

.workflow-step__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-radius: 50%;
    font: var(--md-sys-typescale-title-medium);
    flex-shrink: 0;
}

.workflow-step__content {
    flex: 1;
}

.workflow-step__title {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.workflow-step__description {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.cta-section {
    width: 100%;
    max-width: 800px;
    text-align: center;
    margin-bottom: 80px;
}

.cta-section__title {
    font: var(--md-sys-typescale-headline-medium);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 12px;
}

.cta-section__subtitle {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 24px;
}

.footer {
    background-color: var(--md-sys-color-surface-container);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding: 48px var(--md-sys-spacing-page);
}

.footer__content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.footer__brand {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer__brand-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.footer__brand-name {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
}

.footer__column-title {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
}

.footer__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer__links a {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__links a:hover {
    color: var(--md-sys-color-primary);
}

.footer__bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    text-align: center;
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.footer__icp {
    margin-top: 8px;
    font-size: 12px;
}

.footer__icp a {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__icp a:hover {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
}

md-outlined-button {
    --md-outlined-button-outline-color: var(--md-sys-color-outline);
    --md-outlined-button-label-text-color: var(--md-sys-color-primary);
    --md-outlined-button-container-shape: var(--md-sys-shape-corner-extra-large);
    --md-outlined-button-container-height: 40px;
}

md-filled-button {
    --md-filled-button-container-color: var(--md-sys-color-primary);
    --md-filled-button-label-text-color: var(--md-sys-color-on-primary);
    --md-filled-button-container-shape: var(--md-sys-shape-corner-extra-large);
    --md-filled-button-container-height: 40px;
}

md-icon {
    font-feature-settings: 'rlig' 1;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: 'rlig' 1;
    -webkit-font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

body, button, input, textarea, select {
    font-feature-settings: 'rlig' 1;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    text-rendering: optimizeLegibility;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--md-sys-color-scrim);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.85);
    filter: blur(10px);
    opacity: 0;
    transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
    filter: blur(0);
    opacity: 1;
}

.modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 1;
}

.modal__close:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.modal__close .material-symbols-outlined {
    font-size: 24px;
}

.modal__title {
    font: var(--md-sys-typescale-headline-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 24px;
    text-align: left;
}

.modal__card {
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
}

.modal__card-content {
    padding: var(--md-sys-spacing-card-padding);
}

.modal__input-group {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 0 16px;
    height: 56px;
    background-color: transparent;
    transition: border-color 0.2s ease;
}

.modal__input-group:focus-within {
    border-color: var(--md-sys-color-primary);
}

.modal__input-group + .modal__input-group,
.modal__error + .modal__input-group,
.modal__agreement + .modal__error {
    margin-top: 16px;
}

.modal__input-group + .modal__error {
    margin-top: 4px;
}

.modal__input-icon {
    display: flex;
    align-items: center;
    color: var(--md-sys-color-on-surface-variant);
    margin-right: 12px;
    flex-shrink: 0;
}

.modal__input-icon .material-symbols-outlined {
    font-size: 20px;
}

.modal__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    height: 100%;
}

.modal__input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.modal__input-group--password .modal__input {
    padding-right: 40px;
}

.modal__password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    padding: 0;
}

.modal__password-toggle .material-symbols-outlined {
    font-size: 20px;
}

.modal__section-title {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-primary);
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.modal__captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.modal__captcha-img {
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.modal__captcha-row .modal__input {
    width: 80px;
    height: 40px;
}

.modal__code-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-medium);
    background-color: transparent;
    color: var(--md-sys-color-primary);
    font: var(--md-sys-typescale-label-large);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal__code-btn:hover {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.modal__code-btn:disabled {
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
    background-color: transparent;
    cursor: not-allowed;
    opacity: 0.5;
}

.modal__agreement {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.modal__agreement input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--md-sys-color-primary);
    width: 18px;
    height: 18px;
}

.modal__agreement-text {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}

.modal__link {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
    font-weight: 500;
}

.modal__submit-btn {
    width: 100%;
    margin-top: 16px;
    padding: 0 24px;
    height: 52px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: box-shadow 0.2s ease;
}

.modal__submit-btn:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.modal__submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.modal__submit-btn:not(:disabled):hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.aigc-btn__spinner {
    margin-right: 8px;
}

.aigc-btn__icon {
    margin-right: 8px;
}


.modal__register-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    gap: 4px;
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.modal__forgot-password-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    gap: 4px;
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.modal__link--bold {
    color: var(--md-sys-color-primary);
    font-weight: 700;
    text-decoration: none;
}

.modal__link--bold:hover {
    text-decoration: underline;
}

.modal--wizard {
    position: relative;
    max-width: 560px;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.wizard__header {
    flex-shrink: 0;
    padding: 24px 24px 0;
}

.wizard__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal--wizard .modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.wizard__progress {
    margin-bottom: 16px;
}

.wizard__progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: 2px;
    overflow: hidden;
}

.wizard__progress-fill {
    height: 100%;
    background-color: var(--md-sys-color-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.wizard__step-counter {
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-primary);
    margin-bottom: 8px;
}

.wizard__title {
    margin-bottom: 4px !important;
}

.wizard__subtitle {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 24px;
}

.wizard__content {
    margin-bottom: 16px;
}

.wizard__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wizard__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-lowest);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wizard__option:hover {
    background-color: var(--md-sys-color-surface-container);
}

.wizard__option--selected {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.wizard__option--selected .wizard__option-check {
    opacity: 1;
    color: var(--md-sys-color-on-primary-container);
}

.wizard__option-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
}

.wizard__option-check {
    font-size: 20px;
    opacity: 0;
    color: var(--md-sys-color-primary);
    transition: opacity 0.2s ease;
}

.wizard__custom-input {
    margin-top: 12px;
}

.wizard__categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wizard__category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-lowest);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wizard__category:hover {
    background-color: var(--md-sys-color-surface-container);
}

.wizard__category--selected {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.wizard__category-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
}

.wizard__category-arrow {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
}

.wizard__subtypes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.wizard__subtype {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-lowest);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wizard__subtype:hover {
    background-color: var(--md-sys-color-surface-container);
}

.wizard__subtype--selected {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.wizard__subtype--selected .wizard__option-check {
    opacity: 1;
    color: var(--md-sys-color-on-primary-container);
}

.wizard__subtype-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    text-align: center;
    flex: 1;
}

.wizard__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 24px 24px;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-lowest);
    flex-shrink: 0;
}

.wizard__btn {
    padding: 0 24px;
    height: 40px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.wizard__btn--back {
    background: transparent;
    color: var(--md-sys-color-primary);
}

.wizard__btn--back:hover {
    background-color: var(--md-sys-color-primary-container);
}

.wizard__btn--next {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.wizard__btn--next:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.wizard__btn--next:disabled {
    background-color: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.user-avatar:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.user-avatar__initial {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--md-sys-color-on-primary);
}

.modal__error {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-error);
    padding: 0 4px;
}

.modal__error--block {
    margin-top: 8px;
    text-align: center;
}

.modal__success {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-primary);
    padding: 0 4px;
}

.modal__subtitle {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 16px;
}

.verify-code-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.verify-code-input {
    width: 48px;
    height: 56px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    text-align: center;
    font: 700 28px/1 'Noto Sans SC', sans-serif;
    color: var(--md-sys-color-on-surface);
    background-color: transparent;
    outline: none;
    transition: border-color 0.2s ease;
}

.verify-code-input:focus {
    border-color: var(--md-sys-color-primary);
}

.resend-container {
    text-align: center;
    margin-top: 16px;
}

.resend-link {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.resend-link.disabled {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.modal--account {
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.modal__scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-top: 48px;
}

.modal--account .modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.modal--account {
    position: relative;
}

.account-card {
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-card-padding);
    margin-bottom: 16px;
}

.account-card:last-of-type {
    margin-bottom: 0;
}

.account-section__title {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
}

.account-section__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-section__btn {
    align-self: flex-end;
    padding: 0 16px;
    height: 40px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: box-shadow 0.2s ease;
}

.account-section__btn:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.account-profile__loading,
.session-list__loading {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.account-profile__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-profile__name {
    font: 500 22px/28px 'Noto Sans SC', sans-serif;
    color: var(--md-sys-color-on-surface);
}

.account-profile__email {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.account-profile__joined {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.session-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.session-item:first-child {
    padding-top: 0;
}

.session-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-item__id {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
}

.session-item__active {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.session-item__kick-btn {
    border: none;
    background: transparent;
    color: var(--md-sys-color-error);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--md-sys-shape-corner-medium);
    transition: background-color 0.2s ease;
}

.session-item__kick-btn:hover {
    background-color: var(--md-sys-color-error-container);
}

.logout-btn {
    width: 100%;
    padding: 0 24px;
    height: 40px;
    border: 1px solid var(--md-sys-color-error);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-error);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin-top: 24px;
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background-color: var(--md-sys-color-error-container);
}

.invite-card__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
}

.invite-card__description {
    margin: 0 0 16px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
    line-height: 1.5;
}

.invite-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--md-sys-color-surface-container-low);
    border-radius: 12px;
    margin-bottom: 16px;
}

.invite-code-text {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--md-sys-color-primary);
    user-select: all;
}

.invite-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.invite-copy-btn:hover {
    background: var(--md-sys-color-surface-container-high);
    transform: scale(1.05);
}

.invite-copy-btn:active {
    transform: scale(0.95);
}

.invite-copy-btn .material-symbols-outlined {
    font-size: 20px;
}

.invite-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.invite-stat {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}

.invite-stat strong {
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
}

.invite-generate-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.invite-generate-btn:hover {
    opacity: 0.9;
}

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

.invite-card__benefits {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--md-sys-color-tertiary-container);
    border-radius: 12px;
    color: var(--md-sys-color-on-tertiary-container);
    font-size: 13px;
    line-height: 1.6;
}

.invite-card__benefits-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--md-sys-color-tertiary);
    color: var(--md-sys-color-on-tertiary);
}

.invite-card__benefits-icon .material-symbols-outlined {
    font-size: 18px;
}

.invite-card__benefits-text {
    flex: 1;
}

.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .invite-code-text {
        font-size: 20px;
        letter-spacing: 2px;
    }
    .invite-stats {
        gap: 12px;
    }
    .invite-generate-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .invite-code-display {
        padding: 12px;
    }
    .invite-copy-btn {
        width: 36px;
        height: 36px;
    }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--md-sys-color-outline-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.app-layout {
    display: flex;
    flex-wrap: wrap;
    min-height: calc(100vh - 80px);
}

body.auth-logged .app-layout {
    min-height: 100vh;
}

.app-layout .sidebar {
    flex-shrink: 0;
}

.app-layout .main-area {
    flex: 1 1 auto;
    min-width: 0;
}

.app-layout .footer {
    width: 100%;
    flex: 0 0 100%;
}

.app-layout--sidebar-visible .top-app-bar {
    display: none;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.main-area .main-content {
    padding: 40px var(--md-sys-spacing-page) 40px;
    max-width: 720px;
}

.main-area .main-content .hero-section {
    margin-bottom: 24px;
}

.main-area .main-content .hero-section__title {
    font: var(--md-sys-typescale-title-large);
}

.main-area .main-content .input-card {
    margin-bottom: 40px;
}

.main-area .main-content .mode-switcher {
    margin-bottom: 12px;
}

.main-area .main-content .input-card--aigc {
    margin-bottom: 40px;
}

.sidebar {
    width: 320px;
    background-color: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.sidebar__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 16px 16px;
    flex-shrink: 0;
}

.sidebar__icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar__title {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
}

.sidebar__new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 8px;
    padding: 0 16px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: box-shadow 0.2s ease;
}

.sidebar__new-btn:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.sidebar__new-btn .material-symbols-outlined {
    font-size: 16px;
}

.sidebar__projects {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
    margin-bottom: 8px;
}

.sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
}

.sidebar__empty-icon {
    font-size: 96px;
    color: var(--md-sys-color-outline);
    margin-bottom: 16px;
}

.sidebar__empty-title {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 4px;
}

.sidebar__empty-subtitle {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-outline);
}

.sidebar__project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 12px 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar__project-card:hover {
    background-color: var(--md-sys-color-surface-container);
}

.sidebar__project-card__name {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.sidebar__project-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar__project-card__status {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 6px;
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font: var(--md-sys-typescale-label-large);
    font-size: 10px;
    line-height: 1.4;
}

.sidebar__project-card__date {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.sidebar__footer {
    padding: 12px 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__quota {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
}

.sidebar__quota-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar__quota-title {
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar__quota-reset-text {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.sidebar__quota-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar__quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar__quota-label {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
}

.sidebar__quota-bar {
    width: 100%;
    height: 6px;
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: 3px;
    overflow: hidden;
}

.sidebar__quota-fill {
    height: 100%;
    width: 0%;
    background-color: var(--md-sys-color-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.sidebar__quota-text {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    font-size: 10px;
}

.sidebar__quota-resource-pack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 0;
}
.sidebar__quota-resource-pack .sidebar__quota-row {
    gap: 2px;
}

.sidebar__quota-divider {
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 0;
}

.sidebar__quota-detail-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    margin-top: 0;
    padding: 1px 0;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sidebar__quota-detail-link-right {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--md-sys-color-primary);
}

.sidebar__quota-rp-status {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__quota-detail-link:hover {
    opacity: 0.8;
}

.sidebar__quota-detail-link .material-symbols-outlined {
    font-size: 16px;
}

.sidebar__quota-arrow {
    font-size: 16px;
    color: var(--md-sys-color-on-surface-variant);
    transition: transform 0.25s ease;
    margin-left: auto;
}

.sidebar__quota--collapsed .sidebar__quota-arrow {
    transform: rotate(0deg);
}

.sidebar__quota:not(.sidebar__quota--collapsed) .sidebar__quota-arrow {
    transform: rotate(90deg);
}

.sidebar__quota-body {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
    margin-top: 6px;
}

.sidebar__quota--collapsed .sidebar__quota-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.sidebar__quota-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar__quota:hover {
    background-color: var(--md-sys-color-surface-container);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.sidebar__avatar-initial {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--md-sys-color-on-primary);
}

.sidebar__username {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 16px;
    width: 100%;
    height: 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.sidebar__download-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

.sidebar__download-btn .material-symbols-outlined {
    font-size: 18px;
}

body.auth-logged .top-app-bar__content {
    display: none;
}



body.auth-logged .sidebar {
    top: 0;
    height: 100vh;
}

body.auth-logged #featuresAndBelow,
body.auth-logged .footer,
body.auth-logged .workflow-section,
body.auth-logged .cta-section {
    display: none;
}

@media (max-width: 768px) {
    .top-app-bar__content {
        height: 64px;
    }

    .nav-button {
        padding: 0 12px;
        height: 36px;
        font-size: 13px;
    }

    .main-content {
        padding: 40px var(--md-sys-spacing-page) 48px;
    }

    .hero-section__title {
        font: var(--md-sys-typescale-headline-medium);
    }

    .hero-section {
        margin-bottom: 32px;
    }

    .hero-section__aigc-badge {
        padding: 8px 20px;
        margin-top: 16px;
    }

    .hero-section__aigc-icon {
        font-size: 20px;
    }

    .hero-section__aigc-text {
        font-size: 16px;
    }

    .hero-section__aigc-desc {
        font-size: 13px;
        line-height: 1.6;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-section,
    .workflow-section,
    .cta-section {
        margin-bottom: 48px;
    }

    .footer__content {
        grid-template-columns: 1fr 1fr;
    }

    .modal {
        max-width: 100%;
        margin: 0 8px;
    }

    .modal--wizard {
        max-height: 75vh;
    }

    .wizard__header {
        padding: 20px 16px 0;
    }

    .wizard__body {
        padding: 20px 16px;
    }

    .wizard__actions {
        margin: 12px 16px 16px;
    }

    body.auth-logged .app-layout {
        flex-wrap: nowrap;
    }

    .sidebar {
        width: 240px;
        flex-shrink: 0;
        top: 0;
        height: auto;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        position: sticky;
    }

    body.auth-logged .sidebar {
        top: 0;
        max-height: 100vh;
    }

    body.auth-logged .app-layout {
        min-height: 100vh;
    }

    .input-card__actions-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .input-card__actions-row .generate-button {
        margin-top: 8px;
        width: 100%;
    }

    .main-file-list-wrapper {
        width: 100%;
        flex-shrink: 1;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    :root {
        --md-sys-spacing-page: 12px;
        --md-sys-spacing-card-padding: 16px;
    }

    .top-app-bar__content {
        height: 56px;
        padding: 0 16px;
    }

    .top-app-bar__icon {
        width: 28px;
        height: 28px;
    }

    .top-app-bar__title {
        font: var(--md-sys-typescale-title-medium);
    }

    .top-app-bar__trailing {
        gap: 6px;
    }

    .nav-button {
        padding: 0 10px;
        height: 32px;
        font-size: 12px;
    }

    .main-content {
        padding: 32px 12px 32px;
    }

    .hero-section__title {
        font: var(--md-sys-typescale-headline-medium);
    }

    .hero-section {
        margin-bottom: 24px;
    }

    .hero-section__aigc-badge {
        padding: 8px 16px;
        margin-top: 12px;
    }

    .hero-section__aigc-icon {
        font-size: 18px;
    }

    .hero-section__aigc-text {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .hero-section__aigc-desc {
        font-size: 12px;
        line-height: 1.6;
        max-width: 100%;
    }

    .input-card {
        margin-bottom: 32px;
    }

    .input-card__selectors {
        flex-direction: column;
        gap: 8px;
    }

    .selector-chip {
        width: 100%;
        justify-content: space-between;
        height: 48px;
    }

    .input-card__textarea {
        min-height: 80px;
    }

    .input-card__actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        justify-content: flex-start;
    }

    .input-card__actions-left {
        width: 100%;
    }

    .main-file-popup {
        left: 0;
        right: 0;
        max-width: none;
    }

    .generate-button {
        width: 100%;
        margin-top: 20px;
    }

    .features-section,
    .workflow-section,
    .cta-section {
        margin-bottom: 32px;
    }

    .features-section__title,
    .workflow-section__title {
        font: var(--md-sys-typescale-title-large);
        margin-bottom: 24px;
    }

    .feature-card {
        padding: 16px;
    }

    .feature-card__icon {
        width: 48px;
        height: 48px;
    }

    .feature-card__icon .material-symbols-outlined {
        font-size: 24px;
    }

    .workflow-steps {
        gap: 12px;
    }

    .workflow-step {
        padding: 16px;
    }

    .workflow-step__number {
        width: 32px;
        height: 32px;
        font: var(--md-sys-typescale-title-small);
    }

    .cta-section__title {
        font: var(--md-sys-typescale-title-large);
    }

    .cta-section__subtitle {
        margin-bottom: 16px;
    }

    .footer {
        padding: 32px 12px;
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer__bottom {
        margin-top: 24px;
        padding-top: 16px;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-overlay--dialog {
        align-items: center;
        padding: 16px;
    }

    .modal-overlay--dialog .modal {
        max-width: 400px;
        margin: 0 auto;
        border-radius: var(--md-sys-shape-corner-extra-large);
        padding: 0;
    }

    .modal {
        max-width: 100%;
        margin: 0;
        max-height: 75vh;
        border-radius: 24px 24px 0 0;
        padding: 40px 16px 24px;
    }

     .modal__title {
        padding: 0;
    }

    .modal__card-content {
        padding: 16px;
    }

    .modal__register-link {
        padding: 0 16px 24px;
    }

    .modal__subtitle {
        padding: 0 16px;
    }

    .verify-code-container {
        gap: 6px;
    }

    .modal__agreement {
        padding: 0 4px;
    }

    .resend-container {
        padding: 0 16px;
    }

    .modal__input-group {
        height: 48px;
    }

    .modal__submit-btn {
        height: 48px;
    }

    .modal__register-link {
        margin-top: 16px;
    }

    .modal--wizard {
        max-height: 75vh;
        padding: 0;
    }

    .wizard__header {
        padding: 16px 16px 0;
    }

    .wizard__body {
        padding: 16px;
    }

    .wizard__actions {
        margin: 12px 16px 16px;
        padding: 10px 16px;
    }

    .wizard__btn {
        padding: 0 16px;
        height: 44px;
        font-size: 14px;
    }

    .wizard__option {
        padding: 14px 16px;
    }

    .wizard__category {
        padding: 16px;
    }

    .wizard__subtypes {
        grid-template-columns: 1fr;
    }

    .wizard__subtype {
        padding: 16px;
    }

    body:not(.auth-logged) .app-layout {
        min-height: calc(100vh - 56px);
    }
    
    .main-area .main-content {
        padding: 24px var(--md-sys-spacing-page) 24px;
    }

    .main-area .main-content .input-card {
        max-width: 100%;
    }

    .project-editor__scroll {
        max-width: 100%;
    }

    .main-file-list-wrapper {
        width: 100%;
        flex-shrink: 1;
        min-width: 0;
    }

    .main-file-popup {
        left: 0;
        right: 0;
        max-width: none;
    }

    .input-card__actions-left {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 1056px) {
    body.auth-logged .app-layout {
        flex-wrap: nowrap;
    }

    .sidebar {
        height: auto;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    body.auth-logged .sidebar {
        height: auto;
        max-height: 100vh;
    }

    .app-layout .sidebar:not(.is-hidden) ~ .main-area .main-content .input-card {
        max-width: 100%;
    }

    .app-layout .sidebar:not(.is-hidden) ~ .main-area .main-content {
        max-width: 100%;
    }

    .app-layout .sidebar:not(.is-hidden) ~ .main-area .project-editor__scroll {
        max-width: 100%;
    }

    .input-card__actions-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .input-card__actions-row .generate-button {
        margin-top: 8px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    body.auth-logged .sidebar-toggle-btn {
        display: flex;
    }

    .sidebar {
        width: 100%;
        top: 0;
        height: 100dvh;
        max-height: none;
        position: fixed;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.auth-logged .sidebar {
        top: 0;
        height: 100dvh;
        max-height: none;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.32);
        z-index: 149;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.is-visible {
        display: block;
        opacity: 1;
    }

    .sidebar__header {
        padding: 16px 12px 12px;
        gap: 8px;
    }

    .sidebar__icon {
        width: 28px;
        height: 28px;
    }

    .sidebar__new-btn {
        margin: 0 12px 6px;
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .sidebar__aigc-btn {
        margin: 0 12px 6px;
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .sidebar__projects {
        padding: 0 12px;
    }

    .sidebar__project-card {
        padding: 10px 12px;
    }

    .sidebar__project-card__name {
        font-size: 13px;
    }

    .sidebar__footer {
        padding: 10px 12px;
    }

    .sidebar__avatar {
        width: 32px;
        height: 32px;
    }

    .sidebar__avatar-initial {
        font-size: 14px;
    }

    .sidebar__download-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .top-app-bar__title {
        font: var(--md-sys-typescale-title-small);
    }

    .nav-button {
        padding: 0 8px;
        font-size: 11px;
    }

    .verify-code-input {
        width: 40px;
        height: 48px;
        font-size: 24px;
    }

    .account-section__btn {
        width: 100%;
    }

    .logout-btn {
        height: 48px;
    }

    .modal--account .modal__scrollable {
        padding: 20px 16px;
        padding-top: 40px;
    }

    .account-card {
        padding: 16px;
    }
}

/* ============================================
   Generation Wizard Styles
   ============================================ */

/* Question Card */
.gen-wizard__question-card {
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.gen-wizard__question-number {
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-primary);
    margin-bottom: 4px;
    margin-top: 0;
}

.gen-wizard__question-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
    margin-top: 0;
}

.gen-wizard__question-hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
    margin-top: 0;
    line-height: 1.6;
}

/* Answer Input */
.gen-wizard__answer-input {
    min-height: 60px;
    resize: vertical;
}

/* Loading State */
.gen-wizard__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.gen-wizard__loading-text {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 12px;
}

/* Error State */
.gen-wizard__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.gen-wizard__error-text {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-error);
    margin-bottom: 16px;
    text-align: center;
}

.gen-wizard__retry-btn {
    padding: 0 16px;
    height: 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.gen-wizard__retry-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

/* Success State */
.gen-wizard__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.gen-wizard__success-icon {
    font-size: 48px;
    color: var(--md-sys-color-primary);
}

.gen-wizard__success-text {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
    margin-top: 12px;
}

.gen-wizard__success-hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}

/* ============================================
   Legal Document Modal Styles
   ============================================ */

.modal--legal-doc {
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.modal--legal-doc .modal__title {
    padding-right: 48px;
}

.legal-doc__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.legal-doc__loading-text {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 12px;
}

.legal-doc__content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.legal-doc__version {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.legal-doc__markdown {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    line-height: 1.8;
}

.legal-doc__markdown h1 {
    font: var(--md-sys-typescale-headline-small);
    color: var(--md-sys-color-on-surface);
    margin-top: 32px;
    margin-bottom: 16px;
}

.legal-doc__markdown h2 {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
    margin-top: 24px;
    margin-bottom: 12px;
}

.legal-doc__markdown h3 {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-doc__markdown p {
    margin-bottom: 16px;
}

.legal-doc__markdown ul,
.legal-doc__markdown ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.legal-doc__markdown li {
    margin-bottom: 8px;
}

.legal-doc__markdown a {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
}

.legal-doc__markdown code {
    background-color: var(--md-sys-color-surface-container);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.legal-doc__markdown pre {
    background-color: var(--md-sys-color-surface-container);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.legal-doc__markdown pre code {
    background: transparent;
    padding: 0;
}

.legal-doc__markdown blockquote {
    border-left: 4px solid var(--md-sys-color-primary);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--md-sys-color-on-surface-variant);
}

.legal-doc__markdown table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.legal-doc__markdown th,
.legal-doc__markdown td {
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 8px 12px;
    text-align: left;
}

.legal-doc__markdown th {
    background-color: var(--md-sys-color-surface-container);
    font-weight: 500;
}

.legal-doc__markdown hr {
    border: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin: 24px 0;
}

.legal-doc__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.legal-doc__error-text {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-error);
    margin-bottom: 16px;
    text-align: center;
    max-width: 300px;
}

.legal-doc__retry-btn {
    padding: 0 16px;
    height: 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.legal-doc__retry-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

@media (max-width: 768px) {
    .modal--legal-doc {
        max-height: 75dvh;
        max-height: 75vh;
    }

    .legal-doc__content {
        padding: 0 16px 16px;
    }
}

@media (max-width: 480px) {
    .modal--legal-doc {

        max-height: 75vh;
        padding: 0;
    }

    .modal--legal-doc .modal__title {
        padding: 0 16px;
    }

    .legal-doc__content {
        padding: 0 16px 16px;
    }
}

/* ============================================
   File Upload Styles
   ============================================ */

.gen-wizard__file-section {
    margin-bottom: 16px;
}

.main-file-section {
    margin-top: 16px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.input-card__actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 0;
    position: relative;
}

.input-card__actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (min-width: 769px) {
    .main-file-list-wrapper {
        position: relative;
        width: 280px;
        flex-shrink: 0;
    }
}

.input-card__actions-row .main-file-list {
    width: 100%;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0;
    margin-bottom: 0;
    height: 36px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-lowest);
    overflow: hidden;
    box-sizing: border-box;
}

.input-card__actions-row .main-file-list:not(:empty) {
    display: flex;
}

.input-card__actions-row .main-upload-btn {
    flex-shrink: 0;
    padding: 0 12px;
    height: 36px;
    font-size: 12px;
}

.input-card__actions-row .main-upload-btn .material-symbols-outlined {
    font-size: 18px;
}

.main-file-list__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    height: 100%;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-icon {
    font-size: 18px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    line-height: 1;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-size,
.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-status {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.2;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
    padding: 0;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-delete .material-symbols-outlined {
    font-size: 16px;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Hide file list when empty */
.input-card__actions-row .main-file-list:empty {
    display: none;
}

/* Hide +N count when not displayed */
.main-file-more-count:empty,
.main-file-more-count[style*="display: none"] {
    display: none !important;
}

/* Hide expand button when not displayed */
.main-file-expand-btn:empty,
.main-file-expand-btn[style*="display: none"] {
    display: none !important;
}

.main-file-more-count {
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-delete .material-symbols-outlined {
    font-size: 16px;
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.input-card__actions-row .main-file-list .main-file-list__item .main-wizard__file-spinner {
    flex-shrink: 0;
}

.main-file-more-count {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 11px;
    font-weight: 500;
    cursor: default;
}

.main-file-expand-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}

.main-file-expand-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

.main-file-expand-btn .material-symbols-outlined {
    font-size: 20px;
}

.main-file-popup {
    display: none;
    position: absolute;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 18px;
    box-sizing: border-box;
}

.main-file-popup--open {
    display: block;
}

.main-file-popup__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    height: 36px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.main-file-popup__item .main-wizard__file-icon {
    font-size: 18px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    line-height: 1;
}

.main-file-popup__item .main-wizard__file-icon--success {
    color: var(--md-sys-color-primary);
}

.main-file-popup__item .main-wizard__file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}

.main-file-popup__item .main-wizard__file-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
}

.main-file-popup__item .main-wizard__file-size,
.main-file-popup__item .main-wizard__file-status {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.2;
}

.main-file-popup__item .main-wizard__file-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
    padding: 0;
}

.main-file-popup__item .main-wizard__file-delete .material-symbols-outlined {
    font-size: 16px;
}

.main-file-popup__item .main-wizard__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.main-file-popup__item .main-wizard__file-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.main-file-popup__item:last-child {
    margin-bottom: 0;
}

.input-card__actions-row .generate-button {
    flex-shrink: 0;
    height: 36px;
    margin-top: 0;
    padding: 0 20px;
}

.input-card__actions-row .generate-button__text {
    font-size: 12px;
}

.input-card__actions-row .generate-button__icon {
    font-size: 14px;
}

.main-file-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.main-file-section__title .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

.main-file-section__desc {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
    line-height: 1.5;
}

.main-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.main-wizard__file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 12px 14px;
}

.main-wizard__file-icon {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.main-wizard__file-icon--success {
    color: var(--md-sys-color-primary);
}

.main-wizard__file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-wizard__file-name {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-wizard__file-size,
.main-wizard__file-status {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.main-wizard__file-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-wizard__file-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.main-wizard__file-delete .material-symbols-outlined {
    font-size: 20px;
}

.main-wizard__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.main-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    height: 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    transition: background-color 0.2s;
}

.main-upload-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

.main-upload-btn .material-symbols-outlined {
    font-size: 20px;
}

@media (prefers-color-scheme: dark) {
    .main-wizard__file-delete:hover {
        background-color: rgba(255, 180, 171, 0.08);
    }
}

.gen-wizard__file-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.gen-wizard__file-section-title .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

.gen-wizard__file-section-desc {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
    line-height: 1.5;
}

.gen-wizard__file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.gen-wizard__file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 12px 14px;
}

.gen-wizard__file-icon {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.gen-wizard__file-icon--success {
    color: var(--md-sys-color-primary);
}

.gen-wizard__file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gen-wizard__file-name {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gen-wizard__file-size,
.gen-wizard__file-status {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.spinner--small {
    width: 18px;
    height: 18px;
    border: 2px solid var(--md-sys-color-outline-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.gen-wizard__upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    height: 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    transition: background-color 0.2s;
}

.gen-wizard__upload-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

.gen-wizard__upload-btn .material-symbols-outlined {
    font-size: 20px;
}

.gen-wizard__file-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.gen-wizard__file-delete .material-symbols-outlined {
    font-size: 20px;
}

.gen-wizard__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

@media (prefers-color-scheme: dark) {
    .gen-wizard__file-delete:hover {
        background-color: rgba(255, 180, 171, 0.08);
    }
}

/* ============================================
   Project Edit Panel Styles
   ============================================ */

.project-edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.32);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-edit-overlay.active {
    display: flex;
    opacity: 1;
}

.project-edit-panel {
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background-color: var(--md-sys-color-surface);
    box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.15), 0 8px 24px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-edit-overlay.active .project-edit-panel {
    transform: translateX(0);
}

.project-edit__header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    flex-shrink: 0;
}

.project-edit__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.2s;
}

.project-edit__close:hover {
    background-color: var(--md-sys-color-surface-container);
}

.project-edit__close .material-symbols-outlined {
    font-size: 24px;
}

.project-edit__title {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
    margin: 0;
    padding-left: 8px;
}

.project-edit__content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Editable Card */
.project-edit__card {
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    overflow: hidden;
}

.project-edit__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.project-edit__card-header:hover {
    background-color: var(--md-sys-color-surface-container);
}

.project-edit__card-title {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
}

.project-edit__card-arrow {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-edit__card-body {
    padding: 0 16px 16px;
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.25s ease;
    opacity: 1;
}

.project-edit__card-body--collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

/* Divider */
.project-edit__divider {
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin-bottom: 16px;
}

/* Input */
.project-edit__input-group {
    margin-bottom: 4px;
}

.project-edit__input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    background-color: var(--md-sys-color-surface-container-lowest);
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    font-family: 'Noto Sans SC', sans-serif;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
    height: 56px;
}

.project-edit__input:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 13px 15px;
}

.project-edit__input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.project-edit__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Setting Row */
.project-edit__setting {
    padding: 4px 0;
}

.project-edit__setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project-edit__setting-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
}

.project-edit__setting-value {
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
    padding: 2px 8px;
    border-radius: 6px;
}

.project-edit__setting-description {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
    display: block;
}

/* Slider */
.project-edit__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--md-sys-color-surface-container);
    outline: none;
    margin: 8px 0;
    cursor: pointer;
}

.project-edit__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
}

.project-edit__slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.project-edit__slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
}

.project-edit__slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.project-edit__slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Switch Row */
.project-edit__setting--switch {
    padding: 8px 0;
}

.project-edit__switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-edit__switch-info {
    flex: 1;
    margin-right: 16px;
}

.project-edit__switch-title {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    display: block;
}

.project-edit__switch-description {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    margin-top: 2px;
}

.project-edit__switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

.project-edit__switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.project-edit__switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-surface-container-highest);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: 16px;
    transition: background-color 0.2s, border-color 0.2s;
}

.project-edit__switch-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 6px;
    bottom: 6px;
    background-color: var(--md-sys-color-outline);
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
}

.project-edit__switch input:checked + .project-edit__switch-slider {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.project-edit__switch input:checked + .project-edit__switch-slider::before {
    transform: translateX(20px);
    background-color: var(--md-sys-color-on-primary);
}

/* Delete Button */
.project-edit__delete-btn {
    width: 100%;
    padding: 0 24px;
    height: 40px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans SC', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    margin-bottom: 16px;
}

.project-edit__delete-btn:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    filter: brightness(0.95);
}

.project-edit__delete-btn:active {
    filter: brightness(0.9);
}

/* ============================================
   Sidebar Context Menu Styles
   ============================================ */

.sidebar-context-menu {
    position: fixed;
    background-color: var(--md-sys-color-surface-container);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 8px 0;
    z-index: 300;
    min-width: 180px;
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar-context-menu.visible {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.sidebar-context-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.15s;
}

.sidebar-context-menu__item:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.sidebar-context-menu__item .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

.sidebar-context-menu__item--danger {
    color: var(--md-sys-color-error);
}

.sidebar-context-menu__item--danger .material-symbols-outlined {
    color: var(--md-sys-color-error);
}

.sidebar-context-menu__separator {
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 4px 0;
}

/* ============================================
   Sidebar Edit Button Styles
   ============================================ */

.sidebar__project-card__main {
    flex: 1;
    min-width: 0;
}

.sidebar__project-card__edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.sidebar__project-card__edit-btn .material-symbols-outlined {
    font-size: 18px;
}

.sidebar__project-card:hover .sidebar__project-card__edit-btn {
    opacity: 1;
}

.sidebar__project-card__edit-btn:hover {
    background-color: var(--md-sys-color-surface-container);
}

/* ============================================
   Project Edit Panel Responsive
   ============================================ */

@media (max-width: 480px) {
    .project-edit-panel {
        width: 100%;
    }
}

/* ============================================
   Default Page Styles
   ============================================ */

.default-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* ============================================
   Project Editor Container
   ============================================ */

.project-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.project-editor__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   Editor Cards
   ============================================ */

.editor-card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 200ms;
}

.editor-card:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.editor-card--low {
    background-color: var(--md-sys-color-surface-container-low);
}

.editor-card__header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.editor-card__title {
    flex: 1;
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
}

.editor-card__arrow {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.editor-card__header.is-collapsed .editor-card__arrow {
    transform: rotate(-90deg);
}

.editor-card__body {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 250ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    padding: 0 20px 20px;
}

.editor-card__body.is-collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
}

.editor-card__divider {
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin-bottom: 12px;
}

/* ============================================
   Editor Input
   ============================================ */

.editor-input-group {
    margin-top: 12px;
}

.editor-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 16px;
    background-color: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    font: var(--md-sys-typescale-body-medium);
    resize: vertical;
    transition: border-color 200ms;
    font-family: 'Noto Sans SC', sans-serif;
}

.editor-textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

/* ============================================
   Editor Slider
   ============================================ */

.editor-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: 2px;
    outline: none;
    margin: 8px 0;
}

.editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.editor-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Editor Settings
   ============================================ */

.editor-setting {
    padding: 8px 0;
}

.editor-setting__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.editor-setting__text {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.editor-setting__value {
    font: var(--md-sys-typescale-label-medium);
    color: var(--md-sys-color-primary);
}

.editor-setting__desc {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    margin-top: 2px;
}

.editor-temp-warning {
    font-size: 11px;
    display: block;
    margin-top: 4px;
    white-space: nowrap;
}

.editor-temp-warning--danger {
    color: var(--md-sys-color-error);
}

.editor-temp-warning--caution {
    color: #E65100;
}

/* ============================================
   Editor Buttons
   ============================================ */

.editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    border-radius: 24px;
    font: var(--md-sys-typescale-label-large);
    font-size: 16px;
    cursor: pointer;
    transition: background-color 200ms, box-shadow 200ms;
    border: none;
    width: 100%;
    font-family: 'Noto Sans SC', sans-serif;
    margin-top: 16px;
    margin-bottom: 16px;
}

.editor-btn--primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.editor-btn--primary:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.editor-btn--outlined {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.editor-btn--outlined:hover {
    background-color: var(--md-sys-color-primary-container);
}

.editor-btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
}

.editor-btn--icon:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.editor-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editor-btn .material-symbols-outlined {
    font-size: 20px;
}

/* ============================================
   Editor Attachments
   ============================================ */

.editor-attachments__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.editor-attachment-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    gap: 12px;
}

.editor-attachment-item__icon {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

.editor-attachment-item__info {
    flex: 1;
    min-width: 0;
}

.editor-attachment-item__name {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-attachment-item__status {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.editor-attachment-item__delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-attachment-item__delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.editor-attachments__add {
    margin-top: 12px;
}

.editor-attachments__add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px dashed var(--md-sys-color-outline);
    border-radius: 12px;
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font: var(--md-sys-typescale-body-medium);
    width: 100%;
    justify-content: center;
    font-family: 'Noto Sans SC', sans-serif;
}

.editor-attachments__add-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

/* ============================================
   Editor Reasoning & Result
   ============================================ */

.editor-reasoning {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 40px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

.editor-result {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.8;
    word-break: break-word;
    min-height: 40px;
    max-height: 600px;
    overflow-y: auto;
    margin-top: 12px;
    user-select: text;
}

.editor-result h1 {
    font: var(--md-sys-typescale-headline-small);
    color: var(--md-sys-color-on-surface);
    margin-top: 24px;
    margin-bottom: 12px;
}

.editor-result h2 {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
    margin-top: 20px;
    margin-bottom: 10px;
}

.editor-result h3 {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
    margin-top: 16px;
    margin-bottom: 8px;
}

.editor-result p {
    margin-bottom: 12px;
}

.editor-result ul,
.editor-result ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.editor-result li {
    margin-bottom: 6px;
}

.editor-result a {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
}

.editor-result code {
    background-color: var(--md-sys-color-surface-container);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.editor-result pre {
    background-color: var(--md-sys-color-surface-container);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.editor-result pre code {
    background: transparent;
    padding: 0;
}

.editor-result blockquote {
    border-left: 4px solid var(--md-sys-color-primary);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--md-sys-color-on-surface-variant);
}

.editor-result table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.editor-result th,
.editor-result td {
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 8px 12px;
    text-align: left;
}

.editor-result th {
    background-color: var(--md-sys-color-surface-container);
    font-weight: 500;
}

.editor-result hr {
    border: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin: 20px 0;
}

/* ============================================
   Editor References
   ============================================ */

.editor-references__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.editor-reference-item {
    padding: 12px 14px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    cursor: pointer;
    transition: background-color 200ms;
}

.editor-reference-item:hover {
    background-color: var(--md-sys-color-surface-container-low);
}

.editor-reference-item__title {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.editor-reference-item__meta {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.editor-reference-item__detail {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}

.editor-reference-item.is-expanded .editor-reference-item__detail {
    display: block;
}

/* ============================================
   Editor Export
   ============================================ */

.editor-export__label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    margin-top: 16px;
}

.editor-export__colors {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.editor-export__color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 200ms, transform 200ms;
}

.editor-export__color-btn:hover {
    transform: scale(1.1);
}

.editor-export__color-btn.is-selected {
    border-color: var(--md-sys-color-on-surface);
}

.editor-export__chip-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.editor-chip {
    padding: 6px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font: var(--md-sys-typescale-body-medium);
    transition: background-color 200ms, border-color 200ms;
    font-family: 'Noto Sans SC', sans-serif;
}

.editor-chip:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.editor-chip--selected {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: var(--md-sys-color-secondary-container);
}

.editor-export__switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    gap: 16px;
}

.editor-export__switch-title {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    display: block;
}

.editor-export__switch-desc {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    margin-top: 2px;
}

.editor-export__actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.editor-export__actions .editor-btn {
    flex: 1;
}

/* ============================================
   Editor Switch
   ============================================ */

.editor-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

.editor-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.editor-switch__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: 16px;
    transition: background-color 200ms;
}

.editor-switch__slider::before {
    content: "";
    position: absolute;
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: var(--md-sys-color-outline);
    border-radius: 50%;
    transition: transform 200ms, background-color 200ms;
}

.editor-switch input:checked + .editor-switch__slider {
    background-color: var(--md-sys-color-primary);
}

.editor-switch input:checked + .editor-switch__slider::before {
    transform: translateX(20px);
    background-color: var(--md-sys-color-on-primary);
}

/* ============================================
   Editor Footer
   ============================================ */

.editor-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--md-sys-color-surface);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    gap: 12px;
}

.editor-footer__edit,
.editor-footer__back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font: var(--md-sys-typescale-body-medium);
    font-family: 'Noto Sans SC', sans-serif;
}

.editor-footer__edit:hover,
.editor-footer__back:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.editor-footer__edit .material-symbols-outlined,
.editor-footer__back .material-symbols-outlined {
    font-size: 18px;
}

/* ============================================
   Reference Generation Container
   ============================================ */

.editor-ref-gen__container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.ref-gen-record {
    padding: 8px 12px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border-radius: 8px;
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.ref-gen-record--loading {
    color: var(--md-sys-color-primary);
}

.ref-gen-record--success {
    color: var(--md-sys-color-on-surface);
}

.ref-gen-record--error {
    color: var(--md-sys-color-error);
}

/* ============================================
   Footer Download Link Styles
   ============================================ */

.footer__download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: color 0.2s;
}

.footer__download-link:hover {
    color: var(--md-sys-color-primary);
}

.footer__download-icon {
    font-size: 18px;
}

/* ============================================
   Mobile Download Banner Styles
   ============================================ */

.mobile-download-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--md-sys-color-primary-container);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.mobile-download-banner--visible {
    transform: translateY(0);
    opacity: 1;
}

.mobile-download-banner__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.mobile-download-banner__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.mobile-download-banner__icon .material-symbols-outlined {
    font-size: 28px;
    color: var(--md-sys-color-on-primary);
}

.mobile-download-banner__text {
    flex: 1;
    min-width: 0;
}

.mobile-download-banner__title {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-primary-container);
    margin: 0 0 4px 0;
}

.mobile-download-banner__subtitle {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-primary-container);
    opacity: 0.8;
    margin: 0;
}

.mobile-download-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-download-banner__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-extra-large);
    border: none;
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

.mobile-download-banner__btn:active {
    transform: scale(0.98);
}

.mobile-download-banner__btn--primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.mobile-download-banner__btn--primary:hover {
    background-color: var(--md-sys-color-primary-fixed);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-download-banner__btn--close {
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: transparent;
    color: var(--md-sys-color-on-primary-container);
    border-radius: 50%;
}

.mobile-download-banner__btn--close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-download-banner__btn--close .material-symbols-outlined {
    font-size: 20px;
}

.mobile-download-banner__btn--text {
    padding: 0 16px;
    height: 36px;
    background-color: transparent;
    color: var(--md-sys-color-on-primary-container);
    opacity: 0.8;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--md-sys-shape-corner-extra-large);
}

.mobile-download-banner__btn--text:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .mobile-download-banner__content {
        padding: 10px 12px;
        gap: 12px;
    }

    .mobile-download-banner__icon {
        width: 40px;
        height: 40px;
    }

    .mobile-download-banner__icon .material-symbols-outlined {
        font-size: 24px;
    }

    .mobile-download-banner__btn {
        height: 36px;
        padding: 0 16px;
        font-size: 12px;
    }
}

/* LowerAIGCWizard 样式 */

.lower-aigc-wizard__upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    border: 2px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-low);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    margin-bottom: 16px;
}

.lower-aigc-wizard__upload-area.is-drag-over {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.lower-aigc-wizard__upload-icon {
    font-size: 48px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
}

.lower-aigc-wizard__upload-text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 4px 0;
}

.lower-aigc-wizard__upload-hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.lower-aigc-wizard__file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    margin-bottom: 16px;
}

.lower-aigc-wizard__file-info .material-symbols-outlined {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
}

.lower-aigc-wizard__file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lower-aigc-wizard__file-name {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lower-aigc-wizard__file-size {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
}

.lower-aigc-wizard__file-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    transition: background-color 0.2s, color 0.2s;
}

.lower-aigc-wizard__file-delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.lower-aigc-wizard__file-delete .material-symbols-outlined {
    font-size: 20px;
}

.lower-aigc-wizard__params {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.lower-aigc-wizard__param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lower-aigc-wizard__param-label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    flex-shrink: 0;
}

.lower-aigc-wizard__param-select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    background-color: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lower-aigc-wizard__param-select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.lower-aigc-wizard__param-desc {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
    line-height: 1.5;
}

.lower-aigc-wizard__summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0 20px;
}

.lower-aigc-wizard__summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-large);
}

.lower-aigc-wizard__summary-label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.lower-aigc-wizard__summary-value {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    font-weight: 500;
}

/* 项目类型标签样式 */
.sidebar__project-card__type {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 6px;
    font: var(--md-sys-typescale-label-large);
    font-size: 10px;
    line-height: 1.4;
}

.sidebar__tag--article {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.sidebar__tag--aigc {
    background-color: #00bcd4;
    color: #ffffff;
}

/* 配额详情模态框样式 */
.modal--quota-detail {
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
}

.modal--quota-detail .modal__title {
    padding: 24px 24px 0;
    margin-bottom: 16px;
}

.quota-detail-content {
    padding: 0 24px 24px;
}

.quota-detail-section {
    margin-bottom: 24px;
}

.quota-detail-section:last-child {
    margin-bottom: 0;
}

.quota-detail-section-title {
    font: var(--md-sys-typescale-title-medium);
    color: var(--md-sys-color-on-surface);
    font-size: 16px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.quota-detail-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.quota-detail-row:last-child {
    margin-bottom: 0;
}

.quota-detail-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quota-detail-label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
}

.quota-detail-text {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
}

.quota-detail-bar {
    width: 100%;
    height: 8px;
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: 4px;
    overflow: hidden;
}

.quota-detail-fill {
    height: 100%;
    width: 0%;
    background-color: var(--md-sys-color-primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Tab 样式 */
.quota-detail-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.quota-detail-tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    font: var(--md-sys-typescale-label-large);
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.quota-detail-tab:hover {
    color: var(--md-sys-color-primary);
}

.quota-detail-tab--active {
    color: var(--md-sys-color-primary);
}

.quota-detail-tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--md-sys-color-primary);
}

/* 资源包列表样式 */
.quota-detail-list-container {
    min-height: 100px;
}

.quota-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quota-detail-rp-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
}

.quota-detail-rp-item--gray {
    opacity: 0.5;
}

.quota-detail-rp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quota-detail-rp-name {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    font-weight: 500;
    font-size: 14px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quota-detail-rp-source {
    font: var(--md-sys-typescale-label-medium);
    color: var(--md-sys-color-primary);
    font-size: 11px;
    padding: 2px 8px;
    background-color: var(--md-sys-color-primary-container);
    border-radius: 8px;
    white-space: nowrap;
}

.quota-detail-rp-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quota-detail-rp-section-title {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
}

.quota-detail-rp-bar {
    width: 100%;
    height: 4px;
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: 2px;
    overflow: hidden;
}

.quota-detail-rp-fill {
    height: 100%;
    width: 0%;
    background-color: var(--md-sys-color-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.quota-detail-rp-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quota-detail-rp-meta-item {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 11px;
}

.quota-detail-rp-meta-label {
    color: var(--md-sys-color-on-surface-variant);
}

.quota-detail-rp-meta-value {
    color: var(--md-sys-color-on-surface);
}

/* 空状态样式 */
.quota-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--md-sys-color-on-surface-variant);
}

.quota-detail-empty-icon {
    font-size: 48px;
    color: var(--md-sys-color-outline);
    margin-bottom: 8px;
}

.quota-detail-empty p {
    font: var(--md-sys-typescale-body-medium);
    margin: 0;
}

.quota-detail-invite-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.quota-detail-invite-btn:hover {
    opacity: 0.9;
}

.quota-detail-invite-btn .material-symbols-outlined {
    font-size: 16px;
}
    .mobile-download-banner__content {
        padding: 10px 12px;
        gap: 12px;
    }

    .mobile-download-banner__icon {
        width: 40px;
        height: 40px;
    }

    .mobile-download-banner__icon .material-symbols-outlined {
        font-size: 24px;
    }

    .mobile-download-banner__title {
        font: var(--md-sys-typescale-label-large);
    }

    .mobile-download-banner__subtitle {
        font: var(--md-sys-typescale-label-small);
    }

    .mobile-download-banner__btn {
        padding: 0 16px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .mobile-download-banner__content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-download-banner__text {
        flex-basis: calc(100% - 64px);
    }

    .mobile-download-banner__actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   Nav Button Download Styles
   ============================================ */

.nav-button--download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 36px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.nav-button--download:hover {
    background-color: var(--md-sys-color-primary-container);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.nav-button--download:active {
    transform: scale(0.98);
}

.nav-button--download .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 768px) {
    .nav-button--download span:last-child {
        display: none;
    }

    .nav-button--download {
        padding: 0 10px;
        width: 36px;
        justify-content: center;
    }
}

/* ============================================
   WeChat Tip Modal Styles
   ============================================ */

.modal--wechat-tip {
    max-width: 360px;
}

.wechat-tip__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 32px;
    text-align: center;
}

.wechat-tip__icon {
    font-size: 64px;
    color: var(--md-sys-color-primary);
    margin-bottom: 20px;
}

.wechat-tip__title {
    font: var(--md-sys-typescale-headline-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
}

.wechat-tip__text {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
}

.wechat-tip__arrow-container {
    font-size: 48px;
    line-height: 1;
    color: var(--md-sys-color-primary);
    margin: 12px 0;
    animation: wechat-tip-arrow-bounce 1.5s ease-in-out infinite;
}

.wechat-tip__arrow {
    display: inline-block;
}

@keyframes wechat-tip-arrow-bounce {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(12px, -12px);
    }
}

.wechat-tip__action {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 8px;
}

.wechat-tip__highlight {
    color: var(--md-sys-color-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .wechat-tip__content {
        padding: 32px 20px 24px;
    }

    .wechat-tip__icon {
        font-size: 56px;
    }

    .wechat-tip__title {
        font-size: 20px;
    }

    .wechat-tip__arrow-container {
        font-size: 40px;
    }
}

/* ============================================
   Queue Progress Styles
   ============================================ */

.editor-queue-progress {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
    background-color: var(--md-sys-color-surface-container-low);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.editor-queue-progress__label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
    margin: 0 0 4px 0;
}

.editor-queue-progress__position-value {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    display: block;
    margin: 8px 0;
    color: var(--md-sys-color-primary);
    line-height: 1.2;
}

.editor-queue-progress__hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
    margin: 12px 0 16px 0;
}

.editor-queue-progress .editor-btn {
    margin-bottom: 0;
}

/* ============================================
   QR Code Download Modal Styles
   ============================================ */

.modal--qr-download {
    max-width: 420px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qr-download__subtitle {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin: 8px 0 24px 0;
}

.qr-download__content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.qr-code-wrapper {
    position: relative;
    width: 256px;
    height: 256px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrCodeCanvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
}

.qr-code-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
}

.qr-code-loading p {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.qr-code-hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.qr-download__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.qr-download__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 32px;
    height: 48px;
    border-radius: var(--md-sys-shape-corner-extra-large);
    border: none;
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 200px;
}

.qr-download__btn--primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.qr-download__btn--primary:hover {
    background-color: var(--md-sys-color-primary-fixed);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.qr-download__btn--primary:active {
    transform: translateY(0) scale(0.98);
}

.qr-download__btn .material-symbols-outlined {
    font-size: 20px;
}

.qr-download__hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

@media (max-width: 480px) {
    .modal--qr-download {
        max-width: 95%;
        width: 100%;
    }

    .qr-code-wrapper {
        width: 220px;
        height: 220px;
        padding: 12px;
    }

    .qr-download__btn {
        width: 100%;
        min-width: auto;
    }
}

/* ============================================
   AIGC Section Styles
   ============================================ */

.sidebar__aigc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 8px;
    padding: 0 16px;
    height: 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.sidebar__aigc-btn:hover {
    background-color: var(--md-sys-color-primary-container);
}

.sidebar__aigc-btn .material-symbols-outlined {
    font-size: 16px;
}

.modal--aigc {
    max-width: 480px;
}

.aigc-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    border: 2px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    background-color: var(--md-sys-color-surface-container-low);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    margin-bottom: 16px;
}

.aigc-upload-area:hover,
.aigc-upload-area--dragover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.aigc-upload-area__icon {
    font-size: 48px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
}

.aigc-upload-area__text {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 4px 0;
}

.aigc-upload-area__hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.aigc-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-large);
    margin-bottom: 16px;
}

.aigc-file-info .material-symbols-outlined {
    font-size: 24px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.aigc-file-info__name {
    flex: 1;
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aigc-file-info__delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.aigc-file-info__delete:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.aigc-file-info__delete .material-symbols-outlined {
    font-size: 20px;
}

.aigc-params {
    margin-bottom: 16px;
}

.aigc-params__title {
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 12px 0;
}

.aigc-params__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.aigc-params__label {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.aigc-params__select {
    padding: 8px 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    background-color: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    font: var(--md-sys-typescale-body-medium);
    font-family: 'Noto Sans SC', sans-serif;
    cursor: pointer;
    outline: none;
}

.aigc-params__select:focus {
    border-color: var(--md-sys-color-primary);
}

.modal--aigc .modal__submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal--aigc .modal__submit-btn .material-symbols-outlined {
    font-size: 20px;
}

.modal--aigc .modal__submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* AIGC Status Modal */
.modal--aigc-status {
    max-width: 480px;
}

.aigc-status-content {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.aigc-status__loading,
.aigc-status__queue,
.aigc-status__processing,
.aigc-status__completed,
.aigc-status__failed,
.aigc-status__cancelled {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0;
    width: 100%;
}

.aigc-status__queue {
    gap: 8px;
}

.aigc-status__text {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin: 8px 0 0 0;
}

.aigc-status__text--error {
    color: var(--md-sys-color-error);
}

.aigc-status__hint {
    font: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    margin: 4px 0 0 0;
}

.aigc-status__position-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    line-height: 1.2;
}

.aigc-status__success-icon {
    font-size: 48px;
    color: var(--md-sys-color-primary);
    margin-bottom: 12px;
}

.aigc-status__error-icon {
    font-size: 48px;
    color: var(--md-sys-color-error);
    margin-bottom: 12px;
}

.aigc-status__cancel-icon {
    font-size: 48px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
}

.aigc-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.aigc-progress-bar__fill {
    height: 100%;
    background-color: var(--md-sys-color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.aigc-status__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.aigc-status__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-extra-large);
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.aigc-status__btn--primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
}

.aigc-status__btn--primary:hover {
    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.aigc-status__btn--outlined {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.aigc-status__btn--outlined:hover {
    background-color: var(--md-sys-color-primary-container);
}

.aigc-status__btn .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 480px) {
    .modal--aigc,
    .modal--aigc-status {
        max-width: 100%;
    }

    .aigc-upload-area {
        padding: 24px 16px;
    }

    .aigc-upload-area__icon {
        font-size: 40px;
    }

    .aigc-status__actions {
        flex-direction: column;
    }

    .aigc-status__btn {
        width: 100%;
    }
}

/* ============================================
   AIGC Comparison Card
   ============================================ */

.aigc-comparison-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.aigc-comparison-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.aigc-comparison-panel-title {
    flex: 1;
    font: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface);
    text-align: center;
}

.aigc-comparison-fullscreen-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.aigc-comparison-fullscreen-btn:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.aigc-comparison-fullscreen-btn .material-symbols-outlined {
    font-size: 22px;
}

.aigc-comparison-divider {
    width: 1px;
    height: 20px;
    background-color: var(--md-sys-color-outline-variant);
}

.aigc-comparison-content {
    min-height: 100px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.aigc-fullscreen-body .aigc-comparison-content {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.aigc-comparison-placeholder {
    text-align: center;
    color: #999;
    padding: 32px 16px;
    font-size: 14px;
}

.aigc-info-disclaimer {
    margin-top: 12px;
    padding: 8px 12px;
    background-color: #fff8e1;
    border-left: 3px solid #ffa000;
    border-radius: 4px;
    font-size: 12px;
    color: #5d4037;
    line-height: 1.5;
}

.aigc-paragraph-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    align-items: flex-start;
}

.aigc-paragraph-row:last-child {
    border-bottom: none;
}

.aigc-para-column {
    flex: 1;
    min-width: 0;
}

.aigc-para-original,
.aigc-para-rewritten {
    padding: 12px;
    background-color: var(--md-sys-color-surface-container-lowest);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: none;
    overflow-y: visible;
}

.aigc-para-divider {
    width: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 0 4px;
    flex-shrink: 0;
}

.aigc-para-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
    padding: 24px;
}

.aigc-para-loading .material-symbols-outlined {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fullscreen comparison overlay */
.aigc-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-surface);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aigc-fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface-container);
}

.aigc-fullscreen-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.aigc-fullscreen-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.aigc-fullscreen-close:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.aigc-fullscreen-close .material-symbols-outlined {
    font-size: 24px;
}

.aigc-fullscreen-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.aigc-fullscreen-body .aigc-comparison-header-row {
    margin-bottom: 16px;
}

.aigc-fullscreen-body .aigc-paragraph-row {
    padding: 16px 0;
}

.aigc-fullscreen-body .aigc-para-original,
.aigc-fullscreen-body .aigc-para-rewritten {
    font-size: 14px;
    padding: 16px;
}

.aigc-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.aigc-status-indicator .material-symbols-outlined {
    font-size: 20px;
}

.aigc-status-indicator--queued { color: #f59e0b; }
.aigc-status-indicator--processing { color: #1b6b4a; }
.aigc-status-indicator--completed { color: #1b6b4a; }
.aigc-status-indicator--failed { color: #c62828; }
.aigc-status-indicator--cancelled { color: #999; }

@media (max-width: 768px) {
    .aigc-paragraph-row {
        flex-direction: column;
    }
    .aigc-para-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }
    .aigc-comparison-header-row {
        flex-direction: column;
        gap: 8px;
    }
    .aigc-comparison-divider {
        width: 40px;
        height: 1px;
    }
}
