/* 基础设置 */
:root {
    --primary: #2c3e50;
    --secondary: #4CAF50;
    --text: #333333;
    --background: #ffffff;
    --sidebar-width: 280px;
    --border-color: #e5e7eb;
    --hover-color: #f5f5f5;
    --error-color: #ff4d4f;
    --success-color: #52c41a;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #000000;
        --foreground: #ffffff;
        --muted: #1f2937;
        --muted-foreground: #9ca3af;
        --border: #374151;
    }
    body {
        background: #121212;
        color: #ffffff;
    }
    .main-content {
        background: #1e1e1e;
    }
}

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

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    overflow-x: hidden;
}

/* 页头样式 */
.header {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--background);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary);
}

/* 容器布局 */
.container {
    display: flex;
    min-height: calc(100vh - 40px);
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--background);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    height: calc(100vh - 40px);
    position: fixed;
    top: 40px;
    left: 0;
    overflow-y: auto;
}

.sidebar-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-btn:hover {
    background-color: var(--hover-color);
}

.sidebar-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 认证区域样式 */
.auth-area {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.auth-input {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
}

.auth-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-btn:hover {
    background-color: #1e2b38;
}

.auth-btn.logout {
    background-color: #e74c3c;
}

.auth-btn.logout:hover {
    background-color: #c0392b;
}

.error-msg {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.user-info {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.auth-input.disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: var(--sidebar-width);
    overflow-y: auto;
    margin-top: 40px;
}

.content-area {
    width: 100%;
    padding: 0;
}

.section-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-top: 0;
}

/* 工具箱区域字体与间距按知识库风格对齐 */
#tools-content {
    margin: 0;
    padding: 0.25rem 0.5rem 0.5rem 0.5rem;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

#tools-content * {
    font-family: inherit;
}

/* 工具网格样式 */
.tools-intro-section {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.tools-intro-section:first-child {
    margin-top: 0;
}

.tools-intro-content {
    margin-top: 0.5rem;
}

.tools-intro-section h3 {
    font-size: 1.17em;
    font-weight: 700;
    color: var(--text);
    font-family: inherit;
}

.tools-intro-description {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
}

.tools-intro-link {
    display: inline-block;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* 高亮关键词样式 - 半透明标签 */
.highlight {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95em;
}
}

.tools-intro-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.tools-section {
    margin: 2rem 0;
}

.tools-section .section-title {
    font-size: 1.17em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    border-bottom: none;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tool-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tool-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
}

.tool-name {
    color: var(--text);
    line-height: 1.6;
    font-size: 0.9375rem;
    font-weight: 400;
    font-family: inherit;
}

/* 社群内容样式 */
.article-list {
    list-style: none;
    margin-bottom: 2rem;
}

.article-list li {
    margin-bottom: 0.5rem;
}

.article-list a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.article-list a:hover {
    text-decoration: underline;
}

ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

ol li {
    margin-bottom: 0.5rem;
}

.qr-container {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-code {
    max-width: 200px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    background-color: white;
}

/* 用户管理页面样式 */
.management-group {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.management-group h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.management-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.management-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

.message {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.message.success {
    color: var(--success-color);
}

.message.error {
    color: var(--error-color);
}

/* Web工具容器样式 */
#web-tool-container {
    height: calc(100vh - 120px);
}

#web-tool-frame {
    width: 100%;
    height: 100%;
    /* 隐藏滚动条但保留滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

#web-tool-frame::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 同时为工具箱iframe添加相同样式 */
#tools-frame {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#tools-frame::-webkit-scrollbar {
    display: none;
}

/* Web工具打开时，隐藏外层滚动条但保留滚动 */
body.web-tool-open .main-content {
    overflow-y: auto;
    height: calc(100vh - 40px);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

body.web-tool-open .main-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

body.web-tool-open,
html.web-tool-open {
    overflow: hidden;
}

body.web-tool-open::-webkit-scrollbar,
html.web-tool-open::-webkit-scrollbar {
    display: none;
}

#intro-frame, #community-frame {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#intro-frame::-webkit-scrollbar,
#community-frame::-webkit-scrollbar {
    display: none;
}

/* 辅助类 */
.hidden {
    display: none !important;
}

/* 移动端响应式 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 900;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .input-group {
        flex-direction: column;
    }
}

/* 新增网站介绍内容区域样式 */
#intro-content {
    padding: 0;
}

#intro-content p {
    line-height: 2.0;
}

.highlight {
    font-weight: bold;
    color: var(--primary);
}

.price-highlight {
    background-color: #fffacd;
    padding: 2px 5px;
    border-radius: 3px;
}

.supplementary-note {
    font-size: 0.9em;
    font-style: italic;
    margin-top: -10px;
    margin-bottom: 10px;
    color: #666;
}

.qr-images-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: flex-start;
    align-items: flex-start;
}

.qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro-qr-code {
    height: 300px;
    width: auto;
    border: 1px solid var(--border-color);
    padding: 5px;
    background-color: white;
    margin-bottom: 10px;
}

.qr-text {
    font-size: 0.9em;
    color: var(--text);
    text-align: center;
}

/* 新增API服务内容区域样式 */
#api-content {
    padding: 0;
}

.api-docs-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 200px); /* 根据需要调整高度 */
    margin-bottom: 1rem;
}

#fastapi-docs-frame {
    width: 100%;
    height: 100%;
}

.api-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 半透明黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* 确保覆盖层在iframe之上 */
}

.overlay-message {
    color: white;
    font-size: 1.2em;
    text-align: center;
}

/* 为付费社群的代码块添加样式 */
.community-code-block {
    border: 1px solid #e0e0e0;
    padding: 1em;
    margin: 1.5em 0;
    background-color: #f9f9f9;
    font-size: 1em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 调整网站介绍页面的头部标题边距 */
#intro-content .section-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.member-benefits {
    padding-left: 2em;  /* 调整缩进量以对齐上方的"员"字 */
    margin: 0;
    list-style-position: outside;
}

.member-benefits li {
    margin-bottom: 0.5em;
}

/* =====================
   ServiceHub 复刻页面样式 (增强版)
   ===================== */

/* 页面布局容器 */
.video-search-container,
.video-text-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 600;
}

.page-header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header .current-user {
    font-weight: 500;
    color: var(--text);
}

.back-btn {
    padding: 8px 16px;
    background: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #45a049;
}

/* =====================
   步骤指示器样式
   ===================== */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.step {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -15px;
    width: 30px;
    height: 2px;
    background: #e9ecef;
    transform: translateY(-50%);
    z-index: 1;
}

.step:last-child::before {
    display: none;
}

.step.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.step.active::before {
    background: var(--secondary);
}

.step-number {
    display: block;
    width: 30px;
    height: 30px;
    margin: 0 auto 8px;
    background: #fff;
    border: 2px solid currentColor;
    border-radius: 50%;
    line-height: 26px;
    font-weight: bold;
}

.step.active .step-number {
    background: var(--secondary);
    border-color: white;
    color: white;
}

/* =====================
   表单样式
   ===================== */
.search-form,
.url-input-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    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: var(--secondary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.date-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

.primary-btn,
.secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: var(--secondary);
    color: white;
}

.primary-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

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

.secondary-btn:hover {
    background: #5a6268;
}

/* =====================
   数据表格样式
   ===================== */
.results-section {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    margin: 0;
    color: var(--primary);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f1f3f4;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.video-id {
    font-family: monospace;
    font-size: 12px;
    color: #666;
}

.video-title {
    max-width: 300px;
}

.title-text {
    line-height: 1.4;
    color: var(--text);
}

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

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-pending {
    background: #f8d7da;
    color: #721c24;
}

.video-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

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

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

.process-btn {
    background: var(--secondary);
    color: white;
}

.process-btn:hover {
    background: #45a049;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--hover-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================
   视频信息卡片样式
   ===================== */
.video-details {
    display: grid;
    gap: 20px;
}

.video-info-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.video-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.video-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.video-header h4 {
    margin: 0;
    color: var(--primary);
    flex: 1;
}

.video-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.meta-item i {
    color: var(--secondary);
    width: 16px;
}

.video-cover {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin: 10px auto;
}

/* =====================
   现代卡片布局样式
   ===================== */

/* 现代卡片容器 */
.modern-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.8);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 卡片头部 */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-header i {
    width: 24px;
    height: 24px;
    color: var(--secondary);
    font-size: 18px;
}

.card-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 18px;
    font-weight: 600;
}

/* 卡片内容 */
.card-content {
    padding: 24px;
}

/* 现代输入框样式 */
.modern-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 输入信息提示 */
.input-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 16px;
    background: #f0f9ff;
    border-radius: 8px;
    color: #0369a1;
    font-size: 13px;
}

.input-info i {
    color: #0284c7;
}

/* 现代按钮组 */
.modern-button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modern-button-group .btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modern-button-group .btn-primary {
    background: var(--secondary);
    color: white;
}

.modern-button-group .btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.modern-button-group .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.modern-button-group .btn-secondary:hover {
    background: #e5e7eb;
}

/* 现代结果展示 */
.modern-result {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.modern-result .result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.modern-result .result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.modern-result .result-content {
    line-height: 1.6;
    color: #475569;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .modern-card {
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .card-header {
        padding: 16px 20px;
    }

    .card-content {
        padding: 20px;
    }

    .modern-button-group {
        flex-direction: column;
    }

    .input-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* 网格视图无数据样式 */
.no-data-grid {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.no-data-grid i {
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

/* =====================
   现代网格布局样式
   ===================== */

/* 视频网格容器 */
.video-grid {
    margin-bottom: 30px;
}

.video-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* 视频卡片 */
.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 视频封面 */
.video-card .video-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
}

/* 视频内容 */
.video-card .video-content {
    padding: 16px;
}

.video-card .video-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card .video-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.video-card .author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.video-card .video-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.video-card .meta-item {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-card .meta-item i {
    width: 14px;
    color: var(--secondary);
}

/* 视频状态 */
.video-card .video-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.video-card .status-success {
    background: #f0f9ff;
    color: #0369a1;
}

.video-card .status-processing {
    background: #fef3c7;
    color: #d97706;
}

.video-card .status-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.video-card .status-error {
    background: #fef2f2;
    color: #dc2626;
}

/* 视频操作按钮 */
.video-card .video-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.video-card .action-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.video-card .btn-primary {
    background: var(--secondary);
    color: white;
}

.video-card .btn-primary:hover {
    background: #45a049;
}

.video-card .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.video-card .btn-secondary:hover {
    background: #e5e7eb;
}

/* 视图切换 */
.results-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.view-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 响应式网格布局 */
@media (max-width: 768px) {
    .video-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .video-card .video-cover {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .video-grid-container {
        grid-template-columns: 1fr;
    }

    .results-controls {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* =====================
   处理选项样式
   ===================== */
.processing-options {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.option-card {
    position: relative;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-card label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option-card input[type="radio"]:checked + label {
    border-color: var(--secondary);
    background: #f8fff8;
}

.option-card label:hover {
    border-color: var(--secondary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--secondary);
    color: white;
    border-radius: 8px;
    font-size: 18px;
}

.option-content h4 {
    margin: 0 0 5px 0;
    color: var(--primary);
}

.option-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* =====================
   处理信息样式
   ===================== */
.processing-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

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

.info-item i {
    color: var(--secondary);
}

/* =====================
   结果展示样式
   ===================== */
.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

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

.summary-item .value {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

.summary-item .value.success {
    color: #28a745;
}

.summary-item .value.error {
    color: #dc3545;
}

.summary-item .value.points {
    color: var(--secondary);
}

/* 标签页 */
.result-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.tab-btn:hover {
    color: var(--secondary);
}

.result-content {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tab-pane {
    display: none;
    padding: 20px;
}

.tab-pane.active {
    display: block;
}

.tab-pane textarea {
    width: 100%;
    min-height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.comparison-column {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
}

.comparison-column h4 {
    margin: 0 0 15px 0;
    color: var(--primary);
    text-align: center;
}

.comparison-column p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

/* =====================
   工具样式
   ===================== */
.input-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.input-info i {
    color: var(--secondary);
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* =====================
   Toast 通知样式
   ===================== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 250px;
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.toast-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.toast-warning {
    border-left: 4px solid #ffc107;
    color: #856404;
}

.toast-info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

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

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

/* =====================
   加载状态样式
   ===================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.processing-status-info {
    background: #e3f2fd;
    color: #1976d2;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 15px 0;
}

/* =====================
   响应式设计
   ===================== */
@media (max-width: 768px) {
    .video-search-container,
    .video-text-container {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .step-indicator {
        flex-direction: column;
        gap: 10px;
    }

    .step::before {
        display: none;
    }

    .date-range {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        justify-content: center;
    }

    .video-meta {
        grid-template-columns: 1fr;
    }

    .processing-options {
        grid-template-columns: 1fr;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }

    .result-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 100px;
    }

    .comparison-view {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .video-title {
        max-width: 150px;
    }

    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        margin: 0 0 10px 0;
    }
}
