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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f7f8fa;
    color: #1f2937;
    line-height: 1.6;
    padding-top: 64px; /* 为固定导航栏留出空间 */
    padding-bottom: 80px; /* 避免内容被固定购买栏遮挡 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #37b5c1;
}

.nav a {
    margin-left: 20px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
}

.nav a:hover {
    color: #37b5c1;
}

.section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.area-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.area-tab {
    padding: 8px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.area-tab:hover {
    border-color: #37b5c1;
    color: #37b5c1;
}

.area-tab.active {
    background: #37b5c1;
    color: #fff;
    border-color: #37b5c1;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.region-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.region-header:hover {
    background: rgba(55, 181, 193, 0.03);
}

.region-name {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
}

.region-delay {
    font-size: 13px;
    color: #6b7280;
}

.region-arrow {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.lines-container {
    display: none;
    border-top: 1px solid #f3f4f6;
    padding: 0 12px 12px;
    gap: 8px;
    flex-direction: column;
}

.line-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #374151;
}

.line-card:hover {
    background: rgba(55, 181, 193, 0.05);
}

.line-card.active {
    background: rgba(55, 181, 193, 0.1);
    border: 1px solid #37b5c1;
}

.line-name {
    font-weight: 500;
}

.line-tag {
    padding: 2px 8px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 4px;
    font-size: 12px;
}

.line-tag.blue {
    background: #dbeafe;
    color: #2563eb;
}

.line-tag.defense-tag {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 500;
}

.line-tooltip {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.machine-options {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.machine-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.machine-btn {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.traffic-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.traffic-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.traffic-options {
    display: flex;
    gap: 8px;
}

.traffic-card {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.traffic-card:hover {
    border-color: #37b5c1;
}

.traffic-card.active {
    background: rgba(55, 181, 193, 0.1);
    border-color: #37b5c1;
    color: #37b5c1;
}

.machine-btn:hover {
    border-color: #37b5c1;
    color: #37b5c1;
}

.machine-btn.active {
    background: rgba(55, 181, 193, 0.1);
    border-color: #37b5c1;
    color: #37b5c1;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.plan-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.plan-card:hover {
    border-color: #37b5c1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 181, 193, 0.15);
}

.plan-card.active {
    border-color: #37b5c1;
    background: rgba(55, 181, 193, 0.03);
}

.plan-card.out-of-stock {
    position: relative;
}

.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.plan-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
}

.plan-price {
    font-size: 28px;
    font-weight: bold;
    color: #37b5c1;
    margin-bottom: 8px;
}

.plan-machine-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.plan-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    min-width: 70px;
}

.spec-label {
    font-size: 12px;
    color: #6b7280;
    margin-right: 4px;
}

.spec-value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-right: 16px;
}

.spec-value:last-child {
    margin-right: 0;
}

.disk-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.disk-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.disk-item label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.disk-item select,
.disk-item input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

/* 数字输入框容器 */
.number-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.number-input-wrapper input[type="number"] {
    flex: 1;
    border: none;
    text-align: center;
    padding: 10px 8px;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
}

.number-input-wrapper input[type="number"]::-webkit-outer-spin-button,
.number-input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-wrapper input[type="number"]:focus {
    outline: none;
}

/* 加减按钮 */
.number-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.number-btn:hover {
    background: linear-gradient(135deg, #37b5c1 0%, #2d9aa5 100%);
    color: #fff;
}

.number-btn:active {
    transform: scale(0.95);
}

.number-btn.minus {
    border-right: 1px solid #e5e7eb;
}

.number-btn.plus {
    border-left: 1px solid #e5e7eb;
}

.disk-item select:focus,
.disk-item input:focus {
    outline: none;
    border-color: #37b5c1;
    box-shadow: 0 0 0 3px rgba(55, 181, 193, 0.1);
}

.note {
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.8;
}

.ip-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ip-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.ip-item label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.ip-item select,
.ip-item input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.ip-item .number-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.ip-item .number-input-wrapper input[type="number"] {
    flex: 1;
    border: none;
    text-align: center;
    padding: 10px 8px;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
}

.ip-item .number-input-wrapper input[type="number"]::-webkit-outer-spin-button,
.ip-item .number-input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ip-item .number-input-wrapper input[type="number"]:focus {
    outline: none;
}

.ip-item .number-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.ip-item .number-btn:hover {
    background: linear-gradient(135deg, #37b5c1 0%, #2d9aa5 100%);
    color: #fff;
}

.ip-item .number-btn:active {
    transform: scale(0.95);
}

.ip-item .number-btn.minus {
    border-right: 1px solid #e5e7eb;
}

.ip-item .number-btn.plus {
    border-left: 1px solid #e5e7eb;
}

.ip-item select:focus,
.ip-item input:focus {
    outline: none;
    border-color: #37b5c1;
    box-shadow: 0 0 0 3px rgba(55, 181, 193, 0.1);
}

.os-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0;
}

.os-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.os-tab:hover {
    color: #37b5c1;
}

.os-tab.active {
    color: #37b5c1;
    border-bottom-color: #37b5c1;
}

.os-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.os-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.os-card:hover {
    border-color: #37b5c1;
}

.os-card.active {
    border-color: #37b5c1;
    background: rgba(55, 181, 193, 0.03);
}

.os-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.os-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
}

.os-version {
    font-size: 12px;
    color: #9ca3af;
}

.app-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #111827;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.app-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.app-card:hover {
    border-color: #37b5c1;
}

.app-card.active {
    border-color: #37b5c1;
    background: rgba(55, 181, 193, 0.03);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.app-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #37b5c1;
    flex-shrink: 0;
}

.app-card img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 8px;
}

/* 应用图标容器 + 兜底徽章（图标加载失败时显示首字母） */
.app-icon-wrap {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.app-card .app-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.app-badge {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #37b5c1, #1e8a99);
    box-shadow: 0 2px 6px rgba(55, 181, 193, 0.25);
    user-select: none;
}

.app-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.app-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.app-vars {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.app-var-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.app-var-item label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.app-var-item select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    max-width: 180px;
}

.app-var-item input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    max-width: 180px;
}

.app-var-item input[type="text"]:focus {
    outline: none;
    border-color: #37b5c1;
}

.app-var-item input[type="text"]::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

.app-var-item input[type="text"].placeholder-text {
    color: #9ca3af;
}

.app-var-item select:focus {
    outline: none;
    border-color: #37b5c1;
}

/* 购买时长选择器样式（购买栏内横排，无卡片） */
.duration-selector {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.duration-label {
    display: inline-block;
    margin: 0;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.duration-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.duration-option {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 5px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.duration-option:hover {
    border-color: #37b5c1;
    background: #f0f9f9;
}

.duration-option.active {
    border-color: #37b5c1;
    background: #e6f7f7;
    box-shadow: 0 0 0 3px rgba(55, 181, 193, 0.1);
}

.duration-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0;
    white-space: nowrap;
}

.duration-discount {
    display: inline-block;
    padding: 2px 8px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
}

.order-section {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1160px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 8px 30px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 0;
    z-index: 100;
}

.price-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.price-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-item span:first-child {
    font-size: 13px;
    color: #6b7280;
}

.price-item .price {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.price-total {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 24px;
    border-left: 2px solid #e5e7eb;
}

.price-total span:first-child {
    font-size: 14px;
    color: #6b7280;
}

.price-total .price {
    font-size: 22px;
    font-weight: bold;
    color: #ef4444;
}

.order-btn {
    padding: 10px 40px;
    background: linear-gradient(135deg, #37b5c1 0%, #2d9aa5 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(55, 181, 193, 0.4);
}

.footer {
    text-align: center;
    padding: 30px 0;
    color: #9ca3af;
    font-size: 13px;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav a {
        margin: 5px 10px;
    }

    .section {
        padding: 20px;
    }

    .city-grid,
    .plan-grid,
    .os-list,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .order-section {
        flex-direction: column;
        text-align: center;
        width: calc(100% - 20px);
        padding: 8px 12px;
        gap: 10px;
    }

    .price-summary {
        justify-content: center;
        gap: 16px;
    }

    .duration-options {
        justify-content: center;
    }
}