/* ========================================
   价格计算器通用样式
   ======================================== */

/* 页面容器 */
.calculator-page {
    background: #f5f7fa;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* 顶部导航 */
.calc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    margin: 20px 0 10px;
}

.page-desc {
    font-size: 16px;
    opacity: 0.9;
}

/* 面包屑导航 */
.breadcrumb-nav {
    font-size: 14px;
    margin-bottom: 10px;
}

.breadcrumb-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-nav a:hover {
    color: white;
}

.breadcrumb-nav .separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-nav .current {
    color: white;
    font-weight: 500;
}

/* 计算器布局 */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

/* 配置面板 */
.config-panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.config-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e8e8e8;
}

.config-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 24px;
}

.config-content {
    margin-left: 34px;
}

/* 区域选择网格 */
.region-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.region-option {
    cursor: pointer;
}

.region-option input {
    display: none;
}

.region-label {
    display: block;
    padding: 12px 20px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
    font-size: 14px;
}

.region-option input:checked + .region-label {
    border-color: #667eea;
    background: #f0f3ff;
    color: #667eea;
    font-weight: 600;
}

/* 规格类型标签 */
.spec-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.spec-type-tab {
    padding: 10px 20px;
    border: 2px solid #e8e8e8;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.spec-type-tab.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.spec-instances {
    display: none;
}

.spec-instances.active {
    display: block;
}

.spec-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* 实例网格 */
.instance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.instance-option {
    cursor: pointer;
}

.instance-option input {
    display: none;
}

.instance-card {
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.3s;
}

.instance-option input:checked + .instance-card {
    border-color: #667eea;
    background: #f0f3ff;
}

.instance-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.instance-specs {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.spec-item {
    font-size: 13px;
    color: #666;
}

.spec-label {
    color: #999;
}

.instance-price {
    font-size: 16px;
    font-weight: 600;
    color: #ff6b6b;
}

/* 下拉选择框 */
.storage-type-select,
.bandwidth-type-select,
.version-select,
.domain-select {
    margin-bottom: 20px;
}

.storage-type-select label,
.bandwidth-type-select label,
.version-select label,
.domain-select label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.storage-type-select select,
.bandwidth-type-select select,
.version-select select,
.domain-select select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.storage-type-select select:focus,
.bandwidth-type-select select:focus,
.version-select select:focus,
.domain-select select:focus {
    outline: none;
    border-color: #667eea;
}

/* 输入框组 */
.storage-size-input,
.bandwidth-size-input,
.quantity-input,
.traffic-input,
.bandwidth-input,
.qps-input,
.domain-input {
    margin-bottom: 15px;
}

.storage-size-input label,
.bandwidth-size-input label,
.quantity-input label,
.traffic-input label,
.bandwidth-input label,
.qps-input label,
.domain-input label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-minus,
.btn-plus {
    width: 40px;
    height: 40px;
    border: 2px solid #e8e8e8;
    background: white;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-minus:hover,
.btn-plus:hover {
    border-color: #667eea;
    color: #667eea;
}

.input-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

/* 计费周期网格 */
.billing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.billing-option {
    cursor: pointer;
}

.billing-option input {
    display: none;
}

.billing-card {
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.billing-option input:checked + .billing-card {
    border-color: #667eea;
    background: #f0f3ff;
}

.billing-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.billing-discount {
    font-size: 12px;
    color: #ff6b6b;
    font-weight: 600;
}

/* 价格面板 */
.price-panel {
    position: sticky;
    top: 20px;
}

.price-summary {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.summary-list {
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.item-label {
    color: #666;
}

.item-value {
    color: #333;
    font-weight: 500;
}

.price-breakdown {
    padding: 20px 0;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.breakdown-item.discount .breakdown-value {
    color: #52c41a;
}

.total-price {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.price-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.currency {
    font-size: 24px;
    color: #ff6b6b;
    font-weight: 600;
}

.amount {
    font-size: 48px;
    color: #ff6b6b;
    font-weight: 700;
    line-height: 1;
}

.period {
    font-size: 16px;
    color: #666;
}

.price-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-buy {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-cart {
    width: 100%;
    padding: 15px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cart:hover {
    background: #f0f3ff;
}

.price-tips {
    background: #f5f7fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.price-tips p {
    margin: 5px 0;
}

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

    .price-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .region-grid,
    .instance-grid,
    .billing-grid {
        grid-template-columns: 1fr;
    }

    .spec-type-tabs {
        flex-direction: column;
    }

    .spec-type-tab {
        width: 100%;
    }
}
