        body {
            background: #f5f5f5;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
        }

        .main-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }

        .header {
            background: white;
            padding: 16px 24px;
            margin-bottom: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .header h1 {
            font-size: 24px;
            color: #ee4d2d;
            margin: 0;
            font-weight: 600;
        }

        .content-grid {
            display: grid;
            grid-template-columns: 1fr 400px;
            gap: 20px;
        }

        .left-panel {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            padding: 24px;
        }

        .right-panel {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            padding: 24px;
            position: sticky;
            top: 20px;
            height: fit-content;
        }

        .step-section {
            margin-bottom: 32px;
            padding-bottom: 32px;
            border-bottom: 1px solid #f0f0f0;
        }

        .step-section:last-child {
            border-bottom: none;
        }

        .step-header {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .step-number {
            width: 32px;
            height: 32px;
            background: #ee4d2d;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            margin-right: 12px;
        }

        .step-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
        }

        .form-row {
            margin-bottom: 20px;
        }

        .form-label {
            font-size: 14px;
            color: #666;
            margin-bottom: 8px;
            display: block;
        }

        .form-label .required {
            color: #ee4d2d;
            margin-right: 4px;
        }

        .input-with-suffix {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .input-with-suffix input {
            flex: 1;
        }

        .input-suffix {
            color: #999;
            font-size: 14px;
        }

        .result-card {
            padding: 16px;
            background: #f8f9fa;
            border-radius: 8px;
            margin-bottom: 12px;
        }

        .result-label {
            font-size: 13px;
            color: #666;
            margin-bottom: 4px;
        }

        .result-value {
            font-size: 20px;
            font-weight: 600;
            color: #333;
        }

        .result-value.highlight {
            color: #ee4d2d;
        }

        .result-value.success {
            color: #52c41a;
        }

        .currency-convert {
            font-size: 12px;
            color: #999;
            margin-top: 4px;
        }

        .fee-detail {
            margin-top: 16px;
        }

        .fee-section {
            border: 1px solid #e8e8e8;
            border-radius: 8px;
            margin-bottom: 8px;
            overflow: hidden;
        }

        .fee-section-header {
            padding: 12px 16px;
            background: #fafafa;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .fee-section-header:hover {
            background: #f0f0f0;
        }

        .fee-section-content {
            padding: 12px 16px;
            display: none;
        }

        .fee-section-content.show {
            display: block;
        }

        .fee-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            font-size: 13px;
        }

        .fee-item-label {
            color: #666;
        }

        .fee-item-value {
            color: #333;
            font-weight: 500;
        }

        .calculate-btn {
            width: 100%;
            height: 44px;
            background: #ee4d2d;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.3s;
        }

        .calculate-btn:hover {
            background: #d73211;
        }

        .info-tip {
            font-size: 12px;
            color: #999;
            margin-top: 8px;
            line-height: 1.6;
        }

        .v-input {
            width: 100%;
            height: 40px;
            padding: 0 12px;
            border: 1px solid #d9d9d9;
            border-radius: 4px;
            font-size: 14px;
        }

        .v-input:focus {
            outline: none;
            border-color: #ee4d2d;
        }

        .v-select {
            width: 100%;
            height: 40px;
            padding: 0 12px;
            border: 1px solid #d9d9d9;
            border-radius: 4px;
            font-size: 14px;
            background: white;
        }

        /* 履约渠道选择 */
        .channel-tabs {
            display: flex;
            background: #f5f5f5;
            border-radius: 8px;
            padding: 4px;
            gap: 4px;
        }

        .channel-tab {
            flex: 1;
            padding: 12px 16px;
            border: none;
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #666;
            transition: all 0.3s;
            text-align: center;
        }

        .channel-tab:hover {
            background: rgba(238, 77, 45, 0.1);
            color: #ee4d2d;
        }

        .channel-tab.active {
            background: white;
            color: #ee4d2d;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .channel-tab.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .channel-tab .tab-icon {
            font-size: 20px;
            display: block;
            margin-bottom: 4px;
        }

        .channel-tab .tab-label {
            font-size: 13px;
        }

        .channel-tab .tab-rate {
            font-size: 11px;
            color: #999;
            margin-top: 2px;
        }

        .channel-tab.active .tab-rate {
            color: #ee4d2d;
        }

        /* 渠道对比视图 */
        .channel-comparison {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-top: 16px;
        }

        .channel-card {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 16px;
            text-align: center;
            border: 2px solid transparent;
            transition: all 0.3s;
        }

        .channel-card.best {
            border-color: #52c41a;
            background: #f6ffed;
        }

        .channel-card.unsupported {
            opacity: 0.5;
            background: #fafafa;
        }

        .channel-card .card-title {
            font-size: 14px;
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
        }

        .channel-card .card-profit {
            font-size: 24px;
            font-weight: 700;
            color: #52c41a;
        }

        .channel-card .card-profit-rate {
            font-size: 13px;
            color: #666;
        }

        .channel-card .card-price {
            font-size: 12px;
            color: #999;
            margin-top: 4px;
        }

        .channel-card .best-badge {
            display: inline-block;
            padding: 2px 8px;
            background: #52c41a;
            color: white;
            font-size: 11px;
            border-radius: 10px;
            margin-top: 8px;
        }

        .channel-card.unsupported .card-profit {
            font-size: 14px;
            color: #999;
        }

        /* 头程运费配置区域 */
        .first-leg-config {
            background: #fff7e6;
            border: 1px solid #ffd591;
            border-radius: 8px;
            padding: 16px;
            margin-top: 16px;
        }

        .first-leg-config .config-title {
            font-size: 14px;
            font-weight: 600;
            color: #fa8c16;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .battery-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: #f5f5f5;
            border-radius: 6px;
            cursor: pointer;
            user-select: none;
        }

        .battery-toggle input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .battery-toggle.active {
            background: #fff1f0;
            border: 1px solid #ffa39e;
        }

        /* 费用对比表格 */
        .fee-comparison-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 12px;
            font-size: 13px;
        }

        .fee-comparison-table th,
        .fee-comparison-table td {
            padding: 8px 12px;
            border: 1px solid #e8e8e8;
            text-align: center;
        }

        .fee-comparison-table th {
            background: #fafafa;
            font-weight: 600;
            color: #333;
        }

        .fee-comparison-table td {
            background: white;
        }

        .fee-comparison-table .highlight {
            background: #e6fffb;
            font-weight: 600;
        }

        /* 模式切换 */
        .mode-switcher {
            display: flex;
            background: #f0f0f0;
            border-radius: 20px;
            padding: 4px;
            margin-bottom: 16px;
        }

        .mode-btn {
            flex: 1;
            padding: 8px 16px;
            border: none;
            background: transparent;
            border-radius: 16px;
            cursor: pointer;
            font-size: 13px;
            color: #666;
            transition: all 0.3s;
        }

        .mode-btn:hover {
            color: #333;
        }

        .mode-btn.active {
            background: #ee4d2d;
            color: white;
        }

        /* ==================== 模板管理栏 ==================== */
        .template-bar {
            background: #fff;
            border-bottom: 1px solid #eee;
            padding: 10px 20px;
        }

        .template-bar-inner {
            max-width: 1200px;
            margin: 0 auto;
        }

        .template-controls {
            display: flex;
            align-items: flex-end;
            gap: 12px;
            flex-wrap: wrap;
        }

        .template-field {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .template-field label {
            font-size: 11px;
            color: #888;
            font-weight: 500;
        }

        .template-select {
            padding: 6px 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 13px;
            background: #fff;
            min-width: 160px;
        }

        .template-select:focus {
            outline: none;
            border-color: #4a90d9;
        }

        .template-actions {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .tmpl-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 6px 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            background: #fff;
            font-size: 12px;
            color: #555;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .tmpl-btn:hover:not(:disabled) {
            background: #f5f5f5;
            border-color: #bbb;
        }

        .tmpl-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .tmpl-btn-save { color: #2563eb; border-color: #93c5fd; }
        .tmpl-btn-save:hover:not(:disabled) { background: #eff6ff; }

        .tmpl-btn-default { color: #d97706; border-color: #fcd34d; }
        .tmpl-btn-default:hover:not(:disabled) { background: #fffbeb; }

        .tmpl-btn-delete { color: #dc2626; border-color: #fca5a5; }
        .tmpl-btn-delete:hover:not(:disabled) { background: #fef2f2; }

        .template-status {
            margin-top: 6px;
            font-size: 12px;
        }

        .status-success { color: #16a34a; }
        .status-error { color: #dc2626; }

        @media (max-width: 768px) {
            .template-controls { flex-direction: column; align-items: stretch; }
            .template-actions { justify-content: flex-start; }
        }

        /* ==================== 自动模式 ==================== */
        .auto-toggle {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            margin-left: 12px;
            font-size: 12px;
            font-weight: normal;
            color: #1890ff;
            cursor: pointer;
            user-select: none;
        }
        .auto-toggle input[type="checkbox"] {
            width: 14px;
            height: 14px;
            accent-color: #1890ff;
            cursor: pointer;
        }

        .auto-placeholder {
            padding: 10px 12px;
            background: #f0f7ff;
            border: 1px dashed #91caff;
            border-radius: 8px;
            color: #1890ff;
            font-size: 13px;
        }

        /* ==================== 自定义弹窗 ==================== */
        .custom-dialog-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.45);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            animation: dialogFadeIn 0.2s ease;
        }
        @keyframes dialogFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .custom-dialog {
            background: #fff;
            border-radius: 12px;
            padding: 24px;
            width: 400px;
            max-width: 90vw;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
            animation: dialogSlideIn 0.25s ease;
        }
        @keyframes dialogSlideIn {
            from { opacity: 0; transform: translateY(-12px) scale(0.96); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .custom-dialog-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 16px;
        }
        .custom-dialog-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #d9d9d9;
            border-radius: 8px;
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }
        .custom-dialog-input:focus {
            border-color: #1890ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
        }
        .custom-dialog-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }
        .custom-dialog-btn {
            padding: 8px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }
        .custom-dialog-btn.cancel {
            background: #f5f5f5;
            color: #666;
        }
        .custom-dialog-btn.cancel:hover {
            background: #e8e8e8;
        }
        .custom-dialog-btn.confirm {
            background: #1890ff;
            color: #fff;
        }
        .custom-dialog-btn.confirm:hover {
            background: #40a9ff;
        }
        .custom-dialog-btn.confirm.danger {
            background: #ff4d4f;
        }
        .custom-dialog-btn.confirm.danger:hover {
            background: #ff7875;
        }

        /* ===== Refactored from inline styles ===== */
        .back-link {
            color: #666;
            text-decoration: none;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .header-version {
            color: #666;
        }
        .template-field-min {
            min-width: 200px;
        }
        .fetch-rate-btn {
            padding: 8px 16px;
            background: #52c41a;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            white-space: nowrap;
        }
        .icon-info { color: #1890ff; }
        .text-success-sm { color: #52c41a; }
        .text-danger-sm { color: #ee4d2d; }
        .currency-prefix {
            color: #666;
            margin-right: 8px;
        }
        .profit-input-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }
        .min-profit-wrap { margin-top: 12px; }
        .form-label-tight { margin-bottom: 6px; }
        .input-with-suffix-narrow { max-width: 220px; }
        .info-tip-spacing { margin-top: 8px; }
        .price-info-sep { margin-left: 8px; }
        .free-shipping-checkbox-label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
        }
        .checkbox-lg {
            width: 18px;
            height: 18px;
        }
        .free-shipping-warning {
            color: #e74c3c;
            font-size: 12px;
            margin-top: 4px;
        }
        .custom-rate-toggle-row {
            background: #f8f9fa;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 24px;
        }
        .custom-rate-toggle-label {
            display: flex;
            align-items: center;
            cursor: pointer;
            user-select: none;
        }
        .custom-rate-checkbox {
            width: 18px;
            height: 18px;
            margin-right: 8px;
            cursor: pointer;
        }
        .custom-rate-text {
            font-weight: 600;
            color: #333;
        }
        .custom-rate-tip { margin-left: 26px; }
        .rate-badge-custom {
            color: #52c41a;
            font-size: 12px;
            margin-left: 8px;
        }
        .rate-badge-auto {
            color: #1890ff;
            font-size: 12px;
            margin-left: 8px;
        }
        .right-panel-title {
            margin: 0 0 20px 0;
            font-size: 18px;
            font-weight: 600;
        }
        .result-card-highlight-success {
            border-left: 4px solid #52c41a;
        }
        .result-value-info { color: #1890ff; }
        .ad-section-divider {
            margin: 24px 0 12px 0;
            padding-top: 24px;
            border-top: 2px solid #e8e8e8;
        }
        .ad-section-title {
            margin: 0 0 16px 0;
            font-size: 15px;
            font-weight: 600;
            color: #666;
        }
        .fee-section-title { font-weight: 500; }
        .fee-section-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .fee-section-amount {
            color: #ee4d2d;
            font-weight: 600;
        }
        .fee-section-icon { font-size: 20px; }
        .auto-fee-detail-placeholder {
            padding: 20px;
            background: #f0f7ff;
            border-radius: 8px;
            text-align: center;
            color: #1890ff;
            margin-top: 16px;
        }
        .info-tip-mt {
            margin-top: 16px;
        }
        .rate-input-custom { border-color: #52c41a; }
        .rate-input-locked {
            background: #f5f5f5;
            color: #666;
        }
