:root {
    --primary-gradient: linear-gradient(135deg, #7F56D9 0%, #6172F3 50%, #4754F0 100%);
    --accent-pink: #FF6B8B;
    --accent-purple: #9E00FF;
    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(243, 241, 255, 1) 0%, rgba(244, 246, 255, 1) 90%);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.5);
    --text-dark: #1D2939;
    --text-dark-contrast: #1A1A1A;
    --text-light: #667085;
    --neon-glow: 0 0 20px rgba(127, 86, 217, 0.25);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 12px 30px rgba(127, 86, 217, 0.06);
    --shadow-lg: 0 20px 50px rgba(127, 86, 217, 0.12);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --input-border-focus: #FF6B8B;
    --input-focus-shadow: rgba(255, 107, 139, 0.2);
}

/* 芭比公主粉主题 🎀 */
body[data-theme="pink"] {
    --bg-gradient: radial-gradient(circle at 12% 18%, #FFF0F5 0%, #FFE4E1 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 182, 193, 0.65);
    --text-dark: #1E040C;
    --text-dark-contrast: #1C050D;
    --text-light: #8B4F60;
    --primary-gradient: linear-gradient(135deg, #FF6B8B 0%, #FF8E9F 50%, #F48FB1 100%);
    --neon-glow: 0 0 20px rgba(255, 107, 139, 0.35);
    --shadow-md: 0 12px 30px rgba(255, 107, 139, 0.08);
    --shadow-lg: 0 20px 50px rgba(255, 107, 139, 0.15);
    --input-border-focus: #FF6B8B;
    --input-focus-shadow: rgba(255, 107, 139, 0.35);
}

/* 赛博酷暗黑哥特 🖤 */
body[data-theme="gothic"] {
    --bg-gradient: radial-gradient(circle at 50% 50%, #0F0C1B 0%, #05020A 100%);
    --card-bg: rgba(20, 15, 30, 0.85);
    --card-border: rgba(158, 0, 255, 0.25);
    --text-dark: #F3F1FF;
    --text-dark-contrast: #FFFFFF;
    --text-light: #9E95BF;
    --primary-gradient: linear-gradient(135deg, #9E00FF 0%, #E000FF 100%);
    --neon-glow: 0 0 20px rgba(158, 0, 255, 0.5);
    --shadow-md: 0 12px 30px rgba(158, 0, 255, 0.12);
    --shadow-lg: 0 20px 50px rgba(158, 0, 255, 0.2);
    --input-border-focus: #9E00FF;
    --input-focus-shadow: rgba(158, 0, 255, 0.4);
}

body.fonts-page {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', -apple-system, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-dark);
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.3s ease;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #F4F6FF;
}
::-webkit-scrollbar-thumb {
    background: #D0D5DD;
    border-radius: 10px;
    border: 2px solid #F4F6FF;
}
::-webkit-scrollbar-thumb:hover {
    background: #98A2B3;
}

.fonts-page .logo {
    font-family: 'Outfit', sans-serif;
    transition: transform 0.3s ease;
}

.fonts-page .logo:hover {
    transform: scale(1.02);
}

.logo-symbol {
    animation: pulse-glow 2.5s infinite alternate;
}

@keyframes pulse-glow {
    0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.15) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 8px rgba(127, 86, 217, 0.6)); }
    100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
}

.fonts-page .hero::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(127, 86, 217, 0.15) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    filter: blur(30px);
}

/* Control Panel Card */
.control-panel {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.control-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--primary-gradient);
}

/* Input Group */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-btn {
    background: transparent;
    border: none;
    color: #7F56D9;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.25s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
}

.clear-btn:hover {
    background: rgba(127, 86, 217, 0.08);
    transform: scale(1.03);
}

.text-input-wrapper {
    position: relative;
}

.text-input {
    width: 100%;
    padding: 1.25rem 1.75rem;
    border: 2px solid #E4E7EC;
    border-radius: var(--radius-md);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-dark-contrast, #1A1A1A);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.text-input:focus {
    border-color: var(--input-border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--input-focus-shadow), inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

/* History queries */
.history-section {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: -0.5rem;
}

.history-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-tag {
    background: #F2F4F7;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475467;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.history-tag:hover {
    background: rgba(127, 86, 217, 0.08);
    color: #7F56D9;
    border-color: rgba(127, 86, 217, 0.2);
    transform: translateY(-1px);
}

/* Aesthetic Decorator Section */
.decorator-section {
    border-top: 1px solid #F2F4F7;
    padding-top: 1.5rem;
}

.decorator-header {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.decorator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.decorator-btn {
    background: #ffffff;
    border: 1px solid #E4E7EC;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.decorator-btn:hover {
    border-color: #98A2B3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.decorator-btn.active {
    border-color: transparent;
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(127, 86, 217, 0.3);
}

.decorator-preview {
    opacity: 0.75;
    font-size: 0.8rem;
}

.decorator-btn.active .decorator-preview {
    opacity: 1;
}

/* Grid Sections */
.grid-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.section-sub-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sub-title-tip {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    opacity: 0.85;
    margin-left: 0.4rem;
    letter-spacing: 0px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-transform: none;
}

/* Custom Heart icon for favs */
.section-sub-title .icon-fav {
    color: var(--accent-pink);
    animation: pulse-heart 2s infinite;
}

@keyframes pulse-heart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

/* Favorite Grid Container */
.favorites-wrapper {
    margin-bottom: 3.5rem;
    background: rgba(255, 102, 196, 0.04);
    border: 2px dashed rgba(255, 102, 196, 0.25);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.3s ease;
}

.favorites-wrapper.empty {
    display: none;
}

/* Font Card Grid */
.font-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Enhanced Font Card */
.font-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    cursor: pointer;
}

.font-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(127, 86, 217, 0.04), transparent 40%);
    z-index: 1;
    pointer-events: none;
}

.font-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(127, 86, 217, 0.3);
}

.font-card-top {
    z-index: 2;
}

.font-name-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.font-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.font-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 5;
}

.action-btn.copy-btn {
    background: #ffffff;
    border: 1px solid #E4E7EC;
    padding: 0.25rem 0.55rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475467;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn.copy-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 107, 139, 0.3);
    transform: scale(1.05);
}

/* Dopamine tag / Popular style badge */
.font-badge {
    background: linear-gradient(135deg, #FF6B8B 0%, #F48FB1 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(255, 107, 139, 0.25);
    margin-right: 0.3rem;
    vertical-align: middle;
}

body[data-theme="gothic"] .font-badge {
    background: linear-gradient(135deg, #9E00FF 0%, #E000FF 100%);
    box-shadow: 0 2px 6px rgba(158, 0, 255, 0.4);
}

.action-icon-btn {
    background: #ffffff;
    border: 1px solid #F2F4F7;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-light);
    font-size: 0.85rem;
}

.action-icon-btn:hover {
    color: var(--text-dark);
    border-color: #D0D5DD;
    transform: scale(1.08);
}

.action-icon-btn.fav-btn.is-active {
    color: var(--accent-pink);
    border-color: rgba(255, 102, 196, 0.2);
    background: rgba(255, 102, 196, 0.1);
}

.font-preview-area {
    font-size: 1.4rem;
    color: var(--text-dark);
    word-break: break-all;
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    line-height: 1.3;
    padding-right: 0.5rem;
}

/* Success Status Copied */
.font-card.just-copied {
    animation: card-success-pop 0.4s ease;
    border-color: #32D583;
}

@keyframes card-success-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.toast-icon {
    color: #32D583;
    font-size: 1.2rem;
}

/* SEO Rich Content Section */
.seo-content {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 4.5rem;
}

.seo-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.seo-content p {
    font-size: 1.05rem;
    color: #475467;
    margin-bottom: 2rem;
    line-height: 1.75;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.seo-grid h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seo-grid p {
    font-size: 0.95rem;
    color: #667085;
    margin-bottom: 0;
    line-height: 1.6;
}

.faq-section {
    margin-top: 3.5rem;
    border-top: 1px solid #EAECF0;
    padding-top: 3rem;
}

.faq-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

details {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid #EAECF0;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

details[open] {
    background: #ffffff;
    border-color: #D0D5DD;
    box-shadow: var(--shadow-sm);
}

summary {
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '＋';
    font-weight: 800;
    color: #7F56D9;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

details[open] summary::after {
    content: '－';
    transform: rotate(180deg);
}

details p {
    margin-top: 1rem;
    color: #475467;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Theme Switcher Styles */
.theme-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(228, 231, 236, 0.6);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

body[data-theme="pink"] .theme-row {
    border-bottom-color: rgba(255, 182, 193, 0.4);
}

body[data-theme="gothic"] .theme-row {
    border-bottom-color: rgba(158, 0, 255, 0.2);
}

.theme-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.theme-switcher {
    display: flex;
    background: rgba(242, 244, 247, 0.8);
    padding: 0.3rem;
    border-radius: 50px;
    border: 1px solid rgba(208, 213, 221, 0.5);
    gap: 0.2rem;
}

body[data-theme="pink"] .theme-switcher {
    background: rgba(255, 240, 245, 0.9);
    border-color: rgba(255, 182, 193, 0.6);
}

body[data-theme="gothic"] .theme-switcher {
    background: rgba(20, 15, 30, 0.9);
    border-color: rgba(158, 0, 255, 0.3);
}

.theme-btn {
    background: transparent;
    border: none;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.theme-btn:hover {
    color: var(--text-dark);
}

.theme-btn.active {
    background: #ffffff;
    color: #7F56D9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body[data-theme="pink"] .theme-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 107, 139, 0.25);
}

body[data-theme="gothic"] .theme-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--neon-glow);
}

@media (max-width: 768px) {
    .theme-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-bottom: 0.8rem;
    }
    .theme-switcher {
        width: 100%;
        justify-content: space-between;
    }
    .theme-btn {
        flex: 1;
        justify-content: center;
        padding: 0.4rem 0.5rem;
        font-size: 0.78rem;
    }
}

/* Responsive UI fixes */
@media (max-width: 992px) {
    .control-panel {
        padding: 1.8rem;
    }
}

@media (max-width: 768px) {
    .control-panel {
        padding: 1rem;
        gap: 1rem;
        border-radius: var(--radius-sm);
        margin-bottom: 1.5rem;
    }

    /* Enter your text here input label & clear button */
    .input-label {
        font-size: 0.9rem;
    }

    .clear-btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .text-input {
        padding: 0.8rem 1rem;
        font-size: 1.05rem;
        border-radius: var(--radius-sm);
    }

    /* History recent sections */
    .history-section {
        gap: 0.5rem;
        margin-top: -0.2rem;
    }

    .history-title {
        font-size: 0.75rem;
    }

    .history-tag {
        padding: 0.25rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Decorator section */
    .decorator-section {
        padding-top: 1rem;
    }

    .decorator-header {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .decorator-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .decorator-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .decorator-preview {
        font-size: 0.7rem;
    }

    /* Section headers */
    .grid-header-section {
        margin-bottom: 0.8rem;
    }

    .section-sub-title {
        font-size: 1.1rem;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.3rem;
    }

    .sub-title-tip {
        font-size: 0.72rem;
        margin-left: 0;
    }

    .favorites-wrapper {
        margin-bottom: 2rem;
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    /* Cards grid and Font Card */
    .font-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .font-card {
        padding: 0.75rem 1rem;
        gap: 0.35rem;
        border-radius: var(--radius-sm);
    }

    .font-name {
        font-size: 0.72rem;
    }

    .action-btn.copy-btn {
        padding: 0.18rem 0.45rem;
        font-size: 0.68rem;
    }

    .action-icon-btn {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .font-preview-area {
        font-size: 1.2rem;
        min-height: 2.2rem;
        padding-right: 0.2rem;
    }

    .seo-content {
        padding: 1.5rem 1rem;
        margin-top: 2.5rem;
    }

    .seo-content h2 {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }

    .seo-content p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }

    .seo-grid {
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .seo-grid h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .faq-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .faq-section h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    details {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    summary {
        font-size: 0.92rem;
    }

    details p {
        font-size: 0.85rem;
    }

}
