/* ========== 五行灵根：雷达图版式 ========== */
.roots-radar-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.roots-radar-wrap {
    position: relative;
    width: min(320px, 100%);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background:
        radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.08) 0%, transparent 55%),
        linear-gradient(135deg, rgba(17,20,24,0.78) 0%, rgba(6,7,10,0.88) 100%);
    box-shadow: inset 0 0 18px rgba(0,0,0,0.55);
    overflow: hidden;
}
.roots-radar-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.roots-radar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    box-shadow: inset 0 0 16px rgba(0,0,0,0.55);
    pointer-events: none;
}
.roots-radar-center-title {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-family: sans-serif;
}
.roots-radar-center-val {
    font-size: 18px;
    font-weight: bold;
    color: var(--antique-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    font-family: monospace;
}

.roots-summary {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(0,0,0,0.28);
    padding: 10px 12px;
    box-sizing: border-box;
}
.roots-summary-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--antique-gold);
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 8px;
}
.roots-summary-lines {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 11px;
    color: #b0b8c0;
    font-family: sans-serif;
    line-height: 1.4;
}
.roots-actions {
    margin-top: 6px;
}
.roots-summary {
    margin-top: 4px;
}
.roots-summary-compact {
    display: block;
    padding: 10px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e8ecf0;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
    word-break: break-word;
}
.roots-summary-compact b { color: var(--antique-gold); }
.roots-summary-compact .muted { color: var(--text-muted); }
.roots-summary-block {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.roots-summary-block + .roots-summary-block { margin-top: 6px; }
.roots-summary-label {
    flex: 0 0 auto;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-muted);
}
.roots-summary-val {
    flex: 1 1 auto;
    min-width: 0;
    color: #e8ecf0;
}

/* 属性总览：分组 + 网格 chips */
.roots-summary-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.roots-summary-group {
    padding: 10px 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(212, 175, 55, 0.12);
    box-sizing: border-box;
}
.roots-summary-group-title {
    margin: 0 0 10px;
    padding: 0 2px 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--antique-gold);
    text-align: left;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}
.roots-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.roots-summary-group .roots-chip-row {
    margin-top: 0;
}
.roots-chip-row--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.roots-chip-row--grid .roots-chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 100%;
}
@media (min-width: 400px) {
    .roots-chip-row--grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .roots-chip-row--grid .roots-chip:last-child:nth-child(odd) {
        grid-column: auto;
        max-width: none;
    }
}
.roots-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e8ecf0;
    font-size: 10px;
    line-height: 1.3;
    font-family: sans-serif;
    box-sizing: border-box;
    min-height: 36px;
    width: 100%;
    text-align: center;
    flex-wrap: wrap;
}
.roots-chip-row--grid .roots-chip {
    white-space: normal;
    word-break: keep-all;
}
.roots-chip--primary {
    border-color: rgba(212, 175, 55, 0.28);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.35) 100%);
}
.roots-chip--elem {
    border-color: rgba(0, 229, 255, 0.22);
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.08) 0%, rgba(0, 0, 0, 0.35) 100%);
}
.roots-chip .k {
    color: rgba(232, 236, 240, 0.9);
    font-weight: 700;
}
.roots-chip .v {
    color: #fff;
    font-family: ui-monospace, monospace;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.roots-chip-badge {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-align: center;
}
.roots-summary-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.roots-summary-line b {
    color: #e8ecf0;
    font-weight: 700;
}
.roots-summary-line .roots-summary-right {
    font-family: monospace;
    color: #fff;
    text-align: right;
    white-space: nowrap;
}
.roots-summary-zero {
    text-align: center;
    color: var(--text-muted);
    padding: 6px 0;
}

.roots-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}
@media (max-width: 380px) {
    .roots-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 五行淬炼卡：顶栏单行 + 标签/数值分行，避免窄列把「+16%」拆碎 */
.roots-action-btn {
    width: 100%;
    min-width: 0;
    min-height: 102px;
    height: 100%;
    align-self: stretch;
    flex-shrink: 1;
    padding: 7px 4px 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    box-sizing: border-box;
    text-shadow: none;
    letter-spacing: 0;
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--rootColor, var(--antique-gold)) 26%, rgba(255, 255, 255, 0.07));
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--rootColor) 10%, rgba(14, 16, 20, 0.97)) 0%,
        rgba(5, 6, 8, 1) 100%
    );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.45);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
.roots-action-btn:not(.disabled):hover {
    border-color: color-mix(in srgb, var(--rootColor) 44%, rgba(255, 255, 255, 0.1));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px color-mix(in srgb, var(--rootColor) 18%, transparent),
        0 3px 12px rgba(0, 0, 0, 0.48);
}
.roots-action-btn:not(.disabled):active {
    transform: translateY(1px);
}
.roots-action-btn.disabled {
    opacity: 0.7;
    filter: saturate(0.85);
}
.roots-action-head {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    padding-bottom: 5px;
    margin-bottom: 3px;
    border-bottom: 1px solid color-mix(in srgb, var(--rootColor) 18%, rgba(255, 255, 255, 0.08));
}
.roots-action-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
    color: var(--rootColor, var(--antique-gold));
    text-shadow: 0 0 10px color-mix(in srgb, var(--rootColor, var(--antique-gold)) 32%, transparent);
}
.roots-action-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.22);
    line-height: 1;
    transform: translateY(-1px);
}
.roots-action-lv {
    font-size: 9px;
    color: rgba(168, 176, 184, 0.95);
    font-family: ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}
.roots-action-sub {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 38px;
    width: 100%;
    padding: 5px 2px 4px;
    box-sizing: border-box;
}
.roots-action-sub-label {
    font-size: 9px;
    line-height: 1.25;
    letter-spacing: 0.5px;
    color: rgba(180, 188, 196, 0.88);
    font-family: sans-serif;
    text-align: center;
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: break-word;
    white-space: normal;
}
.roots-action-sub-label--compact {
    font-size: 8px;
    letter-spacing: 0;
}
.roots-action-sub-val {
    font-size: 12px;
    line-height: 1.1;
    font-weight: 700;
    color: #eef2f6;
    font-family: ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.roots-action-cost {
    flex: 0 0 auto;
    margin-top: auto;
    width: 100%;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 9px;
    line-height: 1.2;
    color: #c4a574;
    text-align: center;
    font-family: sans-serif;
    opacity: 0.96;
    display: flex;
    justify-content: center;
    align-items: center;
}
.roots-action-cost .res-cost-line {
    justify-content: center;
    transform: scale(0.92);
    transform-origin: center center;
}

.cave-sys-card {
    background: linear-gradient(180deg, rgba(17,20,24,0.6) 0%, rgba(6,7,10,0.8) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cave-sys-card:last-child { margin-bottom: 0; }

