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

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    animation: fadeInUp 0.6s ease-out;
}

.form-section, .preview-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    height: fit-content;
    min-height: 600px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-section:hover, .preview-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.form-section {
    height: fit-content;
}

.preview-section {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
}



.form-section h2, .preview-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

textarea {
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(0);
}

.btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 100%;
    margin-top: 20px;
    font-size: 16px;
    padding: 15px;
}

.btn.primary:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}


.btn.secondary {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    font-size: 13px;
    padding: 10px 20px;
}

.btn.secondary:hover {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
}

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

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 13px;
}

.checkbox-group label:hover {
    background-color: #f8f9fa;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

.preview-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    line-height: 1.7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #2c3e50;
    font-size: 14px;
    text-align: justify;
    word-wrap: break-word;
}

.preview-content br {
    margin-bottom: 8px;
}

.preview-content strong {
    font-weight: 600;
    color: #2c3e50;
}

.preview-content em {
    font-style: italic;
    color: #7f8c8d;
}

.preview-content h1,
.preview-content .policy-title {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
    font-weight: bold;
    text-align: center !important;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.preview-content .date-line {
    text-align: center !important;
    margin-bottom: 20px;
    color: #7f8c8d;
    font-size: 1em;
}

.preview-content strong {
    font-weight: 600;
    color: #2c3e50;
}

.preview-content > div {
    margin-bottom: 15px;
}

.preview-content ul, .preview-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.preview-content li {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        align-items: stretch;
        padding: 0 10px;
    }
    
    .form-section, .preview-section {
        min-height: auto;
        max-height: none;
        padding: 20px;
        border-radius: 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    }
    
    .form-section {
        border-right: none;
        border-bottom: none;
    }
    
    .preview-section {
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .actions {
        margin-top: 0;
    }
    
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 2em;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

@media (max-width: 480px) {
    .main-content {
        gap: 15px;
    }
    
    .form-section, .preview-section {
        padding: 15px;
    }
    
    .preview-content {
        font-size: 13px;
        padding: 15px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

.form-group.hidden {
    display: none;
}

.required::after {
    content: ' *';
    color: #e74c3c;
}