/* soul/soul.css */

.soul-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.hero-main {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 14px;
    font-weight: 700;
}

.hero-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: #ffffff;
    color: #2563eb;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.hero-back:hover {
    background: #eff6ff;
}

.rule-box {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #dbe4ff;
}

.rule-title {
    margin-bottom: 8px;
    color: #1e3a8a;
    font-weight: 700;
}

.rule-box ul {
    margin: 0;
    padding-left: 20px;
    color: #475467;
    line-height: 1.8;
}

.sub-note {
    margin-top: 8px;
    color: #6b7280;
    font-size: 14px;
}

.panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 22px;
}

.panel h3 {
    margin: 0 0 14px 0;
    font-size: 17px;
    color: #111827;
}

.panel p {
    margin: 0;
    color: #667085;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.level-limit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 9px 14px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #047857;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.solution-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.solution-status.ok {
    background: #ecfdf3;
    color: #047857;
}

.solution-status.warn {
    background: #fffbeb;
    color: #b45309;
}

.form-section {
    padding: 18px 0;
    border-top: 1px solid #eef2f7;
}

.form-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.form-grid input[type="number"] {
    height: 40px;
    border: 1px solid #d7dce5;
    border-radius: 9px;
    padding: 0 10px;
    font-size: 15px;
    background: #fff;
}

.form-grid input[type="number"]:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.form-grid input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-unit {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.checkbox-label {
    justify-content: center;
    min-height: 68px;
    padding: 11px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fbfdff;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.checkbox-label span {
    color: #374151;
    font-size: 14px;
}

.checkbox-label.disabled-option {
    background: #f9fafb;
    color: #9ca3af;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

button,
.back-button {
    height: 44px;
    border: none;
    border-radius: 10px;
    padding: 0 24px;
    background: #2563eb;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.back-button:hover {
    background: #1d4ed8;
}

button:disabled {
    background: #9db4ee;
    cursor: not-allowed;
}

button.secondary {
    background: #eef2ff;
    color: #1d4ed8;
}

button.secondary:hover {
    background: #dbeafe;
}

.status {
    margin-bottom: 20px;
    padding: 13px 16px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    line-height: 1.6;
}

.status.error {
    background: #fff1f2;
    color: #be123c;
}

.status.success {
    background: #ecfdf3;
    color: #047857;
}

.status.warning {
    background: #fffbeb;
    color: #b45309;
}

.hidden {
    display: none;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.result-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #fbfdff;
}

.result-card.primary {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border-color: #bfdbfe;
}

.result-card.success {
    background: linear-gradient(135deg, #ecfdf3, #ffffff);
    border-color: #bbf7d0;
}

.result-card.warning {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
    border-color: #fde68a;
}

.result-card .label {
    color: #667085;
    font-size: 14px;
    margin-bottom: 8px;
}

.result-card .value {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.material {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.material span {
    background: #f2f4f7;
    padding: 8px 12px;
    border-radius: 999px;
    color: #344054;
    font-size: 14px;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
}

.material-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fbfdff;
}

.material-card .name {
    color: #475467;
    font-size: 14px;
    margin-bottom: 8px;
}

.material-card .count {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.material-card .cost {
    margin-top: 6px;
    color: #667085;
    font-size: 13px;
}

.section-desc {
    margin-bottom: 16px !important;
    color: #667085;
    line-height: 1.7;
}

.step {
    position: relative;
    border-left: 5px solid #2563eb;
    background: #fbfdff;
    border-radius: 13px;
    padding: 15px 16px 15px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.step.group-a {
    border-left-color: #2563eb;
}

.step.group-b {
    border-left-color: #7c3aed;
}

.step.group-final {
    border-left-color: #f97316;
}

.step-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #111827;
}

.bead-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.bead-code.group-a {
    background: #2563eb;
}

.bead-code.group-b {
    background: #7c3aed;
}

.bead-code.group-final {
    background: #f97316;
}

.step-line {
    color: #475467;
    line-height: 1.85;
}

.cost-reason {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: #344054;
    line-height: 1.8;
    font-size: 14px;
}

.flow-lane {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 14px;
    background: #fbfdff;
    border: 1px solid #e5e7eb;
}

.flow-lane.group-a {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.flow-lane.group-b {
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.flow-lane.group-final {
    border-color: #fed7aa;
    background: #fff7ed;
}

.flow-title {
    font-weight: 800;
    margin-bottom: 12px;
}

.flow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.flow-card {
    min-width: 150px;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.flow-card .code {
    font-weight: 800;
    margin-bottom: 6px;
}

.flow-card .meta {
    color: #475467;
    font-size: 13px;
    line-height: 1.6;
}

.flow-arrow {
    font-size: 22px;
    color: #64748b;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 11px 10px;
    text-align: center;
    font-size: 14px;
}

th {
    background: #f8fafc;
    color: #475467;
    white-space: nowrap;
}

tbody tr:first-child {
    background: #f0fdf4;
}

tbody tr:first-child td {
    font-weight: 700;
    color: #065f46;
}

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

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .material-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .soul-hero {
        flex-direction: column;
    }

    .panel-title-row {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .card-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .material-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .button-row {
        flex-direction: column;
    }

    button,
    .back-button {
        width: 100%;
    }

    .flow-row {
        flex-direction: column;
        align-items: stretch;
    }

    .flow-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
}
/* =========================================================
   V5.4.0-theme
   元魂珠页面美化配套版
   风格对齐：红烧模拟器页面
   只改视觉，不改算法
========================================================= */

:root {
    --gold: #f7d98a;
    --gold2: #b98732;
    --dark: #111;
    --paper: #f6ecd3;
    --paper2: rgba(255, 245, 220, 0.94);
    --line: rgba(212, 175, 55, 0.25);
    --green1: #155a51;
    --green2: #1f8371;
    --brown1: #6c481f;
    --brown2: #ba7c26;
    --red1: #842f25;
    --red2: #bd6040;
    --ink: #24170c;
    --muted: #5c4934;
}

* {
    box-sizing: border-box;
}

body {
    background:
        linear-gradient(rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.92)),
        url("https://images.unsplash.com/photo-1518562180175-34a163b1a9a6?q=80&w=2070");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--gold);
    min-height: 100vh;
    font-family:
        "Microsoft YaHei",
        "PingFang SC",
        "Noto Sans SC",
        sans-serif;
}

/* 顶部导航统一 */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    background: rgba(10, 10, 10, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 999;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-menu a {
    color: #d4c090;
    text-decoration: none;
    transition: 0.2s;
    font-size: 15px;
}

.nav-menu a:hover {
    color: var(--gold);
}

.nav-menu a.active-nav {
    color: var(--gold) !important;
    font-weight: 800;
}

/* 页面主体外壳 */
main,
.container {
    width: min(1220px, calc(100% - 32px));
    margin: 40px auto;
}

.shell,
.soul-shell,
.page-shell {
    padding: 20px;
    background: rgba(15, 15, 15, 0.72);
    border: 1px solid rgba(255, 215, 120, 0.18);
    border-radius: 24px;
    backdrop-filter: blur(10px);
}

/* Hero区域 */
.soul-hero,
.hero {
    background: var(--paper2);
    color: var(--ink);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 230, 160, 0.45);
}

.soul-hero::after,
.hero::after {
    content: "魂";
    position: absolute;
    right: 20px;
    bottom: -34px;
    font-size: 180px;
    color: rgba(180, 90, 50, 0.08);
    font-family: KaiTi, STKaiti, serif;
    line-height: 1;
    pointer-events: none;
}

.soul-hero h1,
.hero h1 {
    font-size: 54px;
    line-height: 1.12;
    margin-bottom: 18px;
    color: var(--ink);
    position: relative;
    z-index: 1;
}

.soul-hero p,
.hero p,
.soul-hero .sub,
.hero .sub {
    line-height: 1.9;
    color: var(--muted);
    position: relative;
    z-index: 1;
}

.soul-hero .tag,
.soul-hero .kicker,
.kicker {
    display: inline-block;
    background: linear-gradient(90deg, #a23f2d, #77311f);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-weight: 700;
}

/* 规则说明 */
.rule-box {
    background: linear-gradient(180deg, #1f5048, #123833);
    color: white;
    border: 1px solid rgba(247, 217, 138, 0.18);
    border-radius: 20px;
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.rule-box strong,
.rule-box b {
    color: var(--gold);
}

/* 面板统一成纸面卡片 */
.panel {
    background: var(--paper2) !important;
    color: var(--ink) !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 230, 160, 0.45) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

.panel h2 {
    color: var(--ink) !important;
    font-weight: 900 !important;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* 输入区 */
.form-grid {
    gap: 16px !important;
}

.field,
.form-item,
.input-group {
    color: var(--ink);
}

label {
    color: var(--ink);
    font-weight: 700;
}

input,
select,
textarea {
    background: #fffaf0 !important;
    color: var(--ink) !important;
    border: 1px solid rgba(111, 75, 31, 0.18) !important;
    border-radius: 8px !important;
    min-height: 42px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold2) !important;
    box-shadow: 0 0 0 3px rgba(185, 135, 50, 0.18);
}

.checkbox-label {
    background: rgba(111, 75, 31, 0.07);
    border: 1px solid rgba(111, 75, 31, 0.12);
    color: var(--ink);
    border-radius: 10px;
    padding: 10px 12px;
}

/* 按钮 */
.button-row {
    gap: 12px;
}

button,
.btn,
#solveBtn {
    background: linear-gradient(135deg, var(--green1), var(--green2)) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    min-height: 44px;
    padding: 0 20px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 10px 22px rgba(21, 90, 81, 0.25);
}

button:hover,
.btn:hover,
#solveBtn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

#resetBtn,
button.secondary,
.btn.secondary {
    background: linear-gradient(135deg, var(--brown1), var(--brown2)) !important;
}

/* 状态栏 */
.status {
    background: rgba(255, 245, 220, 0.92) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(255, 230, 160, 0.45) !important;
    border-radius: 14px !important;
}

.status.success {
    border-color: rgba(31, 131, 113, 0.45) !important;
    background: rgba(231, 250, 244, 0.95) !important;
}

.status.error {
    border-color: rgba(189, 96, 64, 0.55) !important;
    background: rgba(255, 235, 230, 0.95) !important;
}

/* 最优结果卡片 */
.card-grid {
    gap: 18px !important;
}

.result-card {
    background: rgba(255, 250, 240, 0.95) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(111, 75, 31, 0.1) !important;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.result-card::before {
    content: "";
    display: block;
    height: 8px;
    background: linear-gradient(135deg, var(--green1), var(--green2));
}

.result-card.primary::before {
    background: linear-gradient(135deg, var(--green1), var(--green2));
}

.result-card.success::before {
    background: linear-gradient(135deg, var(--brown1), var(--brown2));
}

.result-card.warning::before {
    background: linear-gradient(135deg, var(--red1), var(--red2));
}

.result-card .label {
    color: var(--muted) !important;
    font-weight: 800 !important;
}

.result-card .value {
    color: var(--ink) !important;
    font-weight: 900 !important;
}

/* 材料摘要 */
.material,
.material-grid {
    color: var(--ink);
}

.material span {
    background: rgba(111, 75, 31, 0.07);
    color: var(--ink);
    border: 1px solid rgba(111, 75, 31, 0.1);
    border-radius: 999px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    margin: 4px;
    font-weight: 700;
}

.material-card {
    background: rgba(255, 250, 240, 0.95) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(111, 75, 31, 0.1) !important;
    border-radius: 16px !important;
}

/* 操作步骤 */
.step {
    background: rgba(255, 250, 240, 0.95) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(111, 75, 31, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.step-title {
    color: var(--ink) !important;
    font-weight: 900 !important;
}

.bead-code {
    background: linear-gradient(135deg, var(--green1), var(--green2)) !important;
    color: white !important;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 900;
}

.bead-code.group-b {
    background: linear-gradient(135deg, var(--brown1), var(--brown2)) !important;
}

.bead-code.group-final {
    background: linear-gradient(135deg, var(--red1), var(--red2)) !important;
}

.cost-reason,
.formula {
    background: rgba(111, 75, 31, 0.08) !important;
    color: var(--ink) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(111, 75, 31, 0.08);
}

/* 流程图 */
.flow-lane {
    background: rgba(255, 250, 240, 0.92) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(111, 75, 31, 0.1) !important;
    border-radius: 18px !important;
}

.flow-title {
    color: var(--ink) !important;
    font-weight: 900 !important;
}

.flow-card {
    background: rgba(255, 245, 220, 0.96) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(111, 75, 31, 0.14) !important;
    border-radius: 14px !important;
}

.flow-card .code {
    color: var(--ink) !important;
    font-weight: 900;
}

.flow-card .meta {
    color: var(--muted) !important;
}

.flow-arrow {
    color: var(--gold2) !important;
    font-weight: 900;
}

/* Top表 */
.table-wrap,
.top-table-wrap {
    background: rgba(255, 250, 240, 0.95);
    border-radius: 16px;
    overflow: auto;
    border: 1px solid rgba(111, 75, 31, 0.1);
}

table {
    color: var(--ink) !important;
    border-collapse: collapse;
}

thead th {
    background: linear-gradient(135deg, var(--green1), var(--green2)) !important;
    color: white !important;
    font-weight: 900 !important;
}

tbody td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

tbody tr:hover {
    background: rgba(111, 75, 31, 0.06) !important;
}

.route-summary-cell {
    color: #065f46 !important;
    font-weight: 900 !important;
}

/* 小屏适配 */
@media (max-width: 980px) {
    main,
    .container {
        width: min(100% - 24px, 1220px);
        margin: 24px auto;
    }

    .soul-hero h1,
    .hero h1 {
        font-size: 40px;
    }

    .shell,
    .soul-shell,
    .page-shell {
        padding: 14px;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .soul-hero,
    .hero {
        padding: 24px;
    }

    .soul-hero h1,
    .hero h1 {
        font-size: 34px;
    }

    .soul-hero::after,
    .hero::after {
        font-size: 120px;
        right: 8px;
        bottom: -20px;
    }
}
/* =========================================================
   V5.4.1-nav-align
   元魂珠页面顶部导航与 diamond 页面统一
   并修复当前规则区文字看不清问题
========================================================= */

/* 顶部导航：完全对齐 diamond 页面 */
.topbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;

    width: 100% !important;
    height: 86px !important;

    padding: 0 30px !important;

    background: rgba(10, 10, 10, 0.96) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
    backdrop-filter: blur(10px) !important;

    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
}

.logo {
    font-size: 34px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    color: #f7d98a !important;
    letter-spacing: 1px !important;
    text-shadow: 0 0 12px rgba(247, 217, 138, 0.22) !important;
}

.nav-menu {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 28px !important;
}

.nav-menu a {
    color: #d4c090 !important;
    text-decoration: none !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    transition: 0.2s !important;
}

.nav-menu a:hover {
    color: #f7d98a !important;
}

/* 当前页面高亮：元魂珠 */
.nav-menu a.active-nav {
    color: #f7d98a !important;
    font-weight: 900 !important;
    text-shadow: 0 0 10px rgba(247, 217, 138, 0.35) !important;
}

/* 禁止其他链接被错误高亮 */
.nav-menu a:not(.active-nav) {
    text-shadow: none !important;
}

/* 去掉元魂珠原来的返回首页按钮 */
.back-home,
.return-home,
.home-btn,
.hero a[href="../index.html"],
.hero a[href="./index.html"],
.soul-hero a[href="../index.html"],
.soul-hero a[href="./index.html"] {
    display: none !important;
}

/* 页面主体位置：和 diamond 页面保持呼吸感 */
main,
.container {
    margin-top: 48px !important;
}

/* 修复当前规则区文字太暗 */
.rule-box {
    background: linear-gradient(180deg, #1f5048, #123833) !important;
    color: rgba(255, 255, 255, 0.90) !important;
    border: 1px solid rgba(247, 217, 138, 0.20) !important;
}

.rule-box,
.rule-box p,
.rule-box li,
.rule-box span {
    color: rgba(255, 255, 255, 0.86) !important;
}

.rule-box strong,
.rule-box b {
    color: #f7d98a !important;
    font-weight: 900 !important;
}

/* 当前规则标题 */
.rule-box h2,
.rule-box h3,
.rule-box .rule-title {
    color: #f7d98a !important;
    font-weight: 900 !important;
}

/* Hero 区不再放返回首页按钮后，标题居中更稳 */
.soul-hero,
.hero {
    position: relative !important;
}

/* 移动端导航 */
@media (max-width: 768px) {
    .topbar {
        height: auto !important;
        padding: 16px !important;
        flex-direction: column !important;
        gap: 14px !important;
    }

    .logo {
        font-size: 28px !important;
    }

    .nav-menu {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 16px !important;
    }

    .nav-menu a {
        font-size: 16px !important;
    }
}
/* =========================================================
   快捷计算区：珠子等级经验 / 能量等级聚能丹
========================================================= */

.quick-calc-panel {
    background: rgba(15, 24, 32, 0.92);
    border: 1px solid rgba(247, 217, 138, 0.20);
    border-radius: 10px;
    padding: 22px 28px;
    margin-bottom: 24px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 12px 30px rgba(0, 0, 0, 0.28);
}

.quick-row {
    display: grid;
    grid-template-columns: 1fr 40px 1fr 40px 1fr;
    align-items: center;
    gap: 16px;
}

.quick-row + .quick-row {
    margin-top: 18px;
}

.quick-row input {
    height: 46px;
    border: none !important;
    border-radius: 7px !important;
    background: #24465f !important;
    color: #f7d98a !important;
    font-size: 18px;
    font-weight: 800;
    padding: 0 16px;
    text-align: left;
}

.quick-row input::placeholder {
    color: rgba(247, 217, 138, 0.56);
}

.quick-row input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(247, 217, 138, 0.16);
}

.quick-row input[disabled] {
    background: #6a2b2b !important;
    color: #f7d98a !important;
    opacity: 1;
}

.quick-arrow {
    color: #ffffff;
    font-size: 28px;
    font-weight: 900;
    text-align: center;
}

@media (max-width: 768px) {
    .quick-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .quick-arrow {
        transform: rotate(90deg);
        font-size: 22px;
    }
}
/* =========================================================
   V5.5.0 two-round reference
   两轮提升参考
========================================================= */

.two-round-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.two-round-card {
    background: rgba(255, 250, 240, 0.96);
    color: var(--ink);
    border: 1px solid rgba(111, 75, 31, 0.12);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.two-round-card h3 {
    color: #111827;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 12px;
}

.two-round-card p {
    color: #5c4934;
    line-height: 1.8;
    font-weight: 700;
}

.two-round-card strong {
    color: #842f25;
    font-weight: 900;
}

.two-round-warning {
    background: linear-gradient(180deg, #1f5048, #123833);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(247, 217, 138, 0.22);
    border-radius: 16px;
    padding: 18px;
    line-height: 1.9;
    font-weight: 800;
}

.two-round-warning strong {
    color: #f7d98a;
}

@media (max-width: 980px) {
    .two-round-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   计算模式选择
========================================================= */

.mode-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 18px 0 24px;
}

.mode-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(111, 75, 31, 0.16);
    background: rgba(255, 250, 240, 0.72);
    cursor: pointer;
    transition: 0.2s;
}

.mode-card:hover {
    transform: translateY(-1px);
    border-color: rgba(185, 135, 50, 0.45);
}

.mode-card.active {
    background: linear-gradient(180deg, #1f5048, #123833);
    border-color: rgba(247, 217, 138, 0.32);
}

.mode-card input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
}

.mode-card strong {
    display: block;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 8px;
}

.mode-card span {
    display: block;
    color: #667085;
    line-height: 1.6;
    font-weight: 700;
}

.mode-card.active strong {
    color: #f7d98a;
}

.mode-card.active span {
    color: rgba(255, 255, 255, 0.86);
}

.mode-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .mode-box {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   V5.5.8 flow tree connector patch
========================================================= */

.flow-tree-wrap {
    width: 100%;
}

.flow-tree-toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.flow-tree-canvas {
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    min-height: 360px;
    padding: 20px;
    border: 1px solid rgba(191, 161, 94, 0.35);
    border-radius: 22px;
    background: rgba(255, 251, 240, 0.78);
}

.flow-tree-svg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.flow-tree-columns {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 84px;
    min-width: max-content;
}

.flow-tree-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 260px;
}

.flow-tree-col-title {
    font-size: 16px;
    font-weight: 900;
    color: #b7791f;
    margin: 0 0 4px 4px;
}

.flow-tree-node {
    width: 250px;
    min-height: 165px;
    padding: 16px 16px 14px;
    border-radius: 20px;
    background: #f8edd5;
    border: 1px solid rgba(191, 161, 94, 0.45);
    box-shadow: 0 10px 22px rgba(77, 53, 18, 0.08);
}

.flow-tree-node.base {
    background: #edf4ff;
    border-color: rgba(96, 165, 250, 0.45);
}

.flow-tree-node.fuse {
    background: #fff6e7;
    border-color: rgba(245, 158, 11, 0.45);
}

.flow-tree-node.upgrade {
    background: #faf4e8;
    border-color: rgba(180, 83, 9, 0.35);
}

.flow-tree-node.final {
    background: #eefbf3;
    border-color: rgba(22, 163, 74, 0.35);
}

.flow-tree-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.flow-tree-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.flow-tree-code.group-b {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.flow-tree-code.group-final {
    background: linear-gradient(135deg, #059669, #16a34a);
}

.flow-tree-type {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.flow-tree-relation {
    min-height: 48px;
    margin-bottom: 16px;
    color: #2b1a0e;
    line-height: 1.45;
    font-size: 18px;
    font-weight: 900;
}

.flow-tree-meta {
    color: #5b4636;
    line-height: 1.5;
    font-size: 16px;
    font-weight: 800;
}

.flow-tree-cost {
    margin-top: 8px;
    color: #b7791f;
    font-size: 16px;
    font-weight: 900;
}

.flow-tree-link {
    fill: none;
    stroke: #b7791f;
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0.95;
}

.flow-tree-empty {
    padding: 18px;
    border-radius: 14px;
    background: rgba(255, 250, 240, 0.72);
    color: #5c4934;
    font-weight: 800;
}


/* =========================================================
   V5.5.9 flow tree centering patch
========================================================= */

.flow-tree-canvas {
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    min-height: 420px;
}

.flow-tree-stage {
    position: relative;
    min-width: 100%;
}

.flow-tree-col-title-abs {
    position: absolute;
    z-index: 3;
    min-width: 80px;
}

.flow-tree-node {
    position: absolute;
    z-index: 2;
}

.flow-tree-svg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}


/* =========================================================
   V5.6.0 compact orthogonal flow tree
========================================================= */

.flow-tree-compact .flow-tree-canvas {
    min-height: 360px;
    padding: 14px;
}

.flow-tree-compact .flow-tree-stage {
    position: relative;
    min-width: 100%;
}

.flow-tree-compact .flow-tree-node {
    position: absolute;
    z-index: 2;
    padding: 12px 13px;
    border-radius: 16px;
}

.flow-tree-compact .flow-tree-svg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.flow-tree-compact .flow-tree-col-title-abs {
    position: absolute;
    z-index: 3;
    font-size: 14px;
}

.flow-tree-compact .flow-tree-head {
    margin-bottom: 8px;
}

.flow-tree-compact .flow-tree-code {
    min-width: 46px;
    height: 30px;
    font-size: 15px;
}

.flow-tree-compact .flow-tree-type {
    padding: 4px 8px;
    font-size: 11px;
}

.flow-tree-compact .flow-tree-relation {
    min-height: 38px;
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.45;
}

.flow-tree-compact .flow-tree-meta {
    font-size: 14px;
    line-height: 1.45;
}

.flow-tree-compact .flow-tree-cost {
    margin-top: 6px;
    font-size: 14px;
}

.flow-tree-link-elbow {
    fill: none;
    stroke: #b7791f;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.95;
}

/* =========================================================
   站点统一视觉与参数区分组
========================================================= */
body {
    color: var(--site-gold);
    background:
        radial-gradient(circle at 12% 8%, rgba(44, 139, 115, 0.18), transparent 30%),
        radial-gradient(circle at 88% 16%, rgba(183, 132, 47, 0.14), transparent 28%),
        linear-gradient(145deg, #06110f 0%, #0b201c 54%, #071513 100%) !important;
}

main.container {
    width: min(1360px, calc(100% - 32px)) !important;
    padding: 34px 0 72px !important;
}

.soul-hero {
    border: 1px solid var(--site-line) !important;
    border-radius: 28px !important;
    background: linear-gradient(140deg, rgba(20, 69, 59, 0.97), rgba(8, 33, 28, 0.96)) !important;
    box-shadow: var(--site-shadow) !important;
}

.soul-hero h1 { color: #fff3ca !important; }
.soul-hero p { color: #d7d1bd !important; }
.soul-hero::after { color: rgba(241, 210, 122, 0.07) !important; }

.quick-calc-panel,
.panel {
    border: 1px solid rgba(241, 210, 122, 0.20) !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.20) !important;
}

.quick-calc-panel {
    padding: 24px !important;
    background: linear-gradient(145deg, rgba(13, 45, 39, 0.98), rgba(8, 29, 25, 0.98)) !important;
}

.quick-panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.quick-panel-head h2 {
    margin: 4px 0 0;
    color: #fff0bd;
    font-size: 24px;
}

.quick-panel-head p {
    margin: 0;
    color: #b9b6a8;
    line-height: 1.6;
}

.quick-kicker {
    color: var(--site-gold);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.parameter-panel {
    padding: 28px !important;
    background: #f5eedc !important;
}

.parameter-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 14px 22px !important;
    margin-bottom: 22px !important;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(91, 71, 43, 0.14);
}

.parameter-heading .mode-box {
    grid-column: 1 / -1;
    margin-top: 4px !important;
}

.level-limit-badge {
    align-self: center;
    white-space: nowrap;
}

.parameter-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-section.param-block {
    position: relative;
    margin: 0 !important;
    padding: 22px !important;
    border: 1px solid rgba(85, 69, 45, 0.14) !important;
    border-radius: 18px;
    background: rgba(255, 251, 241, 0.82);
    box-shadow: 0 8px 22px rgba(71, 50, 24, 0.06);
}

.param-main,
.param-target {
    grid-column: 1 / -1;
}

.param-block h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px !important;
    color: #174f44 !important;
    font-size: 18px !important;
}

.param-main h3::before { content: "01"; }
.param-target h3::before { content: "01"; }
.param-search h3::before { content: "02"; }
.param-market h3::before { content: "03"; }

.param-block h3::before {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #fff5d4;
    background: #256c5d;
    font-size: 11px;
    font-weight: 900;
}

.param-block .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.param-main .form-grid,
.param-target .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.param-block .form-grid label:not(.checkbox-label) {
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(73, 61, 42, 0.10);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.66);
}

.param-block .form-grid input[type="number"] {
    border-color: rgba(41, 103, 88, 0.23) !important;
    background: #fffdf7 !important;
}

.param-block .form-grid input[type="number"]:focus {
    border-color: #2c8b73 !important;
    box-shadow: 0 0 0 3px rgba(44, 139, 115, 0.12) !important;
}

.param-block .checkbox-label {
    min-height: 52px;
    justify-content: center;
    padding: 10px 12px !important;
    border: 1px solid rgba(41, 103, 88, 0.16);
    border-radius: 13px;
    background: rgba(225, 239, 232, 0.72);
}

.parameter-panel .button-row {
    margin-top: 22px !important;
    padding-top: 22px;
    border-top: 1px solid rgba(91, 71, 43, 0.14);
}

#flowPanel {
    border-color: rgba(44, 139, 115, 0.30) !important;
}

#flowPanel > h2::before {
    content: "流程 · ";
    color: #2c8b73;
}

#stepsPanel > h2::before {
    content: "明细 · ";
    color: #a74f35;
}

@media (max-width: 1040px) {
    .parameter-sections { grid-template-columns: 1fr; }
    .param-main, .param-target { grid-column: auto; }
    .param-main .form-grid,
    .param-target .form-grid,
    .param-block .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 680px) {
    main.container { width: min(100% - 20px, 1360px) !important; }
    .quick-panel-head { align-items: flex-start; flex-direction: column; }
    .parameter-panel { padding: 18px !important; }
    .parameter-heading { grid-template-columns: 1fr !important; }
    .level-limit-badge { justify-self: start; }
    .param-main .form-grid,
    .param-target .form-grid,
    .param-block .form-grid { grid-template-columns: 1fr !important; }
    .form-section.param-block { padding: 16px !important; }
}
/* 快捷换算配色修正 + 单次融合验算器 */
.quick-row input {
    border: 1px solid rgba(241, 210, 122, 0.22) !important;
    color: #223d36 !important;
    background: #f8f1df !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.quick-row input::placeholder { color: #8c826d !important; }

.quick-row input:focus {
    border-color: #d9b95d !important;
    box-shadow: 0 0 0 3px rgba(241, 210, 122, 0.14) !important;
}

.quick-row input[disabled] {
    color: #173f36 !important;
    background: linear-gradient(135deg, #ead9a7, #d6bd72) !important;
    -webkit-text-fill-color: #173f36 !important;
}

.quick-fusion-divider {
    height: 1px;
    margin: 26px 0 22px;
    background: linear-gradient(90deg, transparent, rgba(241, 210, 122, 0.38), transparent);
}

.quick-fusion-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.quick-fusion-head h3 {
    margin: 5px 0 0;
    color: #fff0bd;
    font-size: 22px;
}

.quick-fusion-head p {
    margin: 0;
    color: #b9b6a8;
    line-height: 1.6;
}

.quick-fusion-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) 42px minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
}

.quick-bead-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    padding: 20px;
    border: 1px solid rgba(241, 210, 122, 0.20);
    border-radius: 16px;
    background: rgba(4, 24, 21, 0.62);
}

.quick-bead-card > strong {
    margin-bottom: 2px;
    color: #dfc7ff;
    font-size: 19px;
}

.bead-two > strong { color: #b9d9ff; }
.fusion-result-card > strong { color: #ffe07c; }

.quick-bead-card label {
    display: grid;
    gap: 7px;
    color: #d7d1bd;
    font-size: 13px;
    font-weight: 700;
}

.quick-bead-card input {
    width: 100%;
    min-width: 0;
    height: 43px;
    padding: 0 12px;
    border: 1px solid rgba(241, 210, 122, 0.18);
    border-radius: 10px;
    color: #203a33;
    background: #f8f1df;
    font: inherit;
}

.quick-bead-card input:focus {
    outline: none;
    border-color: #d9b95d;
    box-shadow: 0 0 0 3px rgba(241, 210, 122, 0.13);
}

.fusion-result-card {
    border-color: rgba(241, 210, 122, 0.38);
    background: linear-gradient(145deg, rgba(77, 50, 23, 0.56), rgba(23, 57, 48, 0.74));
}

.fusion-result-card input[disabled] {
    color: #173f36;
    background: linear-gradient(135deg, #f0dfa9, #d6bd72);
    -webkit-text-fill-color: #173f36;
    opacity: 1;
    font-size: 20px;
    font-weight: 900;
}

.fusion-result-card p {
    margin: 4px 0 0;
    color: #d8c890;
    font-size: 13px;
    line-height: 1.75;
}

.quick-fusion-symbol {
    display: grid;
    place-items: center;
    color: #f1d27a;
    font-size: 34px;
    font-weight: 300;
}

.flow-tree-link {
    opacity: 0.90;
    stroke-width: 3.2 !important;
    transition: opacity 150ms ease, stroke-width 150ms ease;
}

.flow-tree-link:hover {
    opacity: 1;
    stroke-width: 5 !important;
}

@media (max-width: 980px) {
    .quick-fusion-grid {
        grid-template-columns: 1fr;
    }
    .quick-fusion-symbol {
        min-height: 26px;
        transform: rotate(90deg);
    }
}

@media (max-width: 680px) {
    .quick-fusion-head { align-items: flex-start; flex-direction: column; }
    .quick-bead-card { padding: 16px; }
}
.form-grid select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(41, 103, 88, 0.23);
    border-radius: 10px;
    color: #223d36;
    background: #fffdf7;
    font: inherit;
}
.form-grid select:focus {
    outline: none;
    border-color: #2c8b73;
    box-shadow: 0 0 0 3px rgba(44, 139, 115, 0.12);
}