/**
 * 模型价格页面样式
 * 紧凑精致风格
 */

.models-price-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 12px;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.update-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.update-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.update-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.version-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    backdrop-filter: blur(10px);
}

.version-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
}

.version-date {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

/* 公司切换器 */
.company-switcher {
    margin-bottom: 15px;
    padding: 0;
}

.switcher-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.company-tab {
    display: inline-block;
    padding: 6px 14px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.company-tab:hover {
    background: #e9ecef;
    color: #212529;
}

.company-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

/* 公司概览 - 两列布局 */
.companies-overview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.company-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

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

.company-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e1e8ed;
    flex-shrink: 0;
}

.company-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.company-link {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.company-link:hover {
    color: #667eea;
}

.company-version {
    font-size: 0.75rem;
    color: #7f8c8d;
    padding: 2px 6px;
    background: white;
    border-radius: 10px;
    font-weight: 500;
}

.company-card-body {
    padding: 1rem;
    padding-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.company-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 1rem;
    background: white;
    border-top: 1px solid #f1f3f5;
    flex-shrink: 0;
}

.model-count {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.view-all-btn {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.25);
}

/* 迷你价格表格 */
.price-mini-table-wrapper {
    flex: 1;
    overflow-y: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.price-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.price-mini-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.price-mini-table th {
    padding: 6px 5px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.75rem;
}

.price-mini-table .col-model {
    width: 50%;
    text-align: left;
    min-width: 120px;
}

.price-mini-table .col-type {
    width: 25%;
    text-align: left;
    min-width: 60px;
}

.price-mini-table .col-price {
    width: 25%;
    text-align: right;
    font-weight: 600;
    color: #667eea;
    font-size: 0.75rem;
    min-width: 100px;
}

.price-mini-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.15s ease;
    height: 32px;
}

.price-mini-table tbody tr:hover {
    background-color: #f8f9fa;
}

.price-mini-table td {
    padding: 5px;
    vertical-align: middle;
}

.price-mini-table .col-model td {
    width: 50%;
}

.price-mini-table .col-type td {
    width: 25%;
}

.price-mini-table .col-price td {
    width: 25%;
}

.price-mini-table .model-name {
    font-weight: 500;
    color: #2c3e50;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.price-mini-table .price-type {
    font-size: 0.75rem;
    color: #7f8c8d;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 搜索过滤区域 */
.search-section {
    margin-bottom: 15px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
}

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

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.search-results {
    text-align: right;
    font-size: 0.85rem;
    color: #7f8c8d;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-results span {
    font-weight: 600;
    color: #667eea;
}

/* 价格分组卡片 */
.price-groups-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.price-group-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.2s ease;
}

.price-group-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.price-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e1e8ed;
}

.price-group-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.price-group-count {
    font-size: 0.85rem;
    color: #7f8c8d;
    padding: 4px 8px;
    background: white;
    border-radius: 10px;
    font-weight: 500;
}

.price-group-body {
    padding: 0;
}

/* 价格表格 */
.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.price-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.price-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e8ed;
    white-space: nowrap;
    font-size: 0.8rem;
}

.price-table th.col-model {
    width: 35%;
}

.price-table th.col-type {
    width: 15%;
}

.price-table th.col-input {
    width: 20%;
}

.price-table th.col-output {
    width: 20%;
}

.price-table th.col-action {
    width: 10%;
}

.price-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.15s ease;
    height: 48px;
}

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

.price-table td {
    padding: 10px 8px;
    vertical-align: middle;
}

.price-table .col-model {
    width: 35%;
    min-width: 200px;
    text-align: left;
}

.price-table .col-type {
    width: 15%;
    min-width: 80px;
    text-align: left;
}

.price-table .col-input {
    width: 20%;
    min-width: 120px;
    text-align: left;
}

.price-table .col-output {
    width: 20%;
    min-width: 120px;
    text-align: left;
}

.price-table .col-action {
    width: 10%;
    min-width: 80px;
    text-align: center;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.model-name-text {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.main-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

.pricing-note {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 4px;
}

.price-table .col-type {
    width: 100px;
    text-align: left;
}

.pricing-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.pricing-type-badge.type-token {
    background: #e3f2fd;
    color: #1976d2;
}

.pricing-type-badge.type-request {
    background: #f3e5f5;
    color: #7b1fa2;
}

.pricing-type-badge.type-tier {
    background: #fff3e0;
    color: #e65100;
}

.pricing-type-badge.type-custom {
    background: #e8f5e9;
    color: #1b5e20;
}

.pricing-type-badge.type-voice {
    background: #fce4ec;
    color: #c2185b;
}

.pricing-type-badge.type-image {
    background: #fff8e1;
    color: #f57f17;
}

.price-table .col-input,
.price-table .col-output {
    min-width: 120px;
    text-align: left;
}

.price-value {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
}

.price-unit {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-left: 4px;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 30px 20px;
    color: #95a5a6;
    font-size: 0.85rem;
}

/* 区间定价详情按钮 */
.view-tier-details-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-tier-details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

/* 区间定价详情行 */
.tier-details-row {
    background: #f8f9fa;
}

.tier-details-cell {
    padding: 0;
}

.tier-details-content {
    padding: 15px 20px;
}

.tier-details-content h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
}

/* 区间定价表格 */
.tier-pricing-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tier-row {
    background: white;
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border: 1px solid #e1e8ed;
}

.tier-name {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
    min-width: 120px;
    flex-shrink: 0;
}

.tier-prices {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tier-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.8rem;
}

/* 三层嵌套结构的子类型样式 */
.tier-subtype {
    padding: 6px 0;
    border-bottom: 1px dashed #e1e8ed;
}

.tier-subtype:last-child {
    border-bottom: none;
}

.tier-subtype-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 4px;
}

.tier-price-inline {
    display: inline-block;
    margin-right: 12px;
    font-size: 0.75rem;
}

.tier-price-label-inline {
    color: #7f8c8d;
    font-weight: 500;
}

.tier-price-label {
    color: #7f8c8d;
    font-weight: 500;
}

.tier-price-value {
    color: #2c3e50;
    font-weight: 600;
}

.no-tier-data {
    color: #95a5a6;
    font-size: 0.8rem;
    margin: 0;
}

/* 区间定价悬浮层 */
.tier-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none !important;
}

.tier-modal.active {
    display: block !important;
}

.tier-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.tier-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.tier-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tier-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.tier-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
    line-height: 1;
}

.tier-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tier-modal-body {
    padding: 20px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.tier-modal-model-name {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e8ed;
}

.tier-modal-pricing {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tier-modal-tier-row {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e1e8ed;
}

.tier-modal-tier-name {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.tier-modal-tier-prices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tier-modal-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.tier-modal-price-label {
    color: #7f8c8d;
}

.tier-modal-price-value {
    color: #2c3e50;
    font-weight: 500;
}

/* Modal三层嵌套结构样式 */
.tier-modal-subtype {
    padding: 6px 0;
    border-bottom: 1px dashed #dee2e6;
}

.tier-modal-subtype:last-child {
    border-bottom: none;
}

.tier-modal-subtype-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.75rem;
    display: block;
    margin-bottom: 4px;
}

.tier-modal-price-inline {
    display: inline-block;
    margin-right: 12px;
    font-size: 0.75rem;
}

.tier-modal-price-label-inline {
    color: #95a5a6;
    font-weight: 500;
}

/* 概览页的查看详情按钮 */
.view-tier-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-tier-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

/* 主容器 */
.main-container {
    padding: 0;
}

/* 来源信息行 */
.page-source-section {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    text-align: center;
}

.source-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.price-note {
    color: #7f8c8d;
    font-weight: 500;
}

.source-divider {
    color: #bdc3c7;
}

.source-label {
    color: #7f8c8d;
    font-weight: 500;
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.source-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.external-icon {
    font-size: 1rem;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .company-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .models-price-page {
        padding: 8px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }

    .price-table {
        font-size: 0.75rem;
    }

    .price-table th,
    .price-table td {
        padding: 6px 5px;
    }

    .version-badge {
        flex-direction: row;
        gap: 6px;
        font-size: 0.85rem;
    }

    .company-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .company-row {
        gap: 10px;
    }

    .search-container {
        flex-direction: column;
        gap: 10px;
    }

    .search-results {
        text-align: center;
    }

    .price-table .col-model {
        min-width: 150px;
    }

    .model-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .company-card {
        min-height: 260px;
    }
}
