﻿
        :root {
            --bg-primary: #f8fafc;
            --bg-secondary: #ffffff;
            --bg-card: rgba(255, 255, 255, 0.95);
            --border: #e2e8f0;
            --border-active: #818cf8;
            --text-primary: #0f172a;
            --text-secondary: #334155;
            --text-muted: #64748b;
            --accent: #4f46e5;
            --accent-glow: rgba(79, 70, 229, 0.2);
            --success: #16a34a;
            --danger: #dc2626;
            --wb-tag: #7c3aed;
            --wb-tag-bg: rgba(124, 58, 237, 0.1);
            --manual-tag: #0284c7;
            --manual-tag-bg: rgba(2, 132, 199, 0.1);
            --gradient-1: linear-gradient(135deg, #4f46e5, #7c3aed);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            overflow-x: hidden;
            padding-bottom: 50px;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:
                radial-gradient(2px 2px at 20px 30px, rgba(0, 0, 0, 0.05), transparent),
                radial-gradient(2px 2px at 40px 70px, rgba(0, 0, 0, 0.03), transparent),
                radial-gradient(1px 1px at 90px 40px, rgba(0, 0, 0, 0.05), transparent),
                radial-gradient(1px 1px at 130px 80px, rgba(0, 0, 0, 0.03), transparent),
                radial-gradient(2px 2px at 160px 30px, rgba(0, 0, 0, 0.05), transparent);
            background-size: 200px 100px;
            animation: twinkle 4s ease-in-out infinite alternate;
            z-index: -1;
        }

        @keyframes twinkle {
            0% {
                opacity: 0.5;
            }

            100% {
                opacity: 1;
            }
        }

        .container {
            max-width: 1100px;
            margin: 0 auto;
            padding: 24px 20px;
            position: relative;
        }

        .header {
            text-align: center;
            margin-bottom: 32px;
        }

        .header h1 {
            font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
            font-size: 1.8rem;
            font-weight: 700;
            background: var(--gradient-1);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 6px;
        }

        .header p {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .lang-switch {
            margin-top: 0;
            display: inline-flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 8px;
            padding: 8px 12px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 999px;
            position: absolute;
            top: 24px;
            right: 20px;
            z-index: 5;
        }

        .lang-switch label {
            font-size: 0.78rem;
            color: var(--text-secondary);
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
        }

        .lang-switch select {
            padding: 6px 10px;
            border-radius: 999px;
            font-size: 0.82rem;
            border: 1px solid var(--border);
            background: var(--bg-secondary);
            color: var(--text-primary);
            min-width: 106px;
            white-space: nowrap;
        }

        .tab-nav {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 10px;
            margin-bottom: 14px;
        }

        .tab-btn {
            border: 1px solid var(--border);
            background: var(--bg-card);
            color: var(--text-secondary);
            border-radius: 12px;
            padding: 11px 10px;
            font-size: 0.86rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .tab-btn:hover {
            border-color: var(--border-active);
            color: var(--text-primary);
        }

        .tab-btn.active {
            border-color: transparent;
            background: var(--gradient-1);
            color: #fff;
            box-shadow: 0 8px 18px var(--accent-glow);
        }

        .tab-panel {
            display: none;
            animation: fade-slide 0.2s ease;
        }

        .tab-panel.active {
            display: block;
            position: relative;
            z-index: 20;
        }

        @keyframes fade-slide {
            from {
                opacity: 0;
                transform: translateY(4px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .card {
            background: var(--bg-card);
            backdrop-filter: blur(12px);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 20px;
            position: relative;
        }

        .card-title {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .form-group label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            font-weight: 500;
            line-height: 1.2;
        }

        .label-with-hint {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            width: fit-content;
        }

        .hint-icon {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            border: 1px solid var(--border);
            cursor: help;
            user-select: none;
        }

        /* 搜索选择器 */
        .ship-select-wrap {
            position: relative;
        }

        .ship-select-input {
            width: 100%;
            padding: 10px 38px 10px 14px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 10px;
            color: var(--text-primary);
            font-size: 0.9rem;
            outline: none;
            cursor: text;
        }

        .ship-clear-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--bg-secondary);
            color: var(--text-muted);
            font-size: 14px;
            line-height: 20px;
            text-align: center;
            cursor: pointer;
            display: none;
            z-index: 2;
            padding: 0;
        }

        .ship-clear-btn.show {
            display: inline-block;
        }

        .ship-clear-btn:hover {
            color: var(--danger);
            border-color: rgba(220, 38, 38, 0.35);
            background: rgba(220, 38, 38, 0.06);
        }

        .ship-select-input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .ship-select-input::placeholder {
            color: var(--text-muted);
        }

        .ship-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            left: 0;
            right: 0;
            max-height: 280px;
            overflow-y: auto;
            background: var(--bg-secondary);
            border: 1px solid var(--border-active);
            border-radius: 10px;
            z-index: 9999;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
            /* 浅色下拉阴影 */
        }

        .ship-dropdown.open {
            display: block;
        }

        .ship-option {
            padding: 10px 14px;
            cursor: pointer;
            font-size: 0.85rem;
            border-bottom: 1px solid var(--border);
            /* 使用基础边界颜色 */
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .ship-option:hover {
            background: var(--bg-primary);
            /* 浅色模式下悬停使用更暗一点的底层背景色 */
        }

        .ship-option .zh {
            color: var(--text-primary);
        }

        .ship-option .en {
            color: var(--text-muted);
            font-size: 0.78rem;
            margin-left: 6px;
        }

        .ship-option .msrp {
            color: var(--text-secondary);
            font-size: 0.78rem;
            margin-left: 12px;
        }

        .ship-dropdown::-webkit-scrollbar {
            width: 6px;
        }

        .ship-dropdown::-webkit-scrollbar-track {
            background: transparent;
        }

        .ship-dropdown::-webkit-scrollbar-thumb {
            background: var(--border-active);
            border-radius: 3px;
        }

        /* 配置行 */
        .config-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px;
        }

        input[type="number"],
        input[type="text"],
        select {
            width: 100%;
            padding: 10px 14px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 10px;
            color: var(--text-primary);
            font-size: 0.9rem;
            outline: none;
        }

        input:focus {
            border-color: var(--accent);
        }

        /* 排除飞船 */
        .exclude-input-wrap {
            display: flex;
            gap: 8px;
            align-items: stretch;
        }

        .exclude-input-wrap .ship-select-wrap {
            flex: 1;
        }

        .excluded-tags {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
            max-height: 80px;
            overflow-y: auto;
            align-content: flex-start;
            padding-right: 4px;
        }

        .excluded-tags::-webkit-scrollbar {
            width: 4px;
        }

        .excluded-tags::-webkit-scrollbar-track {
            background: transparent;
        }

        .excluded-tags::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 2px;
        }

        .excluded-tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            background: rgba(220, 38, 38, 0.05);
            border: 1px solid rgba(220, 38, 38, 0.2);
            border-radius: 20px;
            font-size: 0.75rem;
            color: var(--danger);
            white-space: nowrap;
            width: fit-content;
        }

        .excluded-tag .rm {
            cursor: pointer;
            color: var(--text-muted);
        }

        .excluded-tag .rm:hover {
            color: var(--danger);
        }

        /* 手动 WB */
        .manual-wb-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 12px;
        }

        .manual-wb-row {
            display: grid;
            grid-template-columns: 1fr 130px 40px;
            gap: 10px;
            align-items: center;
            background: var(--bg-secondary);
            padding: 10px 14px;
            border-radius: 10px;
            border: 1px solid rgba(2, 132, 199, 0.15);
        }

        .manual-wb-info {
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .manual-wb-info .ship-label {
            color: var(--text-primary);
            font-weight: 500;
        }

        .manual-wb-info .ship-en {
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .manual-wb-info .arrow {
            color: var(--accent);
            font-weight: 700;
            margin: 0 2px;
        }

        .manual-wb-price-col {
            font-size: 0.9rem;
            color: var(--success);
            font-weight: 600;
        }

        #selectedHangarList {
            max-height: 340px;
            overflow-y: auto;
            padding-right: 4px;
        }

        #selectedHangarList::-webkit-scrollbar {
            width: 6px;
        }

        #selectedHangarList::-webkit-scrollbar-track {
            background: transparent;
        }

        #selectedHangarList::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        .selected-hangar-row {
            grid-template-columns: minmax(0, 1fr) minmax(120px, 220px) 84px 40px;
        }

        .selected-hangar-price {
            font-size: 0.86rem;
            color: var(--success);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            line-height: 1.2;
            min-width: 0;
            word-break: break-word;
        }

        .selected-hangar-price .tag {
            white-space: nowrap;
        }

        .force-toggle-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        .force-toggle-label {
            font-size: 0.72rem;
            color: var(--text-muted);
            line-height: 1;
        }

        .force-switch {
            position: relative;
            display: inline-block;
            width: 36px;
            height: 20px;
        }

        .force-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .force-switch .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #cbd5e1;
            transition: .18s;
            border-radius: 999px;
        }

        .force-switch .slider:before {
            position: absolute;
            content: "";
            height: 14px;
            width: 14px;
            left: 3px;
            top: 3px;
            background-color: #fff;
            transition: .18s;
            border-radius: 50%;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .force-switch input:checked+.slider {
            background: var(--accent);
        }

        .force-switch input:checked+.slider:before {
            transform: translateX(16px);
        }

        .btn-remove {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: none;
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-remove:hover {
            background: rgba(220, 38, 38, 0.1);
        }

        .btn {
            background: var(--gradient-1);
            border: none;
            color: white;
            border-radius: 10px;
            padding: 0 16px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
        }

        .btn:hover {
            filter: brightness(1.1);
        }

        .btn-calculate {
            width: 100%;
            padding: 14px;
            font-size: 1.1rem;
            border-radius: 12px;
            margin-top: 10px;
            font-weight: 600;
        }

        .btn-calculate:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .error-msg {
            background: rgba(220, 38, 38, 0.05);
            border: 1px solid rgba(220, 38, 38, 0.2);
            border-radius: 10px;
            padding: 12px;
            color: var(--danger);
            margin-top: 16px;
            display: none;
        }

        /* 结果区 */
        .result-section {
            display: none;
            margin-top: 20px;
            position: relative;
            z-index: 5;
        }

        .info-footer {
            margin-top: 18px;
            position: relative;
            z-index: 4;
        }

        .footer-sections {
            display: grid;
            gap: 12px;
        }

        .footer-panel {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 14px 16px;
        }

        .footer-subtitle {
            margin: 0 0 10px;
            font-size: 0.92rem;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: 0.01em;
        }

        .footer-list {
            margin: 0;
            padding: 0;
            list-style: none;
            color: var(--text-secondary);
            font-size: 0.92rem;
            line-height: 1.7;
            display: grid;
            gap: 7px;
        }

        .footer-list li {
            position: relative;
            padding-left: 18px;
        }

        .footer-list li::before {
            content: "•";
            position: absolute;
            left: 0;
            top: 0;
            color: var(--accent);
            font-weight: 700;
        }

        .footer-links {
            display: grid;
            gap: 10px;
            font-size: 0.92rem;
            color: var(--text-secondary);
        }

        .footer-link-item {
            line-height: 1.62;
        }

        .footer-link-label {
            color: var(--text-primary);
            font-weight: 600;
            margin-right: 6px;
        }

        .footer-link-desc {
            color: var(--text-muted);
            margin-left: 4px;
        }

        .footer-links strong {
            color: var(--text-primary);
        }

        .qr-hover {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            border-bottom: 1px dashed var(--border-active);
        }

        .qr-popup {
            display: none;
            position: absolute;
            left: 50%;
            bottom: calc(100% + 10px);
            transform: translateX(-50%);
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 10px;
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
            z-index: 30;
            width: 200px;
        }

        .qr-popup img {
            width: 316px;
            max-width: 100%;
            height: auto;
            display: block;
            border-radius: 6px;
            margin: 0 auto;
            object-fit: cover;
            background: #fff;
        }

        .qr-popup span {
            display: block;
            margin-top: 6px;
            text-align: center;
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.35;
        }

        .qr-hover:hover .qr-popup {
            display: block;
        }

        .summary-bar {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 20px;
        }

        .summary-item {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 18px;
            text-align: center;
        }

        .summary-item .label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .summary-item .value {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .summary-item.savings {
            border-color: rgba(22, 163, 74, 0.3);
        }

        .summary-item.savings .value {
            color: var(--success);
        }

        .path-timeline {
            padding-left: 20px;
            position: relative;
        }

        .path-timeline::before {
            content: '';
            position: absolute;
            left: 5px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: linear-gradient(to bottom, var(--accent), var(--success));
        }

        .path-step {
            position: relative;
            margin-bottom: 16px;
        }

        .path-step .dot {
            position: absolute;
            left: -20px;
            top: 16px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--accent);
            box-shadow: 0 0 8px var(--accent-glow);
        }

        .step-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 16px;
        }

        .step-card.has-wb {
            border-left: 3px solid var(--wb-tag);
        }

        .step-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        .step-ships {
            flex: 1;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .step-tags {
            display: flex;
            gap: 6px;
        }

        .tag {
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 600;
        }

        .tag-wb {
            background: var(--wb-tag-bg);
            color: var(--wb-tag);
        }

        .tag-manual {
            background: var(--manual-tag-bg);
            color: var(--manual-tag);
        }

        .step-details {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }

        .step-detail .label {
            font-size: 0.7rem;
            color: var(--text-muted);
        }

        .step-detail .val {
            font-size: 0.9rem;
            font-weight: 600;
        }

        .step-detail .val.standard {
            text-decoration: line-through;
            color: var(--text-secondary);
        }

        .step-detail .val.savings {
            color: var(--success);
        }

        .wb-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
            margin-top: 12px;
        }

        .wb-table th,
        .wb-table td {
            padding: 8px;
            text-align: left;
            border-bottom: 1px solid var(--border);
        }

        .wb-table td {
            color: var(--text-secondary);
        }

        .wb-table .savings {
            color: var(--success);
        }

        /* ===== 库存同步 Modal ===== */
        .hangar-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .hangar-modal-box {
            background: var(--bg-card);
            border-radius: 16px;
            border: 1px solid var(--border);
            width: 90%;
            max-width: 620px;
            max-height: 82vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
        }

        .hangar-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
        }

        .hangar-modal-header h3 {
            margin: 0;
            font-size: 1rem;
        }

        .hangar-modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px 20px;
        }

        .hangar-modal-footer {
            display: flex;
            gap: 8px;
            padding: 12px 20px;
            border-top: 1px solid var(--border);
            justify-content: flex-end;
        }

        .modal-section-title {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-muted);
            margin: 4px 0 8px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .hangar-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 7px 8px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.15s;
        }

        .hangar-item:hover:not(.added) {
            background: var(--bg-secondary);
        }

        .hangar-item.added {
            opacity: 0.8;
        }

        .hangar-item .item-ships {
            flex: 1;
            font-size: 0.85rem;
        }

        .hangar-item .item-price {
            font-size: 0.8rem;
            color: var(--text-muted);
            white-space: nowrap;
        }

        .hangar-item input[type=checkbox] {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
            accent-color: var(--accent);
        }

        @media (max-width: 960px) {
            .tab-nav {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .summary-bar {
                grid-template-columns: 1fr;
            }

            .step-details {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 680px) {
            .tab-nav {
                grid-template-columns: 1fr;
            }

            .container {
                padding: 16px 12px;
            }

            .header {
                padding-right: 0;
            }

            .lang-switch {
                position: static;
                margin: 10px auto 0;
                display: inline-flex;
            }

            .card {
                padding: 16px;
            }

            .manual-wb-row {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .selected-hangar-row {
                grid-template-columns: 1fr;
            }

            .footer-list {
                font-size: 0.9rem;
            }

            .qr-popup {
                width: 255px;
                left: 50%;
                transform: translateX(-50%);
            }

            .qr-popup img {
                width: 235px;
            }
        }
    
