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

:root {
    --primary-color: #e4002b;
    --secondary-color: #ff6b35;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --text-primary: #2d2d2d;
    --text-secondary: #555555;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #ffd89b 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    padding: 20px;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.8rem;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.generator-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 30px;
}

.style-section, .length-section {
    margin-bottom: 30px;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.style-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.style-card {
    cursor: pointer;
    position: relative;
}

.style-card input {
    position: absolute;
    opacity: 0;
}

.card-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.style-card:hover .card-content {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(31, 38, 135, 0.2);
}

.style-card input:checked + .card-content {
    background: rgba(228, 0, 43, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(228, 0, 43, 0.25);
}

.style-card .icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.style-card .title {
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 4px;
}

.style-card .desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.length-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.length-btn {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.length-btn input {
    position: absolute;
    opacity: 0;
}

.length-btn span {
    display: block;
    padding: 15px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.length-btn:hover span {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.length-btn input:checked + span {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 20px rgba(228, 0, 43, 0.3);
}

.generate-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.9) 0%, rgba(255, 107, 53, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(228, 0, 43, 0.3);
    backdrop-filter: blur(10px);
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(228, 0, 43, 0.4);
    background: linear-gradient(135deg, rgba(228, 0, 43, 1) 0%, rgba(255, 107, 53, 1) 100%);
}

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

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none !important;
}

.result-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    box-shadow: var(--glass-shadow);
    animation: fadeIn 0.5s ease;
}

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

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

.copy-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-content {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    min-height: 150px;
    backdrop-filter: blur(10px);
}

.result-content p {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.regenerate-btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.regenerate-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(228, 0, 43, 0.3);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 45, 45, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    z-index: 1000;
    animation: toastIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin-top: 40px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .card-content {
        flex-direction: column;
        text-align: center;
    }

    .length-options {
        flex-direction: column;
    }

    .length-btn {
        min-width: 100%;
    }

    .result-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .generator-panel, .result-panel {
        padding: 25px;
    }
}
