/* static/css/article_rewrite.css */

/* 通用样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 主容器样式 */
.rewrite-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.rewrite-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2196F3, #21CBF3, #2196F3);
}

/* 页面头部 */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.page-header h1 {
    color: #2196F3;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2196F3, #21CBF3);
    border-radius: 2px;
}

.subtitle {
    color: #666;
    font-size: 18px;
    margin-top: 10px;
}

/* 提示区域 */
.tips-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid #2196F3;
    padding: 25px 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    position: relative;
}

.tips-title {
    color: #2196F3;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.tips-list {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
    padding-left: 20px;
}

.tips-list li {
    margin-bottom: 10px;
    position: relative;
}

.tips-list li::before {
    content: '▸';
    color: #2196F3;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* 表单样式 */
.form-section {
    margin-bottom: 30px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 12px;
    color: #333;
    font-weight: 600;
    font-size: 16px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafbfc;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: #2196F3;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
    transform: translateY(-1px);
}

.form-textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.7;
}

.char-count {
    text-align: right;
    color: #6c757d;
    font-size: 13px;
    margin-top: 8px;
    transition: color 0.3s ease;
}

/* 按钮样式 */
.btn-container {
    text-align: center;
    margin-top: 40px;
    position: relative;
}

.btn-rewrite {
    background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.btn-rewrite::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-rewrite:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976D2 0%, #1E88E5 100%);
    box-shadow: 0 12px 35px rgba(33, 150, 243, 0.4);
    transform: translateY(-3px);
}

.btn-rewrite:hover:not(:disabled)::before {
    left: 100%;
}

.btn-rewrite:disabled {
    background: linear-gradient(135deg, #bbb 0%, #999 100%);
    cursor: not-allowed;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: none;
}

.btn-rewrite:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

/* 加载动画 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

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

.loading-text {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-top: 20px;
    display: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .rewrite-container {
        margin: 15px;
        padding: 25px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .tips-section {
        padding: 20px 25px;
    }
}

@media (max-width: 768px) {
    .rewrite-container {
        margin: 10px;
        padding: 20px 15px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .tips-section {
        padding: 15px 20px;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .btn-rewrite {
        width: 100%;
        padding: 16px 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 20px;
    }
    
    .tips-list {
        font-size: 14px;
        padding-left: 15px;
    }
    
    .form-textarea {
        min-height: 180px;
    }
}

/* 无障碍设计 */
.form-input:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.btn-rewrite:focus {
    outline: 2px solid #2196F3;
    outline-offset: 4px;
}

/* 打印样式 */
@media print {
    .rewrite-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-container,
    .loading-spinner,
    .loading-text {
        display: none !important;
    }
    
    .tips-section {
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-item {
    flex: 1;
    min-width: 200px;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
    gap: 15px;
    height: 100%;
}

.radio-label:hover {
    border-color: #2196F3;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
}

.radio-item input[type="radio"]:checked + .radio-label {
    border-color: #2196F3;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

.radio-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.radio-content {
    flex-grow: 1;
}

.radio-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.radio-desc {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.radio-item input[type="radio"]:checked + .radio-label .radio-title {
    color: #2196F3;
}

.radio-item input[type="radio"]:checked + .radio-label .radio-desc {
    color: #555;
}

/* 响应式设计 - 单选按钮组 */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .radio-item {
        min-width: unset;
    }
    
    .radio-label {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .radio-icon {
        font-size: 20px;
    }
    
    .radio-title {
        font-size: 15px;
    }
    
    .radio-desc {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .radio-label {
        padding: 12px 14px;
        gap: 10px;
    }
}

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

.form-section {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.btn-container { animation-delay: 0.4s; }

/* 表单验证样式 */
.form-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-input.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.success-message {
    color: #27ae60;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}