/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

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

/* 主要内容区域 */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 标题样式 */
.title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 400;
}

/* 信息框样式 */
.info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 35px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.info-box h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.info-box li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #a8e6cf;
    font-weight: bold;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafbfc;
    color: #2c3e50;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: #bdc3c7;
    background-color: white;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 15px 35px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(252, 182, 159, 0.4);
}

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

.btn:active {
    transform: translateY(-1px);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 35px;
}

/* 预览区域 */
.preview-section {
    margin-top: 35px;
    padding: 25px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(233, 236, 239, 0.5);
    backdrop-filter: blur(5px);
}

.preview-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
}

.preview-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    white-space: pre-line;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 提示信息 */
.hint {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
    display: block;
}

/* 加载状态 */
.loading {
    display: none;
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    margin-top: 25px;
}

.loading.show {
    display: block;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #7f8c8d;
    font-size: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息 */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    color: #155724;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.alert-error {
    color: #721c24;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.alert-info {
    color: #0c5460;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .main-content {
        padding: 30px 25px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.6rem;
    }
    
    .main-content {
        padding: 25px 20px;
    }
    
    .form-control {
        padding: 12px 15px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* 页数选择器特殊样式 */
.page-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.page-option {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
    font-weight: 500;
    color: #2c3e50;
}

.page-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.page-option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 隐藏默认的数字输入框 */
.hidden {
    display: none;
}