/* Open Platform 页面专用样式 */

/* 通用样式 */
.page-header {
    margin-bottom: 2rem;
}

.page-description {
    color: #666;
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 统计概览样式 */
.platform-overview,
.stats-overview {
    margin: 2rem 0;
}

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

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

.stat-icon {
    font-size: 2rem;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.stat-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 平台提供商样式 */
.providers-section {
    margin: 3rem 0;
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.provider-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.provider-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.provider-icon {
    font-size: 2.5rem;
}

.provider-info {
    flex: 1;
}

.provider-info h3,
.provider-details h3 {
    margin: 0;
    color: #333;
}

.provider-info p,
.provider-details p {
    margin: 0.5rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

.provider-status {
    margin-left: auto;
}

.provider-actions {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

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

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

/* 快速操作样式 */
.quick-actions {
    margin: 3rem 0;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.action-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.action-icon {
    font-size: 2rem;
}

.action-info h3 {
    margin: 0;
    color: #333;
}

.action-info p {
    margin: 0.5rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* 登录提示样式 */
.login-prompt {
    margin: 3rem 0;
    text-align: center;
}

.prompt-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.prompt-card h3 {
    margin: 0 0 1rem 0;
    color: #333;
}

.prompt-card p {
    margin: 0 0 1.5rem 0;
    color: #666;
}

/* API 页面样式 */
.base-url {
    font-size: 0.8rem;
}

.base-url code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.apis-grid {
    display: grid;
    gap: 1.5rem;
}

.api-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.api-method {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.api-method.GET {
    background: #d4edda;
    color: #155724;
}

.api-method.POST {
    background: #cce5ff;
    color: #004085;
}

.api-method.PUT {
    background: #fff3cd;
    color: #856404;
}

.api-method.DELETE {
    background: #f8d7da;
    color: #721c24;
}

.api-info {
    flex: 1;
}

.api-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.api-description {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.api-details {
    margin: 1rem 0;
}

.api-endpoint {
    margin-bottom: 1rem;
}

.api-endpoint code {
    background: #f8f9fa;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.api-params,
.api-headers {
    margin-bottom: 1rem;
}

.params-list,
.headers-list {
    margin: 0.5rem 0 0 0;
    padding-left: 1.2rem;
}

.params-list li,
.headers-list li {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.params-list code,
.headers-list code {
    background: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
}

.api-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* 配置页面样式 */
.providers-config {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.provider-config-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.config-fields {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-control {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-text {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #666;
}

.config-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem 0;
    border-top: 1px solid #eee;
    margin-top: 2rem;
}

.help-section {
    margin-top: 3rem;
}

.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.help-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.help-card h3 {
    margin: 0 0 1rem 0;
    color: #333;
}

.help-card ul {
    margin: 0;
    padding-left: 1.2rem;
}

.help-card li {
    margin: 0.5rem 0;
    color: #666;
}

.help-card a {
    color: #007bff;
    text-decoration: none;
}

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

.security-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.security-notice h3 {
    margin: 0 0 1rem 0;
    color: #856404;
}

.security-notice ul {
    margin: 0;
    padding-left: 1.2rem;
}

.security-notice li {
    margin: 0.5rem 0;
    color: #856404;
}

/* 历史记录页面样式 */
.filters-section {
    margin: 2rem 0;
}

.filters-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}

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

/* 列表视图样式 */
.history-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.list-header {
    display: grid;
    grid-template-columns: 120px 100px 1fr 100px 120px 150px;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #eee;
}

.history-item {
    display: grid;
    grid-template-columns: 120px 100px 1fr 100px 120px 150px;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background-color 0.2s;
}

.history-item:hover {
    background: #f8f9fa;
}

.time-main {
    font-weight: 500;
    color: #333;
}

.time-sub {
    font-size: 0.8rem;
    color: #666;
}

.provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.provider-badge.baidu {
    background: #e3f2fd;
    color: #1976d2;
}

.provider-badge.quark {
    background: #f3e5f5;
    color: #7b1fa2;
}

.api-name {
    font-weight: 500;
    color: #333;
}

.api-endpoint {
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
}

.response-time {
    font-family: monospace;
    font-weight: 500;
}

/* 时间线视图样式 */
.history-timeline {
    position: relative;
    padding-left: 2rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-date {
    font-weight: 600;
    color: #495057;
    margin: 2rem 0 1rem 0;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    display: inline-block;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-marker.success {
    background: #28a745;
}

.timeline-marker.error {
    background: #dc3545;
}

.timeline-content {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-left: 1rem;
}

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

.timeline-time {
    font-weight: 500;
    color: #333;
}

.timeline-provider {
    font-size: 0.9rem;
    color: #666;
}

.timeline-status {
    margin-left: auto;
}

.timeline-api {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.3rem;
}

.timeline-endpoint {
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
    margin-bottom: 0.5rem;
}

.timeline-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
}

.error-msg {
    color: #dc3545;
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
}

/* 分页样式 */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    text-align: right;
}

/* 测试进度样式 */
.test-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    width: 0;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.test-result {
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.test-result.success {
    color: #28a745;
}

.test-result.error {
    color: #dc3545;
}

/* 结果标签页样式 */
.result-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tab-pane {
    display: none;
}

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

.tab-pane pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    max-height: 300px;
    font-size: 0.9rem;
}

/* 详情模态框样式 */
.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    margin: 0 0 1rem 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-item label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

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

.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 300px;
}

.error-block {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 1rem;
    color: #721c24;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .providers-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .list-header,
    .history-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .list-header {
        display: none;
    }
    
    .history-item {
        display: block;
        padding: 1rem;
    }
    
    .history-item > div {
        margin-bottom: 0.5rem;
    }
    
    .timeline-content {
        margin-left: 0.5rem;
    }
    
    .help-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .provider-header {
        flex-direction: column;
        text-align: center;
    }
    
    .action-card {
        flex-direction: column;
        text-align: center;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .api-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .api-actions {
        flex-direction: column;
    }
    
    .config-actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}