:root {
    --bg1: #eaf2fc;
    --bg2: #d4e4f5;
    --bg3: #c2d8ef;
    --panel-bg: rgba(255, 255, 255, 0.72);
    --panel-bg-soft: rgba(255, 255, 255, 0.5);
    --panel-bg-hover: rgba(255, 255, 255, 0.9);

    --gold: #c9a54b;
    --gold-dark: #b8902e;
    --gold-deep: #a8872e;
    --gold-light: #e8cf8a;
    --gold-glow: rgba(200, 165, 75, 0.25);

    --text-dark: #2c3e5c;
    --text-body: #3d5170;
    --text-muted: #7e95b5;
    --text-label: #8a96ad;
    --text-gold: #7e6a2e;

    --border-gold: rgba(201, 165, 75, 0.45);
    --border-gold-light: rgba(201, 165, 75, 0.25);
    --shadow-panel: 0 4px 18px rgba(80, 110, 150, 0.08);
    --shadow-open: 0 6px 26px rgba(180, 150, 70, 0.18);
}

/* —— 本HUD的CSS全作用域限定在.hud之下 —— */
.hud {
    max-width: 820px;
    width: 100%;
    background:rgba(255, 253, 246, 0.95);  /* 新增 */
    border-radius: 16px; 
}
/* 顶部金色装饰 */
.hud .ornament-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}
.hud .ornament-line .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hud .ornament {
    text-align: center;
    color: var(--gold);
    font-size: 0.75rem;
    letter-spacing: 4px;
    opacity: 0.9;
    white-space: nowrap;
}

/* 当前位置栏 */
.hud .location-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 14px;
    background: var(--panel-bg);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    letter-spacing: 0.4px;
    box-shadow: 0 4px 20px rgba(90, 120, 160, 0.1);
}
.hud .location-bar .mark {
    color: var(--gold-dark);
    font-weight: bold;
}

/* 折叠面板 */
.hud details {
    background: var(--panel-bg);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-panel);
    transition: border 0.25s, box-shadow 0.25s;
}
.hud details[open] {
    border-color: var(--gold);
    box-shadow: var(--shadow-open);
}
.hud summary {
    cursor: pointer;
    font-weight: bold;
    color: #3a567c;
    font-size: 1rem;
    letter-spacing: 2px;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hud summary::before {
    content: "❖";
    color: var(--gold);
    font-size: 0.9rem;
    transition: transform 0.2s;
}
.hud details[open] summary::before {
    content: "✦";
    color: var(--gold-deep);
}
.hud .panel-inner {
    margin-top: 10px;
    border-top: 1px dashed rgba(180, 150, 70, 0.5);
    padding-top: 12px;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--text-body);
}

/* 数值网格 */
.hud .field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 4px 14px;
}
.hud .field-grid .label {
    color: var(--text-muted);
    margin-right: 6px;
    font-size: 0.9rem;
}
.hud .field-grid .value {
    color: var(--text-dark);
    font-weight: 500;
}

/* 当前状态面板 */
.hud .condition-panel {
    margin-top: 10px;
    border-radius: 8px;
    background: rgba(201, 165, 75, 0.06);
    border: 1px solid var(--border-gold-light);
    overflow: hidden;
}
.hud .condition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.65);
    padding: 8px 14px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--text-gold);
    border-bottom: 1px solid var(--border-gold-light);
    font-weight: bold;
}
.hud .condition-header .status-light {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.hud .condition-header .status-light span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0dae8;
    animation: hud-pulse 1.8s infinite;
}
.hud .condition-header .status-light span.active {
    background: var(--gold);
}
.hud .condition-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px 12px;
    font-size: 0.9rem;
}
.hud .condition-body .cond-label {
    color: var(--text-label);
    margin-right: 6px;
    font-size: 0.82rem;
}
.hud .condition-body .cond-value {
    color: var(--text-dark);
    font-weight: 500;
}
.hud .condition-body .cond-bar {
    grid-column: 1 / -1;
    background: #eef2f8;
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid #dce4f0;
}
.hud .condition-body .cond-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s;
}
.hud .cond-divider {
    grid-column: 1 / -1;
    border-top: 1px dashed rgba(180, 150, 70, 0.3);
    margin: 4px 0;
}

/* 氛围描述区 */
.hud .desire-trace {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(201, 165, 75, 0.06);
    border-left: 3px solid var(--gold);
    font-style: italic;
    color: #6b5b33;
    font-size: 0.88rem;
    line-height: 1.7;
}

/* 牵绊进度条 */
.hud .oath-meter {
    margin-top: 12px;
    background: #e8edf5;
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #ccd9ea;
}
.hud .oath-meter .fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 20px;
    transition: width 0.5s;
    box-shadow: 0 0 12px var(--gold-glow);
}

/* 十二封印 */
.hud .trial-track {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.hud .trial-node {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #b8c8df;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #7e93b2;
    background: rgba(255, 255, 255, 0.6);
    font-weight: bold;
    transition: all 0.3s;
}
.hud .trial-node.done {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 14px var(--gold-glow);
}
.hud .trial-node.locked {
    opacity: 0.35;
}

/* 记忆表格 */
.hud .memory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 0.88rem;
}
.hud .memory-table th {
    text-align: left;
    color: var(--text-muted);
    border-bottom: 1px solid #d4dce9;
    padding: 5px 8px;
    font-weight: normal;
    letter-spacing: 1px;
}
.hud .memory-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #e2e8f1;
    color: var(--text-body);
    background: rgba(255, 255, 255, 0.3);
}
.hud .memory-table tr:hover td {
    background: rgba(201, 165, 75, 0.1);
}

/* 行动列表 */
.hud .action-list {
    list-style: none;
    margin-top: 6px;
}
.hud .action-list li {
    padding: 9px 14px 9px 30px;
    border-left: 3px solid var(--gold);
    background: var(--panel-bg-soft);
    margin-bottom: 7px;
    border-radius: 0 6px 6px 0;
    position: relative;
    transition: background 0.2s, transform 0.2s;
    color: var(--text-dark);
    cursor: pointer;
}
.hud .action-list li::before {
    content: "❖";
    position: absolute;
    left: 10px;
    color: var(--gold);
}
.hud .action-list li:hover {
    background: var(--panel-bg-hover);
    transform: translateX(3px);
}

/* 世界状态标签 */
.hud .world-tag {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.hud .world-tag span {
    background: var(--panel-bg-soft);
    border: 1px solid var(--border-gold-light);
    padding: 3px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-gold);
}

/* 页脚 */
.hud .footer-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 3px;
}
.hud .footer-note span {
    color: var(--gold);
}

/* 动画 */
@keyframes hud-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* 响应式 */
@media (max-width: 600px) {
    .hud .condition-body {
        grid-template-columns: 1fr 1fr;
    }
}

/* ================================================
   输入控件保护 —— 不修改任何输入框样式
   以下部分是全局重置，只保护，不美化作弊
   ================================================ */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: inherit;
    border: inherit;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}