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

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

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

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: #007bff;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: #666;
    font-size: 0.9rem;
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-secondary:hover {
    background: #545b62;
}

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

/* 帮助图标 */
.help-icon {
    cursor: help;
    color: #007bff;
    font-size: 0.9rem;
    margin-left: 5px;
}

.help-icon-large {
    cursor: help;
    color: #007bff;
    font-size: 1.2rem;
    margin-left: 10px;
}

/* 帮助框 */
.help-box {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.help-box.info {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    color: #004085;
}

.help-box.warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.help-box.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.help-box ul, .help-box ol {
    margin: 0.5rem 0 0 1.5rem;
}

.help-box li {
    margin: 0.25rem 0;
}

.help-box a {
    color: #007bff;
    text-decoration: underline;
}

/* 步骤指引 */
.steps-guide {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.steps-guide h3 {
    margin-bottom: 1rem;
    color: #333;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #007bff;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    font-weight: 500;
}

.step-status {
    color: #666;
    font-size: 0.9rem;
}

/* 认证页面 */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
}

/* 表单 */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

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

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

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

.verification-code-group {
    display: flex;
    gap: 0.5rem;
}

.verification-code-group input {
    flex: 1;
}

.code-status {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.char-count {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.char-warning {
    margin-left: 0.5rem;
    font-weight: 500;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.auth-switch a {
    color: #007bff;
    text-decoration: none;
    margin-left: 0.5rem;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* 主页面 */
.main-page {
    padding: 2rem 0;
}

.section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.config-status {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.config-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.config-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message {
    line-height: 1.8;
}

/* 表单操作按钮组 */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* 验证消息 */
.validation-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.validation-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
    white-space: pre-line;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

/* 媒体预览 */
.media-preview {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.media-preview-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.media-preview-item:last-child {
    border-bottom: none;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* 预览推文样式 */
.preview-tweet {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.preview-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.preview-user-info {
    flex: 1;
}

.preview-username {
    font-weight: bold;
    color: #333;
}

.preview-time {
    font-size: 0.875rem;
    color: #666;
}

.preview-content {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1rem;
}

.preview-media {
    margin-top: 1rem;
}

.preview-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.preview-char-count {
    font-size: 0.875rem;
    color: #666;
}

.preview-warning {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.preview-warning ul {
    margin: 0.5rem 0 0 1.5rem;
}

.preview-warning li {
    margin: 0.25rem 0;
}

/* 发布历史 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.history-item.success {
    border-left-color: #28a745;
}

.history-item.error {
    border-left-color: #dc3545;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-time {
    color: #666;
    font-size: 0.9rem;
}

.history-item-content {
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

.history-item-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8d7da;
    border-radius: 4px;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    white-space: pre-line;
    line-height: 1.6;
}

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

.message.error {
    background: #dc3545;
    color: white;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 使用说明 */
.usage-guide {
    line-height: 1.8;
}

.usage-guide h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #333;
    font-size: 1.1rem;
}

.usage-guide h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 1rem;
}

.usage-guide p {
    margin: 0.5rem 0;
}

.usage-guide ol, .usage-guide ul {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.usage-guide li {
    margin: 0.25rem 0;
}

.usage-guide a {
    color: #007bff;
    text-decoration: underline;
}

.example-box {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.example-text {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
    border: 1px solid #dee2e6;
}

.important-note {
    color: #856404;
    font-weight: 500;
    margin-top: 0.5rem;
}

.keys-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.key-group {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.key-group h4 {
    margin-top: 0;
    color: #007bff;
}

.key-group ul {
    margin: 0.5rem 0 0 1.5rem;
}

.important-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.important-warning p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.important-warning ul {
    margin: 0.5rem 0 0 1.5rem;
}

.btn-toggle-guide {
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-toggle-guide:hover {
    background: #545b62;
}

.section h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 登录方式选择 */
.login-method-options {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.radio-option:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.radio-option input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    color: #007bff;
    font-weight: 500;
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: #007bff;
    background-color: #e7f3ff;
}

/* 页脚 */
.app-footer {
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: #666;
}

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

.app-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.version {
    color: #007bff;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .keys-info {
        grid-template-columns: 1fr;
    }
    
    .btn-toggle-guide {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .app-footer {
        padding: 1rem 0;
        margin-top: 2rem;
    }
    
    .app-footer p {
        font-size: 0.85rem;
    }
    .container {
        padding: 0 15px;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .verification-code-group {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .steps {
        gap: 0.75rem;
    }
    
    .step {
        flex-wrap: wrap;
    }
    
    .step-status {
        width: 100%;
        margin-top: 0.5rem;
    }
}
