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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.5;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0px 40px 0px; 
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    min-height: 100vh;
}

.cart-main {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    border: 1px solid #f0f0f0;
}

.cart-sidebar {
    background: #fafafa;
    border-radius: 16px;
    padding: 28px;
    border: 1px solid #f0f0f0;
    height: fit-content;
    position: sticky;
    top: 40px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.section {
    margin-bottom: 48px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.section-title i {
    color: #666;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 30px;
    height: 2px;
    background: #333;
    border-radius: 1px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 180px));
}

.grid-3 {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 16px;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.card:hover {
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card.active {
    border-color: #333;
    background: #f8f8f8;
}

.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.card.disabled:hover {
    border-color: #e8e8e8;
    box-shadow: none;
}

/* 服务类型卡片 */
.type-card {
    min-height: 80px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    padding: 20px 24px !important;
    text-align: center !important;
}

.type-icon {
    font-size: 24px;
    color: #999;
    transition: color 0.2s ease;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.card:hover .type-icon,
.card.active .type-icon {
    color: #333;
}

.type-content {
    flex: 0;
    text-align: center;
}

.type-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    text-align: center;
    white-space: nowrap;
}

.type-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-top: 4px;
    text-align: center;
}

/* 地区卡片 */
.region-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    min-height: 80px !important;
    padding: 20px 24px !important;
    text-align: center !important;
}

.region-flag {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
    position: relative;
}

.region-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flag-icon {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.flag-fallback {
    font-size: 10px;
    font-weight: bold;
    color: #999;
    letter-spacing: 0.5px;
}

.region-content {
    flex: 0;
    text-align: center;
}

.region-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    text-align: center;
    white-space: nowrap;
}

.region-subtitle {
    font-size: 12px;
    color: #999;
}

/* 节点卡片 */
.node-card {
    min-height: 80px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    padding: 20px 24px !important;
    text-align: center !important;
}

.node-flag {
    width: 28px;
    height: 21px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
    position: relative;
}

.node-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.node-content {
    flex: 0;
    text-align: center;
}

.node-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    text-align: center;
    white-space: nowrap;
}

.node-subtitle {
    font-size: 12px;
    color: #999;
}

.node-info-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
}

.node-info-box i {
    color: #6c757d;
    margin-top: 2px;
    flex-shrink: 0;
}

/* 套餐卡片 */
.package-card {
    min-height: 200px !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 20px;
    align-items: stretch !important;
    gap: 16px;
}

.package-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0px !important;
    gap: 12px;
    flex-shrink: 0;
    min-width: auto;
}

.package-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.stock-badge {
    background: #6b8e6b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    flex-shrink: 0;
}

.stock-badge.out-of-stock {
    background: #999;
}

.package-description {
    flex: 1;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.5;
    margin-bottom: 0px;
    padding: 0;
}

.package-price {
    text-align: left;
    padding-top: 16px;
    border-top: 1px solid #e8eaed;
    padding-left: 0;
    border-left: none;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    min-width: auto;
    flex-shrink: 0;
}

.price-label {
    font-size: 13px;
    color: #5f6368;
    font-weight: 500;
}

.price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.price-period {
    font-size: 13px;
    color: #5f6368;
    font-weight: 500;
}

/* 周期卡片 */
.cycle-card {
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cycle-period {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

.cycle-price {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

.card.active .cycle-period {
    color: #333;
}

.card.active .cycle-price {
    color: #333;
}

/* 侧边栏 */
.sidebar-header {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-header i {
    font-size: 16px;
    color: #666;
}

.sidebar-header::after {
    display: none;
}

.config-panel {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f8f8f8;
}

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

.config-item:first-child {
    padding-top: 0;
}

.config-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-label i {
    font-size: 13px;
    color: #999;
    width: 16px;
    text-align: center;
}

.config-value {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    text-align: right;
}

.total-price {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.continue-btn {
    width: 100%;
    background: linear-gradient(135deg, #5a6a5a 0%, #6b7c6b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(90, 106, 90, 0.3);
}

.continue-btn:hover {
    background: linear-gradient(135deg, #4a5a4a 0%, #5a6a5a 100%);
    box-shadow: 0 6px 16px rgba(90, 106, 90, 0.4);
    transform: translateY(-1px);
}

.continue-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.continue-btn i {
    font-size: 14px;
}

/* 优惠券部分 */
.coupon-section {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 20px;
}

.coupon-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.coupon-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.coupon-input:focus {
    outline: none;
    border-color: #333;
}

.coupon-btn {
    background: #6b7c6b;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.coupon-btn:hover {
    background: #5a6a5a;
}

.coupon-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.coupon-success {
    background: linear-gradient(135deg, #6b7c6b 0%, #5a6a5a 100%);
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    box-shadow: 0 4px 16px rgba(107, 124, 107, 0.25);
    font-weight: 500;
    margin-top: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coupon-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.coupon-success i {
    font-size: 16px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.coupon-success span {
    flex: 1;
    line-height: 1.4;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading i {
    font-size: 32px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 16px;
    font-weight: 500;
}

.error-message {
    background: #d4c5c5;
    color: #6b4c4c;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 28px;
    text-align: center;
    border: 1px solid #c9b3b3;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.empty-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.empty-description {
    font-size: 14px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .cart-container {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 24px;
    }
    
    .cart-sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 768px) {
    .cart-main,
    .cart-sidebar {
        padding: 24px;
        border-radius: 8px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .total-price {
        font-size: 28px;
    }
    
    .grid-2,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr !important;
    }
    
    /* 移动端套餐卡片恢复竖向排列 */
    .package-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        min-height: 160px;
    }
    
    .package-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: auto;
    }
    
    .package-description {
        padding: 0;
        flex: 1;
    }
    
    .package-price {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        text-align: left;
        padding-left: 0;
        padding-top: 16px;
        border-left: none;
        border-top: 1px solid #e8eaed;
        min-width: auto;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 480px) {
    .cart-container {
        padding: 16px;
        gap: 16px;
        grid-template-columns: 1fr;
    }
    
    .cart-main,
    .cart-sidebar {
        padding: 20px;
    }
    
    .section {
        margin-bottom: 32px;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .type-card,
    .region-card,
    .node-card {
        padding: 16px;
        min-height: 60px;
        gap: 12px;
    }
    
    .config-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px 0;
    }
    
    .config-value {
        text-align: left;
        font-size: 14px;
    }
    
    .config-label {
        align-self: flex-start;
        font-size: 13px;
    }
    
    .type-card,
    .region-card,
    .node-card {
        flex-direction: row;
        text-align: left;
    }
    
    .total-price {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .continue-btn {
        padding: 14px;
        font-size: 16px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .package-card {
        min-height: 140px;
        padding: 16px;
    }
    
    .cycle-card {
        min-height: 60px;
        padding: 12px;
    }
    
    .coupon-input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .coupon-input,
    .coupon-btn {
        width: 100%;
        padding: 14px 16px;
    }
    
    .message-toast {
        left: 12px;
        right: 12px;
        top: 12px;
        min-width: auto;
        max-width: none;
        font-size: 14px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.section {
    animation: fadeIn 0.3s ease-out;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.flag-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.region-code {
    font-size: 9px;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 服务条款样式 */
.terms-agreement {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.terms-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.terms-checkbox input:checked + .checkmark {
    background: #007bff;
    border-color: #007bff;
}

.terms-checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms-text {
    color: #666;
}

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

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

/* 侧边栏服务条款样式 */
.sidebar-terms {
    margin: 16px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.sidebar-terms-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-terms-checkbox input[type="checkbox"] {
    display: none;
}

.sidebar-checkmark {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-terms-checkbox input:checked + .sidebar-checkmark {
    background: #5a6a5a;
    border-color: #5a6a5a;
}

.sidebar-terms-checkbox input:checked + .sidebar-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.sidebar-terms-text {
    color: #6b7280;
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
}

.sidebar-terms-text a {
    color: #5a6a5a;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-terms-text a:hover {
    text-decoration: underline;
}

/* 按钮禁用状态 */
button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Vue.js 消息提示框样式 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 320px;
    max-width: 400px;
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateX(100%);
    animation: slideInRight 0.4s ease-out forwards;
}

.message-toast:hover {
    transform: translateY(-2px) translateX(0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 成功消息 */
.message-success {
    background: linear-gradient(135deg, #6b7c6b 0%, #5a6a5a 100%);
    border: 1px solid #4a5a4a;
    color: #ffffff;
}

/* 警告消息 */
.message-warning {
    background: linear-gradient(135deg, #8b7355 0%, #7a6249 100%);
    border: 1px solid #6b5140;
    color: #ffffff;
}

/* 错误消息 */
.message-error {
    background: linear-gradient(135deg, #8b6b6b 0%, #7a5a5a 100%);
    border: 1px solid #6b4c4c;
    color: #ffffff;
}

/* 消息内容 */
.message-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    position: relative;
}

.message-content i.fas {
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.message-content span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-right: 12px;
}

/* 关闭按钮 */
.message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.8;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* 滑入动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .message-toast {
        left: 16px;
        right: 16px;
        top: 16px;
        min-width: auto;
        max-width: none;
        animation: slideInDown 0.4s ease-out forwards;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
