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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    padding: 20px;
}

/* 登录页面 */
.login-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 28px;
    color: #667eea;
    margin-bottom: 10px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

/* 主页面 */
.main-page {
    display: none;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h2 {
    font-size: 20px;
    color: #667eea;
}

.header-right {
    display: flex;
    gap: 10px;
}

.user-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

.logout-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    margin: 15px 20px;
    border-radius: 15px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 0 0 auto;
    padding: 12px 16px;
    text-align: center;
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-radius: 10px;
}

.content {
    padding: 0 20px 20px;
}

.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

.form-section {
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.file-upload {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.file-upload:hover {
    background: rgba(102, 126, 234, 0.05);
}

.file-upload input {
    display: none;
}

.file-upload-icon {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 10px;
}

.file-upload p {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.file-upload small {
    font-size: 12px;
    color: #999;
}

.file-info {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    display: none;
}

.result-box.show {
    display: block;
}

.result-box h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.result-item {
    margin-bottom: 15px;
}

.result-item label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.result-text {
    padding: 10px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

.hashtag {
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 12px;
}

.video-preview,
.audio-preview {
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
}

.download-btn {
    width: 100%;
    padding: 12px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.error-message {
    background: #ff4757;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    font-size: 14px;
}

.error-message.show {
    display: block;
}

.success-message {
    background: #2ecc71;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
}

.success-message.show {
    display: block;
}

.quota-info {
    padding: 10px;
    background: #fff3cd;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
    color: #856404;
}

.subtitle-text {
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

/* 输入框带按钮样式 */
.input-with-buttons {
    position: relative;
}

.input-with-buttons textarea {
    padding-right: 80px;
}

.button-group {
    position: absolute;
    right: 10px;
    top: 10px;
    display: flex;
    gap: 5px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* 按钮行样式 */
.button-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.button-row .btn-secondary {
    flex: 1;
    margin-top: 0;
}

/* AI支持框样式 */
.ai-support-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #667eea;
}

.ai-support-box p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

.btn-outline {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* 结果区域样式 */
.result-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

/* 标签容器样式 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    min-height: 50px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    font-size: 13px;
    gap: 5px;
}

.tag-item .tag-copy {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tag-item .tag-copy:hover {
    opacity: 1;
}

/* 用户中心弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.user-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item label {
    font-weight: 600;
    color: #666;
}

.info-item span {
    color: #333;
}

.quota-section {
    margin-bottom: 20px;
}

.quota-section h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.quota-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.quota-value {
    font-weight: 600;
    color: #667eea;
}

.switch-form {
    text-align: center;
    margin-top: 15px;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.api-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.api-section:last-child {
    border-bottom: none;
}

.api-section h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .header h2 {
        font-size: 18px;
    }
    
    .tab {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .form-section h3 {
        font-size: 16px;
    }
}

