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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #ff4500 0%, #ff6b35 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-brand i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* 主标题 */
.main-header {
    text-align: center;
    padding: 3rem 0 2rem;
    background: white;
}

.main-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* 功能特性区域 */
.features-section {
    background: white;
    padding: 3rem 0;
    border-bottom: 1px solid #eee;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff4500, #ff6b35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
}

/* 主要内容区域 */
.main-content {
    background: white;
    padding: 3rem 0;
}

.config-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.config-section h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-section h2 i {
    color: #ff4500;
}

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

.form-group h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.form-group h3 i {
    color: #ff4500;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff4500;
    box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* 单选和复选框样式 */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-custom,
.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.checkbox-custom {
    border-radius: 3px;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #ff4500;
    background: #ff4500;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #ff4500;
    background: #ff4500;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #ff4500, #ff6b35);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

/* 结果显示区域 */
.results-section {
    background: white;
    padding: 3rem 0;
    margin-top: 2rem;
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-section h2 i {
    color: #28a745;
}

.results-stats {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ff4500;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.results-preview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.tweet-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #ff4500;
}

.tweet-author {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tweet-content {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tweet-meta {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    gap: 1rem;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem 3rem;
    border-radius: 20px;
    text-align: center;
    min-width: 500px;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: toastPopIn 0.4s ease-out;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.progress-info {
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    flex: 1;
    min-height: 200px;
    max-height: 450px;
    overflow-y: auto;
    text-align: left;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 1.2rem;
    backdrop-filter: blur(10px);
}

/* 日志滚动条样式 */
.progress-info::-webkit-scrollbar {
    width: 10px;
}

.progress-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.progress-info::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 5px;
}

.progress-info::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .loading-content {
        max-width: 90vw;
        min-width: 320px;
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .progress-info {
        min-height: 150px;
        max-height: 300px;
        font-size: 0.85rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .main-header h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .results-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 评论设置样式 */
.comment-cost-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.cost-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #856404;
}

.cost-warning i {
    color: #ff6b35;
}

.advanced-comments {
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    padding: 1rem;
}

.advanced-comments summary {
    cursor: pointer;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.5rem;
}

.advanced-comments summary:hover {
    color: #ff4500;
}

.advanced-comments[open] summary {
    margin-bottom: 1rem;
    color: #ff4500;
}

/* 评论预览样式 */
.comment-item {
    background: #f8f9fa;
    border-left: 3px solid #17a2b8;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 0 5px 5px 0;
}

.comment-author {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.comment-text {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.comment-meta {
    font-size: 0.75rem;
    color: #adb5bd;
    display: flex;
    gap: 1rem;
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .config-section {
        padding: 1rem;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .radio-group,
    .checkbox-group {
        flex-direction: column;
    }
    
    .advanced-comments {
        padding: 0.75rem;
    }
}

/* 功能选项卡片样式 */
.feature-option-card {
    margin: 1rem 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.feature-option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.feature-option-label {
    display: flex;
    align-items: flex-start;
    padding: 1.2rem;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.feature-option-label:hover {
    background: #f8f9ff;
}

.feature-option-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.feature-checkbox {
    position: relative;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 3px solid #667eea;
    border-radius: 8px;
    margin-right: 1rem;
    margin-top: 2px;
    transition: all 0.3s ease;
    background: white;
    flex-shrink: 0;
}

.feature-checkbox::after {
    content: '';
    position: absolute;
    display: none;
    left: 8px;
    top: 3px;
    width: 8px;
    height: 14px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.feature-option-label input[type="checkbox"]:checked ~ .feature-checkbox {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    transform: scale(1.1);
}

.feature-option-label input[type="checkbox"]:checked ~ .feature-checkbox::after {
    display: block;
    animation: checkmark-appear 0.3s ease;
}

@keyframes checkmark-appear {
    0% {
        transform: rotate(45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: rotate(45deg) scale(1.2);
    }
    100% {
        transform: rotate(45deg) scale(1);
        opacity: 1;
    }
}

/* 未选中状态也有一个小点提示 */
.feature-checkbox::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.feature-option-label input[type="checkbox"]:checked ~ .feature-checkbox::before {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-title i {
    color: #667eea;
    font-size: 1.2rem;
}

.feature-description {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.5;
}

.recommended-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(245, 87, 108, 0.5);
    }
}

/* Toast 通知动画 */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Toast 居中弹出动画 */
@keyframes toastPopIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes toastPopOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* 遮罩层动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .feature-option-card {
        margin: 0.75rem 0;
    }

    .feature-option-label {
        padding: 1rem;
    }

    .feature-title {
        font-size: 1rem;
        flex-wrap: wrap;
    }

    .feature-description {
        font-size: 0.85rem;
    }

    .recommended-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}