/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 头部 */
.header {
    background: #fff;
    border-radius: 12px;
    padding: 5px 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.header h1 {
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: #f0f2f5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #e4e7ed;
}

.nav-btn.active {
    background: #409eff;
    color: #fff;
}

/* 面板 */
.panel {
    display: none;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ebeef5;
}

.panel-header h2 {
    font-size: 20px;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.panel-header .desc {
    color: #909399;
    font-size: 14px;
}

/* 表单 */
.form-section {
    margin-bottom: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #606266;
}

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

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #409eff;
}

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

/* 按钮 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background: #66b1ff;
}

.btn-primary:disabled {
    background: #a0cfff;
    cursor: not-allowed;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    margin-top: 16px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae7ff;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #409eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-indicator span {
    color: #409eff;
    font-size: 14px;
    font-weight: 500;
}

.btn-secondary {
    background: #f0f2f5;
    color: #606266;
}

.btn-secondary:hover {
    background: #e4e7ed;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #dcdfe6;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #409eff;
    background: #f5f9ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-hint {
    color: #909399;
    font-size: 12px;
    margin-top: 5px;
}

/* 文件列表 */
.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove {
    color: #f56c6c;
    cursor: pointer;
    padding: 5px 10px;
}

/* 进度条 */
.progress-section {
    margin-top: 25px;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 8px;
}

.progress-bar {
    height: 8px;
    background: #ebeef5;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #409eff, #66b1ff);
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    color: #606266;
    font-size: 14px;
}

/* 结果区域 */
.results-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #ebeef5;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.video-card {
    background: #f5f7fa;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #909399;
    font-size: 12px;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.video-actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

/* 文案列表 */
.copy-list {
    max-height: 500px;
    overflow-y: auto;
}

.copy-item {
    padding: 20px;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.copy-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.copy-item-index {
    font-weight: 500;
    color: #409eff;
}

.copy-item-actions {
    display: flex;
    gap: 10px;
}

.copy-item-content {
    color: #606266;
    line-height: 1.8;
}

/* 分模块展示 */
.copy-modules {
    margin-top: 12px;
}

.copy-module-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-left: 3px solid #409eff;
}

.copy-module-item:last-child {
    margin-bottom: 0;
}

.copy-module-label {
    font-size: 12px;
    color: #409eff;
    font-weight: 600;
    margin-bottom: 6px;
}

.copy-module-content {
    color: #606266;
    line-height: 1.7;
    font-size: 14px;
}

/* 素材网格 */
.material-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.material-tab {
    padding: 8px 16px;
    border: none;
    background: #f0f2f5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.material-tab.active {
    background: #409eff;
    color: #fff;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.material-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fa;
}

.material-item img,
.material-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 知识库列表 */
.knowledge-list {
    margin-top: 25px;
}

.knowledge-category {
    margin-bottom: 20px;
}

.knowledge-category h4 {
    padding: 10px 15px;
    background: #f5f7fa;
    border-radius: 8px 8px 0 0;
    color: #409eff;
}

.knowledge-item {
    padding: 15px;
    background: #fff;
    border: 1px solid #ebeef5;
    border-top: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.knowledge-item:last-child {
    border-radius: 0 0 8px 8px;
}

.knowledge-qa {
    flex: 1;
}

.knowledge-question {
    color: #303133;
    margin-bottom: 8px;
    line-height: 1.5;
}

.knowledge-answer {
    color: #606266;
    line-height: 1.6;
}

.knowledge-text {
    flex: 1;
}

.knowledge-delete {
    color: #f56c6c;
    cursor: pointer;
    padding: 5px 10px;
    flex-shrink: 0;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #909399;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #ebeef5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 账号管理 */
.accounts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.accounts-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f7fa;
    border-radius: 8px;
}

.stat-item .count {
    font-size: 20px;
    font-weight: bold;
    color: #409eff;
}

.stat-item .label {
    font-size: 12px;
    color: #909399;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.accounts-table th,
.accounts-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.accounts-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #606266;
}

.accounts-table tr:hover {
    background: #f5f7fa;
}

.platform-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.platform-badge.douyin {
    background: #fe2c55;
    color: #fff;
}

.platform-badge.kuaishou {
    background: #ff4906;
    color: #fff;
}

.platform-badge.xiaohongshu {
    background: #ff2442;
    color: #fff;
}

.platform-badge.shipinhao {
    background: #07c160;
    color: #fff;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.status-badge.active {
    background: #e1f3d8;
    color: #67c23a;
}

.status-badge.error {
    background: #fde2e2;
    color: #f56c6c;
}

.status-badge.unknown {
    background: #e4e7ed;
    color: #909399;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.action-btn.check {
    background: #409eff;
    color: #fff;
}

.action-btn.delete {
    background: #f56c6c;
    color: #fff;
}

.action-btn.edit {
    background: #e6a23c;
    color: #fff;
}

/* 违规视频列表 */
.violations-list {
    margin-top: 20px;
}

.violations-list h3 {
    margin-bottom: 15px;
    color: #f56c6c;
}

.violation-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #f56c6c;
}

.violation-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.violation-info {
    flex: 1;
}

.violation-info h4 {
    margin-bottom: 5px;
}

.violation-info p {
    font-size: 12px;
    color: #909399;
}

.violation-reason {
    color: #f56c6c;
    font-size: 12px;
    margin-top: 5px;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
    }
    
    .panel {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .accounts-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .accounts-table {
        font-size: 12px;
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 8px;
    }
}

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

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-box .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #303133;
}

.modal-box .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #909399;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-box .modal-close:hover {
    background: #f5f7fa;
    color: #303133;
}

.modal-box .modal-body {
    padding: 20px;
    height: 60vh;
    overflow-y: auto;
}

.modal-box .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #ebeef5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #606266;
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    color: #303133;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.form-input::placeholder {
    color: #c0c4cc;
}

/* 二维码区域 */
.qrcode-area {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dcdfe6;
    overflow: hidden;
    position: relative;
}

.qrcode-placeholder {
    text-align: center;
    color: #909399;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qrcode-image {
    width: 280px;
    height: 280px;
    object-fit: contain;
    image-rendering: pixelated;
}

.qrcode-loading {
    text-align: center;
    color: #909399;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e4e7ed;
    border-top-color: #409eff;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 二维码状态 */
.qrcode-status {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
}

.status-waiting {
    color: #e6a23c;
}

.status-scanned {
    color: #409eff;
}

.status-success {
    color: #67c23a;
}

.status-expired {
    color: #f56c6c;
}

.status-failed {
    color: #f56c6c;
}

/* ==================== 知识卡片样式 ==================== */

.cards-results {
    margin-top: 24px;
}

.cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.card-item {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4e7ed;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f5f7fa;
    border-bottom: 1px solid #e4e7ed;
}

.card-item-index {
    font-size: 14px;
    font-weight: 600;
    color: #303133;
}

.card-item-actions {
    display: flex;
    gap: 8px;
}

.card-preview {
    padding: 24px;
    background-color: #009639;
    background-image: url('/static/images/logo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 8px;
}

.card-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 150, 57, 0.6);
    border-radius: 8px;
}

.card-preview > * {
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.card-points {
    list-style: none;
    padding: 0;
    margin: 0 0 auto 0;
    flex: 1;
}

.card-points li {
    font-size: 15px;
    line-height: 1.8;
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.card-points li::before {
    content: '✓';
    position: absolute;
    left: 0;
    font-size: 16px;
    font-weight: bold;
    color: #00f2fe;
}

.card-brand {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    opacity: 0.95;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.card-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-brand-sk {
    font-size: 18px;
    font-weight: bold;
}

.card-brand-sk .s {
    color: #00f2fe;
}

.card-brand-sk .k {
    color: #fff;
}

.card-brand-text {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 16px;
}

.cards-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

/* 卡片预览不同配色 - 统一品牌色系 */
.card-item:nth-child(2n) .card-preview {
    background-color: #0099E5;
}

.card-item:nth-child(2n) .card-preview::before {
    background: rgba(0, 153, 229, 0.6);
}

.card-item:nth-child(3n) .card-preview {
    background-color: #009639;
}

.card-item:nth-child(3n) .card-preview::before {
    background: rgba(0, 150, 57, 0.6);
}

.card-item:nth-child(4n) .card-preview {
    background-color: #E60012;
}

.card-item:nth-child(4n) .card-preview::before {
    background: rgba(230, 0, 18, 0.6);
}

.card-item:nth-child(5n) .card-preview {
    background-color: #009639;
}

.card-item:nth-child(5n) .card-preview::before {
    background: linear-gradient(135deg, rgba(0, 150, 57, 0.6) 0%, rgba(0, 153, 229, 0.6) 100%);
}

/* ==================== 配套文案样式 ==================== */

.card-caption {
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px dashed #e4e7ed;
}

.card-caption-label {
    font-size: 12px;
    color: #909399;
    margin-bottom: 8px;
}

.card-caption-text {
    font-size: 14px;
    color: #303133;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

/* ==================== 知识卡片进度条样式 ==================== */

.cards-loading .progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e4e7ed;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.cards-loading .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: cards-progress-animation 2s infinite;
}

@keyframes cards-progress-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.cards-loading .progress-text {
    font-size: 13px;
    color: #909399;
    margin-top: 8px;
    display: block;
}

.loading-indicator {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 8px;
    margin-top: 16px;
}

/* Logo图片样式 */
.card-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.card-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
    opacity: 0.95;
    justify-content: center;
}

.card-brand-text {
    font-size: 14px;
    font-weight: 500;
}

/* 文案显示区域 - 动态高度 */
.section-content {
    margin-top: 10px;
}

.section-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    max-height: none;
    overflow: visible;
}

/* 视频文案显示区域 - 自动扩展或滚动 */
.video-item .copy-text,
.video-list .copy-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    padding: 10px;
    margin-top: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .video-item .copy-text,
    .video-list .copy-text {
        max-height: 150px;
        font-size: 13px;
    }
}
