* {
    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: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 标签页样式 */
.tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

/* 渠道显示样式 */
.channel-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-icon-small {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.channel-name {
    font-weight: 500;
    color: #495057;
}

.channel-id {
    font-size: 0.8rem;
    color: #6c757d;
}

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

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

#searchBtn,
#clearBtn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#searchBtn:hover,
#clearBtn:hover {
    background: #5a6fd8;
}

#clearBtn {
    background: #6c757d;
}

#clearBtn:hover {
    background: #5a6268;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filters select {
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

/* 自定义下拉组件样式 */
.custom-select-wrapper {
    position: relative;
    min-width: 200px;
}

.custom-select {
    position: relative;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    color: #495057;
}

.custom-select:hover {
    border-color: #667eea;
}

.select-arrow {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-select.open .select-options {
    display: block;
}

.select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-option:hover {
    background-color: #f8f9fa;
}

.select-option.selected {
    background-color: #667eea;
    color: white;
}

.option-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
}

.option-id {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
}

.select-option.selected .option-id {
    color: rgba(255, 255, 255, 0.8);
}

/* 价格显示模式切换样式 */
.price-mode-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.price-mode-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.price-mode-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.price-mode-btn {
    padding: 8px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.price-mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
}

.price-mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.price-mode-btn.active:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}

.price-mode-notice {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8f9ff;
    border: 1px solid #e1e5f2;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.notice-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notice-text {
    color: #6c757d;
    flex: 1;
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stat-item span:last-child {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

/* 固定表格列宽 */
th:nth-child(1) { width: 25%; } /* 模型名称 */
th:nth-child(2) { width: 10%; } /* 类型 */
th:nth-child(3) { width: 20%; } /* 渠道类型 */
th:nth-child(4) { width: 15%; } /* 输入价格 */
th:nth-child(5) { width: 15%; } /* 输出价格 */
th:nth-child(6) { width: 15%; } /* 额外费率 */

td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

.model-name {
    font-weight: 600;
    color: #495057;
    word-break: break-word;
}

/* 搜索高亮样式 */
.search-highlight {
    background: #fff3cd;
    color: #856404;
    font-weight: 600;
    animation: highlight-fade-out 1s ease-out forwards;
}

@keyframes highlight-fade-out {
    0% {
        background: #fff3cd;
        color: #856404;
    }
    50% {
        background: #ffeaa7;
        color: #856404;
    }
    100% {
        background: transparent;
        color: inherit;
        font-weight: inherit;
    }
}

/* 深色主题下的高亮样式 */
@media (prefers-color-scheme: dark) {
    .search-highlight {
        background: linear-gradient(135deg, #4a4a00 0%, #666600 100%);
        color: #ffff99;
        border-color: #666600;
    }
}

.price {
    font-weight: 600;
    color: #28a745;
}

.price.zero {
    color: #6c757d;
}

.channel-type {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.type-tokens {
    background: #d4edda;
    color: #155724;
}

.type-times {
    background: #d1ecf1;
    color: #0c5460;
}

.extra-ratios {
    font-size: 0.85rem;
    color: #6c757d;
}

.extra-ratios .ratio-item {
    display: block;
    margin-bottom: 2px;
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters select {
        min-width: auto;
    }

    .custom-select-wrapper {
        min-width: auto;
    }

    .price-mode-section {
        flex-direction: column;
        align-items: stretch;
    }

    .price-mode-buttons {
        justify-content: center;
    }

    .stats {
        flex-direction: column;
    }

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

    table {
        min-width: 600px;
    }

    th,
    td {
        padding: 8px 6px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .search-section {
        padding: 15px;
    }

    th,
    td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
}

/* 表格滚动条样式 */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 渠道类型网格样式 */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.channel-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.channel-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 5px;
}

.channel-info h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #495057;
    font-weight: 600;
}

.channel-id {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 2px;
}

.channel-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.stat-box {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.stat-box .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.stat-box .label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}
/* 帮助页面样式 */
.help-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
}

.help-content {
    max-width: none;
    line-height: 1.6;
}

.help-content h1 {
    color: #667eea;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.help-content h2 {
    color: #495057;
    margin-top: 30px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    padding-left: 15px;
}

.help-content h3 {
    color: #6c757d;
    margin-top: 25px;
    margin-bottom: 10px;
}

.help-content p {
    margin-bottom: 15px;
    color: #495057;
}

.help-content ul, .help-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.help-content li {
    margin-bottom: 5px;
    color: #495057;
}

.help-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.help-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.help-content pre code {
    background: none;
    padding: 0;
    color: #495057;
}

.help-content a {
    color: #667eea;
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

.help-content blockquote {
    border-left: 4px solid #667eea;
    margin: 15px 0;
    padding: 10px 20px;
    background: #f8f9fa;
    color: #6c757d;
}

.help-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.help-content th,
.help-content td {
    border: 1px solid #e9ecef;
    padding: 8px 12px;
    text-align: left;
}

.help-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.help-error {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.help-error a {
    color: #667eea;
    text-decoration: none;
}

.help-error a:hover {
    text-decoration: underline;
}

/* 新增的帮助页面特定样式 */
.help-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

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

.important-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.important-notice h3 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.important-notice ul {
    margin-bottom: 0;
}

.important-notice li {
    color: #856404;
}

.price-tables {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.price-table-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.price-table-item h4 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.price-table-item p {
    margin-bottom: 15px;
    color: #6c757d;
}

.url-list {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.url-list p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057;
}

.url-list ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.url-list li {
    margin-bottom: 8px;
    word-break: break-all;
}

.method-steps {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.method-steps h4 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 15px;
}

.method-steps ol {
    margin-bottom: 0;
}

.method-steps li {
    margin-bottom: 10px;
}

.notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.notice h4 {
    color: #0c5460;
    margin-top: 0;
    margin-bottom: 15px;
}

.notice ul {
    margin-bottom: 0;
}

.notice li {
    color: #0c5460;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #667eea;
    color: white !important;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.github-link:hover {
    background: #5a6fd8;
    text-decoration: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .help-container {
        padding: 15px;
    }
    
    .price-table-item,
    .method-steps,
    .important-notice,
    .notice {
        padding: 15px;
    }
    
    .url-list {
        padding: 10px;
    }
}