:root {
    --bg-paper: #f4e8c1;
    --text-main: #3e2723;
    --text-sub: #6d5845;
    --border-wood: #8b5a2b;
    --gold: #b8860b;
    --red: #c0392b;
    --blue: #2f6c8f;
    --green: #4b7d3f;
    --purple: #7c5ea6;
    --paper-light: rgba(255, 252, 242, 0.86);
    --paper-mid: rgba(244, 232, 193, 0.78);
    --btn-bg: linear-gradient(to bottom, #d7ccc8, #bcaaa4);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: "STKaiti", "KaiTi", serif;
    color: var(--text-main);
    font-size: 14px;
    background:
        radial-gradient(circle at top, rgba(255, 250, 235, 0.45), transparent 28%),
        linear-gradient(to bottom, #f8efd4, #f0e0b7);
}

.top-hud {
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-wood);
    background:
        linear-gradient(to bottom, rgba(250, 242, 218, 0.97), rgba(236, 221, 183, 0.93));
    box-shadow: 0 2px 10px rgba(62, 39, 35, 0.08);
    z-index: 20;
}

.top-hud-inner,
.top-hud > .explore-hero-grid {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
}

.top-hud-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 12px;
    align-items: stretch;
}

.top-hud-inner .trainer-strip {
    margin-top: 0 !important;
    margin-bottom: 0;
    min-width: 0;
}

.top-hud-inner .trainer-tags {
    align-content: flex-start;
}

.explore-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
    gap: 12px;
    align-items: stretch;
}

.trainer-focus-card,
.lead-support-card {
    min-width: 0;
}

.trainer-focus-card {
    padding: 12px;
    border: 2px solid rgba(139, 90, 43, 0.34);
    border-radius: 16px;
    background:
        linear-gradient(to right, rgba(255, 252, 243, 0.92), rgba(244, 232, 193, 0.8)),
        radial-gradient(circle at top left, rgba(184, 134, 11, 0.15), transparent 38%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.52), 0 4px 12px rgba(62,39,35,0.1);
}

.trainer-focus-head,
.lead-support-body {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.trainer-focus-avatar {
    width: 90px;
    height: 118px;
    object-fit: cover;
    object-position: center 18%;
    border-radius: 14px;
    border: 2px solid var(--border-wood);
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(244,232,193,0.85));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 3px 8px rgba(62,39,35,0.12);
}

.trainer-focus-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trainer-focus-titleline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.trainer-focus-name {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.1;
}

.trainer-focus-role,
.trainer-focus-quest {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.7;
}

.trainer-focus-meta,
.trainer-focus-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lead-support-card {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lead-support-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.trainer-strip {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.trainer-mini,
.battle-trainer-mini,
.trainer-tool-strip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trainer-icon {
    width: 44px;
    height: 44px;
    object-fit: cover;
    object-position: center 16%;
    border-radius: 12px;
    border: 2px solid var(--border-wood);
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(244,232,193,0.85));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.52), 0 3px 8px rgba(62,39,35,0.12);
}

.trainer-name {
    font-size: 13px;
    color: var(--text-sub);
}

.trainer-level {
    font-size: 15px;
    font-weight: bold;
}

.trainer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.hud-chip,
.quality-pill,
.pet-level-pill,
.skill-pill,
.mini-link {
    border: 1px solid rgba(139, 90, 43, 0.28);
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(255, 252, 243, 0.68);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}

.lead-pet-panel,
.status-pet-card,
.battle-pet-core {
    display: flex;
    gap: 12px;
    align-items: stretch;
    padding: 10px;
    border: 1px solid rgba(139, 90, 43, 0.34);
    border-radius: 14px;
    background:
        linear-gradient(to right, rgba(255, 252, 243, 0.86), rgba(244, 232, 193, 0.72)),
        radial-gradient(circle at top right, rgba(184, 134, 11, 0.14), transparent 40%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.pet-main-panel {
    border-width: 2px;
    border-color: rgba(184, 134, 11, 0.4);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), 0 4px 12px rgba(139,90,43,0.15);
}

.lead-pet-info,
.status-pet-info,
.battle-player-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-pet-top,
.lead-pet-title,
.battle-name-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.lead-pet-title strong,
.battle-name-line strong {
    font-size: 18px;
}

.lead-pet-meta,
.warehouse-note,
.hint-text,
.section-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-sub);
}

.lead-pet-submeta,
.pet-detail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pet-role-pill,
.pet-aptitude,
.pet-growth,
.tool-type-pill {
    border: 1px solid rgba(139, 90, 43, 0.24);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    background: rgba(255, 252, 243, 0.72);
    color: var(--text-sub);
}

.pet-role-pill {
    color: var(--blue);
}

.pet-aptitude {
    color: var(--gold);
}

.pet-growth {
    color: var(--green);
}

.bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.bar-wrap.compact {
    margin: 2px 0;
    font-size: 11px;
}

.bar-label {
    width: 32px;
    flex-shrink: 0;
}

.bar-value {
    width: 72px;
    text-align: right;
    font-size: 11px;
}

.bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(107, 84, 64, 0.18);
    border: 1px solid rgba(139, 90, 43, 0.3);
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.25s ease;
}

.bg-red { background: linear-gradient(to right, #d95d39, #c0392b); }
.bg-blue { background: linear-gradient(to right, #4c7ea7, #2f6c8f); }
.bg-gold { background: linear-gradient(to right, #d9b55f, #b8860b); }
/* 新增绿色血条（用于我方妖宠区分） */
.bg-green { background: linear-gradient(to right, #6bb854, #4b7d3f); }

main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    padding-bottom: 76px;
}

.view {
    display: none;
    animation: fadeIn 0.2s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-wood);
    border-radius: 12px;
    background:
        linear-gradient(to bottom, var(--paper-light), var(--paper-mid)),
        radial-gradient(circle at top right, rgba(184, 134, 11, 0.08), transparent 34%);
    box-shadow:
        inset 0 0 0 1px rgba(255,248,220,0.55),
        inset 0 0 12px rgba(139,90,43,0.08),
        0 3px 12px rgba(62,39,35,0.08);
}

.card-title {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(139, 90, 43, 0.42);
    color: var(--border-wood);
    font-size: 16px;
    font-weight: bold;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-link {
    cursor: pointer;
    font-size: 12px;
    margin-left: 6px;
}

.scene-visual {
    width: 100%;
    height: 188px;
    object-fit: cover;
    object-position: center 58%;
    display: block;
    margin-bottom: 14px;
    border: 3px solid var(--border-wood);
    border-radius: 12px;
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(215,204,200,0.85));
    box-shadow: inset 0 0 0 2px rgba(255,248,220,0.72), 0 4px 14px rgba(62,39,35,0.16);
}

.scene-desc {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-main);
    font-style: italic;
    border-left: 3px solid var(--gold);
    padding-left: 8px;
    background: rgba(0,0,0,0.02);
}

.quest-banner {
    font-size: 12px;
    color: var(--red);
    margin-bottom: 10px;
    font-weight: bold;
}

.world-log-card {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(139, 90, 43, 0.26);
    border-radius: 14px;
    background:
        linear-gradient(to bottom, rgba(255,252,243,0.9), rgba(244,232,193,0.72)),
        radial-gradient(circle at top right, rgba(184, 134, 11, 0.08), transparent 38%);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.42),
        0 4px 12px rgba(62,39,35,0.08);
    color: var(--text-main);
}

.world-log-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.world-log-title {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--border-wood);
}

.world-log-subtitle {
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-sub);
}

.world-log-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.world-log-link {
    background: rgba(255,252,243,0.72);
    color: var(--border-wood);
    border-color: rgba(139, 90, 43, 0.24);
}

.world-log-list {
    max-height: 188px;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.world-log-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 7px 8px;
    border: 1px dashed rgba(139, 90, 43, 0.18);
    border-radius: 10px;
    background: rgba(255,252,243,0.48);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-main);
}

.world-log-time {
    flex: 0 0 auto;
    min-width: 58px;
    color: var(--gold);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.world-log-text {
    flex: 1;
    min-width: 0;
}

.world-log-item.player .world-log-text {
    color: var(--green);
}

.world-log-item.danger .world-log-text {
    color: var(--red);
}

.world-log-item.system .world-log-text {
    color: var(--text-sub);
}

.world-log-item.ai .world-log-text {
    color: var(--blue);
}

.world-log-ai {
    color: var(--blue);
    font-weight: bold;
}

.world-log-empty {
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
    padding: 10px 0 4px;
}

.world-log-card.collapsed .world-log-head {
    margin-bottom: 0;
}

.world-log-card.collapsed .world-log-list {
    display: none;
}

.explore-shell {
    display: grid;
    gap: 14px;
    align-items: start;
}

.explore-stage,
.explore-tools {
    min-width: 0;
}

.map-entities-panel {
    margin-top: 0;
}

.explore-tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-panel {
    padding: 12px;
    border: 1px solid rgba(139, 90, 43, 0.22);
    border-radius: 12px;
    background:
        linear-gradient(to bottom, rgba(255,252,243,0.82), rgba(244,232,193,0.56));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.36);
}

.tool-panel-title {
    margin-bottom: 10px;
    font-size: 0;
}

.tool-panel-title::before {
    content: "行路";
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    color: var(--border-wood);
}

.explore-main-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
}

.travel-route-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.travel-route-item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid rgba(139, 90, 43, 0.26);
    border-radius: 10px;
    background: rgba(255,252,243,0.74);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
}

.travel-route-main {
    min-width: 0;
    font-weight: bold;
}

.travel-route-type,
.travel-route-go {
    font-size: 11px;
    color: var(--text-sub);
    white-space: nowrap;
}

#map-entities {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.entity-section {
    padding: 10px;
    border: 1px dashed rgba(139, 90, 43, 0.24);
    border-radius: 12px;
    background: rgba(255,252,243,0.55);
}

.compact-section {
    padding: 8px;
    border: 1px dashed rgba(139, 90, 43, 0.24);
    border-radius: 8px;
    background: rgba(255,252,243,0.55);
}

.compact-section-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    padding: 0 0 5px;
    border: 0;
    border-bottom: 1px solid rgba(139, 90, 43, 0.2);
    background: none;
    color: var(--border-wood);
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}

.compact-section-title {
    min-width: 0;
    flex: 1;
}

.compact-section-state {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-sub);
}

.compact-section-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
}

.compact-section.is-collapsed .compact-section-body {
    display: none;
}

.compact-entity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 6px 7px;
    border-radius: 10px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(139, 90, 43, 0.16);
}

.compact-entity-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.compact-entity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compact-entity-name {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.25;
    min-width: 0;
}

.compact-entity-row .entity-name {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.25;
    min-width: 0;
}

.compact-entity-sub,
.compact-entity-note,
.compact-entity-row .entity-sub,
.compact-entity-row .entity-trace-note {
    font-size: 11px;
    color: var(--text-sub);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-entity-tag {
    margin-left: 4px;
    font-size: 11px;
    color: var(--text-sub);
    font-weight: normal;
}

.compact-entity-row .entity-tag {
    margin-left: 4px;
    font-size: 11px;
    color: var(--text-sub);
    font-weight: normal;
}

.compact-entity-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.compact-entity-actions .btn {
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 5px;
}

.compact-entity-avatar {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: block;
    object-fit: cover;
    object-position: center 16%;
    border-radius: 10px;
    border: 1px solid rgba(139, 90, 43, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42), 0 1px 4px rgba(62,39,35,0.08);
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(244,232,193,0.85));
}

.compact-entity-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--border-wood);
    background: linear-gradient(to bottom, rgba(255,248,220,0.92), rgba(236,221,183,0.74));
}

.compact-entity-row .entity-object-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(139, 90, 43, 0.28);
    color: var(--border-wood);
    background: linear-gradient(to bottom, rgba(255,248,220,0.92), rgba(236,221,183,0.74));
}

.compact-section-body .entity-empty {
    padding: 2px 0;
}

.compact-lineup-wrap {
    margin: 6px 0 12px;
    padding: 8px;
    border: 1px dashed rgba(139, 90, 43, 0.22);
    border-radius: 10px;
    background: rgba(255,252,243,0.54);
}

.compact-lineup-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.compact-lineup-slot {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 10px;
    border: 1px solid rgba(139, 90, 43, 0.16);
    background: rgba(255,255,255,0.74);
    text-align: center;
}

.compact-lineup-slot.empty {
    color: var(--text-sub);
}

.compact-lineup-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(139, 90, 43, 0.24);
    object-fit: cover;
    object-position: center 18%;
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(244,232,193,0.85));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42), 0 1px 4px rgba(62,39,35,0.08);
}

.compact-lineup-empty {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px dashed rgba(139, 90, 43, 0.22);
    background: rgba(255,255,255,0.62);
    font-size: 12px;
}

.compact-lineup-label {
    font-size: 11px;
    line-height: 1.2;
    color: var(--border-wood);
}

.entity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(139, 90, 43, 0.16);
}

.entity-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.entity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.entity-name {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
}

.entity-sub,
.entity-empty {
    font-size: 12px;
    color: var(--text-sub);
}

.entity-trace-note {
    font-size: 12px;
    color: var(--border-wood);
    line-height: 1.5;
}

.entity-tag {
    margin-left: 4px;
    font-size: 12px;
    color: var(--text-sub);
    font-weight: normal;
}

.entity-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.entity-object-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(139, 90, 43, 0.28);
    background: linear-gradient(to bottom, rgba(255,248,220,0.9), rgba(236,221,183,0.72));
    color: var(--border-wood);
    font-weight: bold;
}

.map-entity-row {
    gap: 6px;
    padding: 5px 7px;
    align-items: center;
}

.map-entity-row .entity-main {
    gap: 6px;
    align-items: center;
}

.map-entity-row .entity-text {
    gap: 2px;
}

.map-entity-row .entity-name {
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-entity-row .entity-tag {
    font-size: 11px;
}

.map-entity-row .entity-sub,
.map-entity-row .entity-trace-note {
    font-size: 11px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-entity-row .entity-actions {
    gap: 4px;
    flex-shrink: 0;
}

.map-entity-row .entity-actions .btn {
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 5px;
}

.map-entity-row .pet-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border-width: 1px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42), 0 1px 4px rgba(62,39,35,0.08);
}

.map-entity-row .npc-portrait {
    width: 28px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    object-position: center 12%;
    padding: 0;
}

.map-entity-row .entity-object-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 12px;
}

.trace-entity-row {
    background: linear-gradient(to right, rgba(255,248,220,0.9), rgba(255,255,255,0.76));
    border-color: rgba(139, 90, 43, 0.24);
}

.trace-entity-icon {
    background: linear-gradient(to bottom, rgba(140, 27, 27, 0.92), rgba(90, 16, 16, 0.88));
    border-color: rgba(110, 24, 24, 0.48);
    color: #f9e7b2;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.trace-card {
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px dashed rgba(139, 90, 43, 0.24);
    background: rgba(255, 255, 255, 0.78);
}

.trace-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 4px;
}

.trace-card-type {
    font-size: 11px;
    color: var(--border-wood);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.trace-card-time {
    font-size: 11px;
    color: var(--gold);
    font-weight: bold;
}

.trace-card-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-main);
}

.trace-card-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.rival-row {
    background: rgba(255,248,220,0.82);
}

.wild-row {
    background: rgba(255,240,240,0.72);
}

.object-row {
    background: rgba(247,242,228,0.82);
}

.explore-ops {
    grid-template-columns: 1fr;
    margin-top: 0;
}

.move-pad {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.move-pad table {
    border-collapse: separate;
    border-spacing: 5px;
}

.move-pad td {
    width: 55px;
    height: 45px;
}

.section-label {
    font-size: 13px;
    color: var(--border-wood);
    margin: 10px 0 6px;
    border-bottom: 1px solid rgba(139, 90, 43, 0.2);
    padding-bottom: 5px;
}

.btn {
    background: var(--btn-bg);
    border: 1px solid var(--border-wood);
    color: var(--text-main);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(to bottom, #f0bd4d, #d1a22a);
    border-color: #936518;
    color: #fff;
    text-shadow: 1px 1px rgba(0,0,0,0.32);
}

.btn-danger {
    background: linear-gradient(to bottom, #d86f58, #bf4b3a);
    border-color: #8a3227;
    color: #fff;
    text-shadow: 1px 1px rgba(0,0,0,0.32);
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.btn-dir,
.btn-center {
    width: 100%;
    height: 100%;
    padding: 0;
}

.battle-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(139, 90, 43, 0.28);
}

.list-item:last-child {
    border-bottom: none;
}

.pet-card {
    border: 1px solid rgba(139, 90, 43, 0.38);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background:
        linear-gradient(to bottom, rgba(255,252,243,0.94), rgba(244,232,193,0.78)),
        radial-gradient(circle at top right, rgba(184,134,11,0.12), transparent 35%);
    box-shadow: inset 0 0 0 1px rgba(255,248,220,0.7), 0 3px 10px rgba(62,39,35,0.08);
}

.pet-card-header,
.pet-card-meta,
.pet-card-bars,
.pet-card-actions,
.pet-card-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pet-card-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pet-card-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pet-card-name {
    font-size: 18px;
    font-weight: bold;
}

.pet-card-statline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pet-stat-box,
.status-stat {
    padding: 8px 10px;
    border: 1px solid rgba(139, 90, 43, 0.24);
    border-radius: 10px;
    background: rgba(255,252,243,0.58);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.pet-card-actions {
    margin-top: 4px;
}

.pet-card-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 98px;
}

.pet-avatar,
.lineup-avatar,
.enemy-visual {
    object-fit: cover;
    object-position: center 24%;
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(244,232,193,0.85));
}

.pet-avatar {
    width: 82px;
    height: 82px;
    flex-shrink: 0;
    display: block;
    border-radius: 14px;
    border: 2px solid var(--border-wood);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 3px 8px rgba(62,39,35,0.12);
}

.pet-avatar-large {
    width: 92px;
    height: 92px;
    border-width: 3px;
}

.npc-portrait {
    object-fit: contain;
    object-position: center center;
    background: linear-gradient(180deg, #10141b 0%, #07090d 100%);
    padding: 3px;
    box-sizing: border-box;
}

.entity-main .npc-portrait {
    width: 78px;
    height: 102px;
    border-radius: 16px;
}

.modal .npc-portrait-large {
    width: 104px;
    height: 132px;
    border-radius: 16px;
}

.status-pet-avatar {
    width: 104px;
    height: 104px;
}

.pet-skill-list,
.battle-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pet-skill-tree {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pet-tree-node {
    flex: 1 1 120px;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px dashed rgba(139, 90, 43, 0.32);
    border-radius: 10px;
    background: rgba(255, 252, 243, 0.5);
    font-size: 12px;
    line-height: 1.5;
}

.pet-tree-node b {
    color: var(--border-wood);
}

.world-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.world-map-card {
    border: 1px solid rgba(139, 90, 43, 0.28);
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255,251,240,0.96), rgba(244,232,193,0.78));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42), 0 4px 12px rgba(62,39,35,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.world-map-card.is-locked {
    opacity: 0.74;
    filter: saturate(0.82);
}

.world-map-card-head,
.stage-goal-head,
.task-journal-entry-head,
.lineup-growth-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.world-map-card-area,
.lineup-insight-title,
.lineup-growth-title {
    font-size: 16px;
    font-weight: 700;
}

.world-map-card-desc,
.lineup-insight-desc,
.lineup-growth-desc,
.task-next-line,
.stage-goal-hint {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-sub);
}

.world-map-card-meta,
.lineup-insight-meta,
.lineup-growth-meta,
.task-reward-line,
.task-related-line,
.stage-goal-reward,
.stage-goal-progress,
.task-progress-line {
    font-size: 12px;
    color: var(--text-main);
}

.world-map-card-actions {
    margin-top: auto;
}

.bestiary-progress-card,
.task-journal-card,
.stage-goal-card {
    background: linear-gradient(180deg, rgba(255,252,245,0.98), rgba(246,236,205,0.82));
}

.bestiary-progress-head,
.lineup-insight-tags,
.status-save-meta,
.settings-grid,
.task-journal-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.bestiary-progress-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.bestiary-area-progress,
.task-type-chip {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(139, 90, 43, 0.08);
    border: 1px solid rgba(139, 90, 43, 0.14);
    font-size: 11px;
    color: var(--border-wood);
    font-weight: 700;
}

.bestiary-card.is-unknown {
    background: linear-gradient(180deg, rgba(247,244,238,0.92), rgba(226,216,196,0.86));
}

.bestiary-unknown-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: rgba(90, 70, 52, 0.78);
}

.lineup-insight-grid,
.lineup-growth-list,
.stage-goals-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.lineup-insight-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.lineup-growth-list,
.task-journal-section {
    grid-template-columns: 1fr;
}

.lineup-insight-card,
.lineup-growth-card,
.task-journal-entry,
.stage-goal-item {
    border: 1px solid rgba(139, 90, 43, 0.22);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 252, 244, 0.9);
}

.lineup-insight-card.is-active,
.lineup-growth-card.is-active,
.task-journal-entry.is-tracked {
    border-color: rgba(184, 134, 11, 0.46);
    box-shadow: inset 0 0 0 1px rgba(240,189,77,0.32);
}

.lineup-insight-card.is-empty,
.lineup-growth-card.is-empty {
    opacity: 0.78;
}

.lineup-insight-kicker,
.task-journal-heading,
.lineup-growth-preview {
    font-size: 11px;
    letter-spacing: 0.3px;
    color: var(--gold);
    font-weight: 700;
}

.lineup-growth-preview {
    margin-top: 6px;
}

.task-journal-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-journal-heading {
    margin-top: 2px;
}

.task-status-chip {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.task-status-chip.tone-active {
    color: #9b5d00;
    background: rgba(240,189,77,0.18);
    border-color: rgba(184, 134, 11, 0.24);
}

.task-status-chip.tone-done {
    color: #2b6e43;
    background: rgba(46, 204, 113, 0.14);
    border-color: rgba(46, 160, 96, 0.22);
}

.task-status-chip.tone-locked {
    color: #6b5a4d;
    background: rgba(139, 90, 43, 0.08);
    border-color: rgba(139, 90, 43, 0.16);
}

.status-save-meta {
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-sub);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.settings-toggle,
.settings-select {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(139, 90, 43, 0.16);
    background: rgba(255,255,255,0.55);
    font-size: 12px;
}

.settings-select select {
    border: 1px solid rgba(139, 90, 43, 0.22);
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    color: var(--text-main);
}

.save-toast {
    position: fixed;
    left: 50%;
    bottom: 74px;
    transform: translateX(-50%) translateY(12px);
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(47, 31, 20, 0.92);
    color: #fff8e1;
    font-size: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 60;
}

.save-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

html[data-font-size="large"] {
    font-size: 17px;
}

html[data-font-size="compact"] {
    font-size: 15px;
}

html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

@media (max-width: 700px) {
    .world-map-grid,
    .lineup-insight-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .save-toast {
        bottom: 68px;
        max-width: calc(100vw - 24px);
        text-align: center;
    }
}

body {
    position: relative;
    isolation: isolate;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        radial-gradient(circle at 18% 14%, rgba(255,255,255,0.26), transparent 20%),
        radial-gradient(circle at 82% 24%, rgba(184, 134, 11, 0.10), transparent 18%),
        radial-gradient(circle at 50% 78%, rgba(109, 88, 69, 0.08), transparent 24%);
    opacity: 0.95;
}

body::after {
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(92,68,48,0.02) 1px, transparent 1px);
    background-size: 8px 8px;
    mix-blend-mode: multiply;
    opacity: 0.45;
}

body[data-view="combat"]::before {
    background:
        radial-gradient(circle at 16% 18%, rgba(192, 57, 43, 0.14), transparent 18%),
        radial-gradient(circle at 84% 18%, rgba(47, 108, 143, 0.12), transparent 20%),
        radial-gradient(circle at 50% 76%, rgba(184, 134, 11, 0.10), transparent 26%);
}

body[data-view="bestiary"]::before,
body[data-view="lineup"]::before,
body[data-view="status"]::before {
    background:
        radial-gradient(circle at 20% 12%, rgba(184, 134, 11, 0.11), transparent 18%),
        radial-gradient(circle at 84% 30%, rgba(124, 94, 166, 0.08), transparent 18%),
        radial-gradient(circle at 48% 78%, rgba(75, 125, 63, 0.07), transparent 24%);
}

.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.btn:hover {
    box-shadow: 0 4px 10px rgba(62,39,35,0.10);
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.12) 46%, transparent 72%);
    transform: translateX(-120%);
    transition: transform 0.34s ease;
}

.btn:hover::after,
.btn.is-guided::after,
.explore-main-btn.is-casting::after {
    transform: translateX(120%);
}

.btn-primary {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 6px 12px rgba(184, 134, 11, 0.18);
}

.btn-danger {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 6px 12px rgba(192, 57, 43, 0.16);
}

.explore-main-btn {
    min-height: 42px;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 8px 18px rgba(184, 134, 11, 0.22);
    animation: explorePulse 3.4s ease-in-out infinite;
}

.explore-main-btn.is-casting {
    transform: translateY(1px) scale(0.985);
    filter: brightness(1.05);
}

@keyframes explorePulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 8px 18px rgba(184, 134, 11, 0.20); }
    50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 10px 22px rgba(184, 134, 11, 0.30); }
}

.card,
.pet-card,
.world-map-card,
.battle-card {
    position: relative;
}

.card::before,
.pet-card::before,
.world-map-card::before,
.battle-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(135deg, transparent 0 16px, rgba(255,255,255,0.10) 16px 17px, transparent 17px),
        linear-gradient(-135deg, transparent 0 16px, rgba(122, 72, 38, 0.06) 16px 17px, transparent 17px);
    opacity: 0.55;
}

.battle-turn-indicator {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.20), 0 6px 14px rgba(62,39,35,0.10);
}

.battle-result-card {
    backdrop-filter: blur(4px);
}

.battle-float-feedback {
    text-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.bar-fill.is-critical {
    box-shadow: 0 0 10px rgba(192, 57, 43, 0.45);
    animation: criticalPulse 0.92s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { filter: saturate(1); opacity: 1; }
    50% { filter: saturate(1.3); opacity: 0.82; }
}

.world-log-type-chip,
.task-type-chip,
.task-status-chip,
.quality-pill,
.pet-level-pill,
.hud-chip,
.entity-tag-chip {
    backdrop-filter: blur(1.5px);
}

.world-log-type-chip {
    position: relative;
    padding-left: 20px;
}

.world-log-type-chip::before {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}

.world-log-type-chip.danger::before { content: "⚔"; }
.world-log-type-chip.player::before { content: "✦"; }
.world-log-type-chip.ai::before { content: "◎"; }
.world-log-type-chip.system::before { content: "◈"; }

.bestiary-card.is-unknown {
    filter: saturate(0.86);
}

.bestiary-unknown-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: rgba(90, 70, 52, 0.78);
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.2), transparent 45%),
        linear-gradient(180deg, rgba(82,74,65,0.40), rgba(62,56,49,0.66));
}

.lineup-insight-card.is-active,
.lineup-growth-card.is-active,
.stage-goal-item.is-done,
.task-journal-entry.is-tracked {
    box-shadow: inset 0 0 0 1px rgba(240,189,77,0.26), 0 8px 16px rgba(139,90,43,0.08);
}

.modal {
    border: 1px solid rgba(139, 90, 43, 0.34);
    background:
        linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(243, 230, 194, 0.96)),
        radial-gradient(circle at top right, rgba(184, 134, 11, 0.12), transparent 28%);
    box-shadow: 0 24px 48px rgba(62,39,35,0.22), inset 0 0 0 1px rgba(255,255,255,0.44);
}

.modal-title {
    letter-spacing: 0.6px;
}

.modal-content textarea {
    font-family: inherit;
}

.save-toast[data-tone="quest"] {
    background: rgba(120, 76, 21, 0.95);
    color: #fff0bf;
}

.save-toast[data-tone="codex"] {
    background: rgba(66, 58, 103, 0.94);
    color: #efe7ff;
}

.save-toast[data-tone="reward"] {
    background: rgba(53, 93, 43, 0.94);
    color: #efffe2;
}

@media (max-width: 700px) {
    .world-log-type-chip {
        padding-left: 18px;
    }
}

.scene-visual,
.explore-main-card,
.world-log-card,
.task-journal-card,
.bestiary-progress-card {
    position: relative;
}

.scene-visual::after,
.explore-main-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.16), transparent 16%),
        radial-gradient(circle at 84% 22%, rgba(184,134,11,0.12), transparent 18%);
    mix-blend-mode: screen;
}

.explore-main-card {
    overflow: hidden;
}

.explore-main-card::before {
    content: "";
    position: absolute;
    right: -24px;
    top: -20px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(184,134,11,0.14), transparent 70%);
    pointer-events: none;
}

.map-entity-row.npc-row .entity-object-icon,
.map-entity-row.trace-entity-row .trace-entity-icon {
    box-shadow: 0 4px 10px rgba(62,39,35,0.10);
}

.map-entity-row:hover {
    transform: translateY(-1px);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 6px 14px rgba(62,39,35,0.08);
}

.battle-btns .btn {
    min-height: 50px;
}

.battle-btn-main {
    letter-spacing: 0.4px;
}

.battle-btn-sub {
    opacity: 0.88;
}

.battle-enemy.is-boss,
.battle-enemy.is-boss .enemy-visual {
    box-shadow: 0 0 0 1px rgba(192,57,43,0.20), 0 10px 22px rgba(192,57,43,0.14);
}

.task-status-chip.tone-done::before,
.task-status-chip.tone-active::before,
.task-status-chip.tone-locked::before {
    margin-right: 4px;
}

.task-status-chip.tone-done::before { content: "◈"; }
.task-status-chip.tone-active::before { content: "✦"; }
.task-status-chip.tone-locked::before { content: "◇"; }

.pet-tree-node.locked {
    opacity: 0.66;
    filter: saturate(0.8);
}

.skill-pill {
    font-size: 12px;
}

.pet-card-detailgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pet-mini-note {
    font-size: 12px;
    color: var(--text-sub);
}

.rare-chip {
    border: 1px solid rgba(192, 57, 43, 0.28);
    border-radius: 999px;
    padding: 2px 8px;
    background: rgba(255, 235, 238, 0.72);
    color: var(--red);
    font-size: 11px;
}

.pet-orbit {
    position: relative;
    min-height: 250px;
    margin-bottom: 14px;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(184,134,11,0.14), transparent 48%),
        linear-gradient(to bottom, rgba(255,252,243,0.88), rgba(244,232,193,0.62));
    border: 1px solid rgba(139, 90, 43, 0.34);
}

.orbit-slot,
.orbit-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.orbit-center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.trainer-center {
    width: 58px;
    height: 58px;
    border-radius: 50%;
}

.orbit-main {
    left: 10%;
    top: 18%;
}

.orbit-sub {
    right: 11%;
    top: 24%;
}

.orbit-sub2 {
    left: 34%;
    bottom: 10%;
}

.lineup-avatar {
    width: 70px;
    height: 70px;
    display: block;
    border-radius: 50%;
    border: 2px solid var(--border-wood);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 3px 8px rgba(62,39,35,0.12);
}

.lineup-avatar-large {
    width: 88px;
    height: 88px;
    border-width: 3px;
}

.orbit-label,
.orbit-player-name {
    border: 1px solid rgba(139, 90, 43, 0.24);
    border-radius: 999px;
    background: rgba(255,252,243,0.72);
    padding: 3px 8px;
    font-size: 12px;
}

.battle-card {
    position: relative;
    overflow: hidden;
}

.battle-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08), transparent 22%, transparent 78%, rgba(62,39,35,0.05));
}

.battle-layout {
    display: grid;
    /* 调整为1:1的对称排版，配合 HTML 中的 .pet-vs-pet */
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.battle-ally,
.battle-enemy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.battle-ally {
    padding: 10px;
    border: 1px solid rgba(139, 90, 43, 0.25);
    border-radius: 14px;
    background: rgba(255,252,243,0.48);
}

.battle-enemy {
    padding: 10px;
    border: 1px solid rgba(139, 90, 43, 0.25);
    border-radius: 14px;
    background: rgba(255,252,243,0.48);
}

.battle-tool-note {
    font-size: 12px;
    color: var(--text-sub);
}

.enemy-visual {
    width: min(100%, 280px);
    aspect-ratio: 4 / 5;
    display: block;
    margin: 0 auto 10px;
    border-radius: 999px 999px 16px 16px;
    border: 3px solid var(--border-wood);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.48), 0 6px 14px rgba(139,90,43,0.2);
}

.battle-enemy-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.enemy-line {
    justify-content: center;
}

.boss-aura {
    position: absolute;
    inset: 2px;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(192,57,43,0.28), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.battle-enemy.is-boss .boss-aura {
    opacity: 1;
}

.battle-enemy.is-boss .enemy-visual {
    border-color: #9f1d1d;
    box-shadow:
        inset 0 0 0 2px rgba(255,240,220,0.45),
        0 0 0 2px rgba(184,134,11,0.42),
        0 10px 18px rgba(122,12,12,0.32);
}

.battle-element-hint {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(139, 90, 43, 0.22);
    background:
        linear-gradient(to bottom, rgba(255,252,243,0.9), rgba(242,232,205,0.72)),
        radial-gradient(circle at top right, rgba(184,134,11,0.08), transparent 38%);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    letter-spacing: 0.2px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.battle-element-hint b {
    font-weight: bold;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tool-row {
    font-size: 13px;
    margin-bottom: 6px;
}

.trainer-tools {
    background:
        linear-gradient(to bottom, rgba(246, 236, 208, 0.78), rgba(232, 218, 180, 0.65));
}

.log-box {
    height: 140px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-wood);
    background: rgba(0,0,0,0.03);
    font-family: sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

.log-box p {
    margin: 3px 0;
    padding-bottom: 3px;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}

.combat-log-entry {
    position: relative;
}

.combat-log-entry--highlight {
    padding: 8px 10px;
    border: 1px solid rgba(139, 90, 43, 0.24);
    border-radius: 10px;
    border-bottom-style: solid;
    background:
        linear-gradient(to right, rgba(255, 249, 233, 0.96), rgba(244, 232, 193, 0.82));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
    font-weight: bold;
}

.combat-log-entry--seal-success {
    border-color: rgba(75, 125, 63, 0.38);
    background:
        linear-gradient(to right, rgba(241, 250, 236, 0.98), rgba(213, 233, 195, 0.86));
    color: #2f5c27;
}

.combat-log-entry--seal-fail {
    border-color: rgba(192, 57, 43, 0.34);
    background:
        linear-gradient(to right, rgba(255, 241, 236, 0.98), rgba(244, 210, 196, 0.88));
    color: #8a2b21;
}

.combat-log-entry--pet-down {
    border-color: rgba(184, 134, 11, 0.42);
    background:
        linear-gradient(to right, rgba(255, 246, 222, 0.98), rgba(238, 215, 166, 0.9));
    color: #6b4a12;
}

.combat-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(139, 90, 43, 0.24);
    background: rgba(255, 252, 243, 0.82);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.36);
    font-size: 11px;
    font-weight: bold;
    line-height: 1.4;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.combat-tag--crit {
    border-color: rgba(192, 57, 43, 0.28);
    background: rgba(248, 220, 212, 0.96);
    color: #9d2418;
}

.combat-tag--advantage {
    border-color: rgba(75, 125, 63, 0.28);
    background: rgba(220, 238, 210, 0.96);
    color: #33642c;
}

.combat-tag--disadvantage {
    border-color: rgba(47, 108, 143, 0.24);
    background: rgba(218, 234, 245, 0.96);
    color: #295a76;
}

nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    background: #d7ccc8;
    border-top: 2px solid var(--border-wood);
    z-index: 30;
}

.nav-btn {
    flex: 1;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-sub);
    cursor: pointer;
}

.nav-btn.active {
    color: var(--border-wood);
    transform: scale(1.06);
}

.nav-icon {
    display: block;
    margin-bottom: 2px;
    font-size: 17px;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.7);
}

.modal {
    width: 100%;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 15px;
    border: 2px solid var(--border-wood);
    border-radius: 10px;
    background: var(--bg-paper);
}

.modal-title {
    margin-top: 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--border-wood);
}

.modal-content {
    margin-bottom: 15px;
    font-size: 13px;
    line-height: 1.6;
}

/* 文本颜色工具类 */
.c-g { color: var(--gold); }
.c-r { color: var(--red); }
.c-b { color: var(--blue); }
.c-gr { color: var(--green); }
.c-p { color: var(--purple); }
.c-sub { color: var(--text-sub); }

/* --- AI 设置项相关补充样式 --- */
.ai-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: bold;
}

.ai-label {
    flex-shrink: 0;
    margin-right: 10px;
    font-weight: bold;
}

.text-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid rgba(139, 90, 43, 0.4);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    font-size: 12px;
}

.ai-note {
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 8px;
    line-height: 1.4;
}

.ai-actions {
    margin-bottom: 10px;
}

.ai-lore-block {
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
    padding: 8px;
}

/* 响应式调整 */
@media (min-width: 900px) {
    .top-hud {
        position: sticky;
        top: 0;
        padding: 10px 16px;
    }

    main {
        width: min(100%, 1480px);
        margin: 0 auto;
    }

    .explore-shell {
        grid-template-columns: minmax(0, 1.9fr) 320px;
    }

    .explore-hero-grid {
        grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
    }

    .explore-stage {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .explore-tools {
        position: sticky;
        top: 112px;
    }

    .scene-visual {
        height: 230px;
        margin-bottom: 0;
    }

    .scene-desc {
        margin-bottom: 0;
        padding: 10px 12px;
        border-radius: 0 10px 10px 0;
        background: rgba(255,252,243,0.72);
    }

    .quest-banner {
        margin-bottom: 0;
        padding: 9px 12px;
        border: 1px solid rgba(192,57,43,0.18);
        border-radius: 10px;
        background: rgba(255,241,238,0.74);
    }

    #map-entities {
        min-height: 98px;
    }
}

@media (max-width: 480px) {
    .top-hud {
        padding: 8px 10px;
    }

    .world-log-card {
        padding: 10px 11px;
    }

    .world-log-title {
        font-size: 15px;
    }

    .world-log-list {
        max-height: 168px;
    }

    .world-log-item {
        font-size: 13px;
        gap: 8px;
        padding: 6px 7px;
    }

    .world-log-time {
        min-width: 52px;
    }

    .trainer-strip,
    .lead-pet-panel,
    .status-pet-card {
        gap: 10px;
    }

    .explore-hero-grid {
        grid-template-columns: 1fr;
    }

    .trainer-focus-head,
    .lead-support-body {
        align-items: flex-start;
    }

    .trainer-focus-avatar {
        width: 78px;
        height: 102px;
    }

    /* 手机竖屏时，我方与敌方的对战卡片将优雅地上下折叠 */
    .trainer-strip,
    .battle-layout {
        grid-template-columns: 1fr;
    }

    .trainer-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .trainer-tags {
        justify-content: flex-start;
    }

    .pet-avatar-large,
    .status-pet-avatar {
        width: 88px;
        height: 88px;
    }

    .entity-main .npc-portrait {
        width: 74px;
        height: 96px;
    }

    .modal .npc-portrait-large {
        width: 92px;
        height: 118px;
    }

    .scene-visual {
        height: 168px;
    }

    .explore-shell {
        gap: 10px;
    }

    .tool-panel {
        padding: 8px;
        border-radius: 10px;
    }

    .tool-panel-title::before {
        font-size: 11px;
    }

    .explore-ops {
        grid-template-columns: 1fr 1fr;
    }

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

    .entity-actions {
        justify-content: flex-start;
    }

    .travel-route-item {
        grid-template-columns: 1fr;
    }

    .battle-btns {
        grid-template-columns: 1fr 1fr;
    }

    .status-grid,
    .pet-card-statline,
    .pet-card-detailgrid {
        grid-template-columns: 1fr;
    }

    .pet-card-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .pet-card-actions .btn {
        flex-basis: calc(50% - 6px);
    }

    .pet-tree-node {
        min-width: 100%;
    }

    .pet-orbit {
        min-height: 230px;
    }

    .orbit-main {
        left: 7%;
        top: 20%;
    }

    .orbit-sub {
        right: 8%;
        top: 24%;
    }

.orbit-sub2 {
    left: 34%;
    bottom: 8%;
}
}

main {
    padding: 8px;
    padding-bottom: 76px;
}

.top-hud {
    padding: 8px;
}

.card {
    padding: 10px;
    margin-bottom: 8px;
}

.btn {
    min-height: 38px;
    padding: 8px 10px;
}

.section-label.compact {
    margin: 0 0 8px;
    padding-bottom: 4px;
    font-size: 12px;
}

.top-hud > .top-hud-inner,
#view-explore .explore-shell:not([data-explore-ui-v1]) {
    opacity: 0;
}

.top-hud[data-explore-ui-v1] > *,
#view-explore .explore-shell[data-explore-ui-v1] {
    opacity: 1;
}

.explore-hud {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(180px, 0.72fr);
    align-items: stretch;
}

.explore-hud-player,
.explore-hud-pet,
.explore-hud-resources {
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
    background:
        linear-gradient(to bottom, rgba(255,252,243,0.92), rgba(244,232,193,0.72));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
}

.explore-hud-player,
.explore-hud-pet-body {
    display: flex;
    gap: 10px;
}

.explore-hud-pet {
    display: grid;
    gap: 8px;
}

.explore-hud-avatar,
.explore-hud-pet-avatar {
    width: 72px;
    height: 88px;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center 18%;
    border-radius: 12px;
    border: 1px solid rgba(139, 90, 43, 0.28);
    background: linear-gradient(to bottom, rgba(255,248,220,0.95), rgba(244,232,193,0.85));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}

.explore-hud-pet-avatar {
    width: 64px;
    height: 64px;
    border-radius: 14px;
}

.explore-hud-player-main,
.explore-hud-pet-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.explore-hud-name-row,
.explore-hud-pet-title-row,
.explore-panel-title-row,
.world-log-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.explore-hud-name,
.explore-panel-title-row strong {
    font-size: 18px;
    line-height: 1.1;
    font-weight: bold;
}

.explore-hud-identity,
.explore-hud-pet-meta,
.explore-hud-target,
.explore-panel-kicker,
.world-log-summary {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-sub);
}

.explore-hud-identity,
.explore-hud-meta,
.explore-hud-pet-meta,
.explore-panel-links,
.explore-ops-inline,
.world-log-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.explore-hud-target {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.52);
}

.explore-hud-vitals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.explore-hud-vital {
    display: grid;
    gap: 4px;
    padding: 7px 8px;
    border-radius: 9px;
    background: rgba(255,255,255,0.58);
}

.explore-hud-vital-head,
.explore-area-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-sub);
}

.explore-hud-vital-head b,
.explore-area-chip b {
    color: var(--text-main);
}

.explore-hud-pet-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.explore-hud-resources {
    display: grid;
    gap: 8px;
    align-content: start;
}

.explore-hud-resource {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.56);
    font-size: 12px;
    color: var(--text-sub);
}

.explore-hud-resource b {
    color: var(--text-main);
    font-size: 14px;
}

.explore-shell {
    display: block;
    min-height: 360px;
}

.explore-main-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.explore-panel-header {
    display: grid;
    gap: 8px;
}

.explore-panel-header-main {
    display: grid;
    gap: 4px;
}

.explore-area-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.explore-area-chip {
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 9px;
    background: rgba(255,255,255,0.56);
}

.explore-panel-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.explore-panel-links .mini-link,
.world-log-link,
.explore-panel-links button.mini-link {
    margin-left: 0;
    border: 1px solid rgba(139, 90, 43, 0.24);
    background: rgba(255,252,243,0.76);
    color: var(--border-wood);
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    font-family: inherit;
}

.scene-visual {
    height: 168px;
    margin-bottom: 0;
    border-width: 2px;
    border-radius: 12px;
}

.scene-desc {
    margin-bottom: 0;
    padding: 8px 10px;
    border-left-width: 2px;
    border-radius: 0 10px 10px 0;
    background: rgba(255,255,255,0.42);
    font-style: normal;
}

.quest-banner {
    margin-bottom: 0;
    padding: 7px 9px;
    border: 1px solid rgba(192,57,43,0.18);
    border-radius: 10px;
    background: rgba(255,241,238,0.74);
}

.explore-actions-strip {
    display: grid;
    gap: 8px;
}

.explore-main-btn {
    width: 100%;
    min-height: 38px;
    font-size: 15px;
}

.explore-ops-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.explore-subgrid {
    display: grid;
    gap: 8px;
}

.explore-subpanel {
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.42);
}

.travel-route-list {
    gap: 8px;
}

.travel-route-item {
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,252,243,0.88);
}

.world-log-card {
    margin-top: 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.42);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.world-log-head {
    margin-bottom: 0;
    align-items: center;
}

.world-log-head-main {
    min-width: 0;
    display: grid;
    gap: 4px;
    flex: 1;
}

.world-log-title {
    font-size: 14px;
    letter-spacing: 0.02em;
}

.world-log-summary {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.world-log-list {
    margin-top: 8px;
    max-height: 176px;
}

.world-log-item {
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
}

.compact-section {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.compact-section-header {
    margin: 0 0 6px;
    padding: 0 0 4px;
}

.compact-section-body {
    gap: 6px;
    max-height: none;
    padding-right: 0;
}

#map-entities {
    gap: 8px;
}

.compact-entity-row {
    min-height: 42px;
    padding: 6px 8px;
    border-radius: 10px;
    gap: 8px;
}

.compact-entity-avatar,
.compact-entity-row .entity-object-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.compact-entity-actions .btn {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
}

.battle-top-hint {
    display: none;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(184,134,11,0.32);
    background: linear-gradient(to right, rgba(255,248,220,0.95), rgba(244,232,193,0.88));
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-main);
    box-shadow: 0 8px 18px rgba(139,90,43,0.08);
}

.battle-top-hint.is-visible {
    display: block;
}

.battle-btns .btn.is-guided {
    border-color: rgba(184,134,11,0.9);
    box-shadow: 0 0 0 2px rgba(255,224,130,0.28), 0 10px 20px rgba(184,134,11,0.16);
}

.battle-turn-indicator {
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,252,243,0.86);
    border: 1px solid rgba(139,90,43,0.2);
    text-align: center;
    font-size: 12px;
    color: var(--border-wood);
}

.battle-turn-indicator[data-tone="ally"] {
    background: rgba(238,248,231,0.92);
    border-color: rgba(75,125,63,0.28);
    color: #35662d;
}

.battle-turn-indicator[data-tone="enemy"],
.battle-turn-indicator[data-tone="danger"] {
    background: rgba(255,239,234,0.92);
    border-color: rgba(192,57,43,0.28);
    color: #8f291f;
}

.battle-turn-indicator[data-tone="system"] {
    background: rgba(238,243,248,0.92);
    border-color: rgba(41,90,118,0.24);
    color: #295a76;
}

.battle-result-card {
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(139,90,43,0.22);
    background: linear-gradient(to right, rgba(255,252,243,0.96), rgba(244,232,193,0.86));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.38);
}

.battle-result-card.tone-win {
    border-color: rgba(75,125,63,0.32);
    background: linear-gradient(to right, rgba(241,250,236,0.96), rgba(219,236,206,0.88));
}

.battle-result-card.tone-lose {
    border-color: rgba(192,57,43,0.3);
    background: linear-gradient(to right, rgba(255,241,236,0.96), rgba(244,215,205,0.9));
}

.battle-result-title {
    font-weight: bold;
    margin-bottom: 6px;
}

.battle-result-lines {
    display: grid;
    gap: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.battle-float-feedback {
    position: absolute;
    left: 50%;
    top: 16%;
    transform: translate(-50%, 0);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    color: #8a2418;
    background: rgba(255,248,240,0.94);
    border: 1px solid rgba(192,57,43,0.28);
    box-shadow: 0 10px 20px rgba(62,39,35,0.12);
    animation: battleFloatUp 1.05s ease-out forwards;
    pointer-events: none;
    z-index: 3;
}

.battle-float-feedback span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-sub);
    text-align: center;
}

.battle-float-heal {
    color: #2f6d2a;
    border-color: rgba(75,125,63,0.28);
    background: rgba(241,250,236,0.96);
}

.battle-float-guard,
.battle-float-resist {
    color: #295a76;
    border-color: rgba(41,90,118,0.24);
    background: rgba(234,244,249,0.96);
}

.battle-float-crit,
.battle-float-danger {
    color: #8f291f;
}

.battle-float-advantage {
    color: #35662d;
    border-color: rgba(75,125,63,0.28);
    background: rgba(236,248,229,0.96);
}

@keyframes battleFloatUp {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.94); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -34px) scale(1.04); }
}

.battle-btns .btn {
    display: grid;
    gap: 2px;
    justify-items: center;
}

.battle-btn-main {
    font-size: 14px;
    font-weight: bold;
}

.battle-btn-sub {
    font-size: 10px;
    color: var(--text-sub);
}

.quest-track-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.quest-track-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.quest-track-kicker,
.quest-brief-title {
    font-size: 11px;
    color: var(--border-wood);
    letter-spacing: 0.04em;
}

.quest-track-title,
.quest-brief-text {
    font-size: 13px;
    color: var(--text-main);
    font-weight: bold;
    line-height: 1.45;
}

.quest-track-hint,
.quest-brief-hint {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.45;
}

.quest-track-action {
    min-width: 112px;
}

.explore-hud-pet-skill {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.45;
}

.entity-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.entity-tag-chip,
.world-log-type-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.5;
    background: rgba(255,252,243,0.88);
    border: 1px solid rgba(139,90,43,0.18);
    color: var(--border-wood);
}

.world-log-summary {
    display: grid;
    gap: 5px;
}

.world-log-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.world-log-summary-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-log-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.world-log-type-chip.danger,
.entity-tag-chip.danger {
    background: rgba(255,238,232,0.96);
    border-color: rgba(192,57,43,0.22);
    color: #8f291f;
}

.world-log-type-chip.player,
.world-log-type-chip.system,
.entity-tag-chip.system {
    background: rgba(234,244,249,0.96);
    border-color: rgba(41,90,118,0.2);
    color: #295a76;
}

.world-log-type-chip.ai,
.entity-tag-chip.ai {
    background: rgba(236,248,229,0.96);
    border-color: rgba(75,125,63,0.22);
    color: #35662d;
}

.status-layout {
    display: grid;
    gap: 8px;
}

.status-item-actions {
    display: flex;
    justify-content: flex-end;
}

.status-core-card,
.status-equipment-card,
.status-system-card,
#status-bag,
#ai-settings-card {
    background: linear-gradient(to bottom, rgba(255,252,243,0.92), rgba(244,232,193,0.74));
}

.status-hero {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.status-trainer-portrait {
    width: 78px;
    height: 96px;
    border-radius: 14px;
}

.status-hero-main {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 6px;
}

.status-hero-name-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.status-hpmp {
    display: grid;
    gap: 6px;
}

.status-resource-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.status-resource-pill {
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.58);
    font-size: 12px;
    color: var(--text-sub);
}

.status-resource-pill b {
    color: var(--text-main);
}

.status-slot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.status-slot-card {
    min-height: 118px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(139,90,43,0.18);
    background: rgba(255,255,255,0.62);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
    display: grid;
    gap: 6px;
    align-content: start;
}

.status-slot-kicker,
.status-equip-type {
    font-size: 11px;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-slot-title,
.status-equip-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
}

.status-slot-value {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-sub);
}

.status-equipment-list,
.status-item-grid {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.status-equip-card {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--rarity) 45%, rgba(139,90,43,0.18));
    background: rgba(255,255,255,0.66);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
}

.status-equip-head,
.status-item-head,
.status-equip-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.status-equip-desc,
.status-item-desc,
.status-item-use {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.5;
}

.status-equip-actions {
    margin-top: 8px;
}

.status-item-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(139,90,43,0.18);
    background: rgba(255,255,255,0.66);
}

.status-item-card.is-usable {
    border-color: rgba(75,125,63,0.26);
    background: linear-gradient(to right, rgba(244,252,238,0.94), rgba(255,255,255,0.74));
}

.status-item-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(139,90,43,0.22);
    background: linear-gradient(to bottom, rgba(255,248,220,0.94), rgba(236,221,183,0.74));
    font-weight: bold;
    color: var(--border-wood);
}

.status-item-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.status-item-qty {
    font-size: 12px;
    color: var(--text-sub);
}

.status-new-badge {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(192,57,43,0.14);
    color: #8f291f;
    font-size: 10px;
    font-weight: bold;
}

.status-empty-card,
.status-item-actions .btn {
    font-size: 12px;
}

.status-item-note {
    font-size: 12px;
    color: var(--text-sub);
}

.status-empty-card {
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.5);
    color: var(--text-sub);
}

.pet-card-roleline {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.5;
}

@media (min-width: 900px) {
    .explore-hud {
        grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr) minmax(190px, 0.75fr);
    }

    .scene-visual {
        height: 224px;
    }

    .explore-subgrid {
        grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
        align-items: start;
    }

    .status-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        align-items: start;
    }

    .status-core-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    main,
    .top-hud {
        padding: 8px;
    }

    .explore-hud {
        grid-template-columns: minmax(0, 1fr) 128px;
        gap: 6px;
    }

    .explore-hud-player,
    .explore-hud-pet,
    .explore-hud-resources,
    .explore-subpanel,
    .world-log-card {
        padding: 8px;
        min-width: 0;
    }

    .explore-hud-player {
        grid-column: 1 / 2;
    }

    .explore-hud-pet {
        grid-column: 2 / 3;
        align-self: start;
    }

    .explore-hud-resources {
        grid-column: 1 / -1;
    }

    .explore-hud-player,
    .explore-hud-pet-body {
        gap: 6px;
    }

    .explore-hud-pet-body {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: start;
    }

    .explore-hud-avatar {
        width: 56px;
        height: 68px;
    }

    .explore-hud-pet-avatar {
        width: 48px;
        height: 48px;
    }

    .explore-hud-name,
    .explore-panel-title-row strong {
        font-size: 16px;
    }

    .explore-hud-meta,
    .explore-hud-identity,
    .explore-hud-pet-meta,
    .explore-hud-resources {
        gap: 4px;
        min-width: 0;
    }

    .explore-hud-resource,
    .explore-hud-resource b,
    .explore-hud-identity,
    .explore-hud-meta,
    .explore-hud-pet-meta {
        min-width: 0;
        word-break: break-word;
    }

    .explore-hud-target,
    .explore-hud-pet-skill {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .explore-hud-target {
        font-size: 11px;
        line-height: 1.45;
    }

    .explore-hud-pet-meta span:last-child,
    .explore-hud-pet-top .quality-pill,
    .explore-hud-resources .explore-hud-resource:last-child,
    .explore-hud-pet .bar-wrap.compact:last-of-type,
    .explore-hud-pet-skill {
        display: none;
    }

    .explore-hud-pet-top,
    .explore-hud-pet-main,
    .explore-hud-pet-title-row,
    .explore-hud-pet-meta,
    .explore-hud-pet .bar-wrap.compact {
        min-width: 0;
        width: 100%;
    }

    .explore-hud-pet .bar-value,
    .explore-hud-pet .bar-label {
        font-size: 11px;
    }

    .explore-hud-pet .bar-value {
        width: auto;
    }

    .explore-hud-pet .bar-wrap.compact {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 4px;
        align-items: center;
    }

    .explore-hud-pet .bar-value {
        text-align: right;
    }

    .explore-hud-vitals,
    .explore-area-meta,
    .explore-hud-resources {
        grid-template-columns: 1fr 1fr;
    }

    .quest-track-card,
    .status-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .status-layout,
    .status-slot-grid,
    .status-resource-strip {
        grid-template-columns: 1fr;
    }

    .status-item-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .status-item-actions {
        grid-column: 1 / -1;
    }

    .status-equip-actions,
    .battle-btns {
        grid-template-columns: 1fr 1fr;
    }

    .explore-main-panel {
        gap: 6px;
    }

    .explore-panel-header {
        gap: 6px;
        order: 0;
    }

    .explore-actions-strip {
        order: 1;
    }

    .scene-visual {
        order: 2;
        height: 88px;
    }

    .scene-desc {
        order: 3;
        padding: 7px 8px;
        font-size: 12px;
        line-height: 1.55;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .explore-subgrid {
        order: 4;
        gap: 6px;
    }

    .stage-goal-card {
        order: 5;
    }

    #world-log-card {
        order: 6;
    }

    #map-entities {
        gap: 6px;
    }

    .explore-ops-inline {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .explore-main-btn,
    .explore-ops-inline .btn,
    .travel-route-item,
    .compact-entity-row {
        min-height: 38px;
    }

    .world-log-list {
        max-height: 132px;
    }

    .nav-btn.active {
        transform: none;
    }
}
