/* 容器初始化 */
ai {
    --bg: #0d0f14;
    --card: rgba(22, 27, 34, 0.8);
    --border: rgba(56, 139, 253, 0.2);
    --accent-blue: #58a6ff;
    --accent-purple: #bc8cff;
    --accent-green: #3fb950;
    --accent-red: #ff7b72;
    --text: #dce5ee;
    display: block;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, system-ui, "SimHei", "Microsoft YaHei", sans-serif;
    padding: 18px;
    line-height: 1.6;
    max-width: 100%;
}

/* 模块间距增加 6px */
details {
  margin-bottom: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgb(24, 24, 29);
}

/* 标题高度增加 6px (通过增加 padding 达成) */
summary {
  padding: 11px 15px; 
  background: #191e2c;
  color: #cfe8ff;
  cursor: pointer;
  list-style: none;
  font-size: 17px; /* 字号加大一号 */
  font-weight: bold;
  border-left: 5px solid #4db8ff;
  display: flex;
  justify-content: space-between;
}

details[open] summary { background: #1d1e41; }

/* 顶部吸顶栏 + 跑马灯 */
hd {
    display: block;
    background: rgba(13, 15, 20, 0.95);
    border-bottom: 1px solid var(--accent-blue);
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(4px);
}
hd t { display: block; font-family: monospace; font-size: 1.4em; color: var(--accent-blue); font-weight: bold; }
hd l { display: block; font-size: 0.8em; color: #8b949e; margin-bottom: 5px; }
nw {
    display: block;
    background: rgba(255, 123, 114, 0.1);
    height: 22px;
    line-height: 22px;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}
nw span {
    position: absolute;
    white-space: nowrap;
    color: var(--accent-red);
    font-size: 0.8em;
    font-weight: bold;
    animation: scroll 15s linear infinite;
}
@keyframes scroll { 0% { left: 100%; } 100% { left: -100%; } }

/* 正文保持 16px 以上 */
text {
    padding: 20px 15px;
    font-size: 17px;
    line-height: 1.8;
    color: #ebf6ff;
    letter-spacing: 2px;
    text-align: justify;
    border-bottom: 2px solid #1a1a1a;
    margin-bottom: 20px;
    white-space: pre-wrap;
}
text p { margin-bottom: 1.5em; text-indent: 2em; }

/* 系统终端折叠面板 */
st { display: block; margin: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
st summary {
    padding: 14px;
    background: rgb(61, 69, 80);
    color: var(--accent-blue);
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

/* 标签标题装饰 */
st p[t] { padding: 15px; border-bottom: 1px solid var(--border); position: relative; }
st p[t]::before {
    content: attr(t);
    display: block;
    font-size: 0.7em;
    color: var(--accent-purple);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* 玩家属性与进度条 */
f { font-size: 1.3em; font-weight: bold; color: #fff; border-bottom: 2px solid var(--accent-blue); margin-right: 5px; }
bar { display: flex; align-items: center; gap: 8px; font-size: 0.85em; margin: 5px 0; }
bar b {
    flex: 1; height: 6px; background: #30363d; border-radius: 3px; position: relative; overflow: visible;
}
bar b::after {
    content: '';
    position: absolute;
    left: 0; top: 0; height: 100%;
    width: calc(var(--v, 0) * 1%);
    background: currentColor;
    border-radius: 3px;
    box-shadow: 0 0 8px currentColor;
}
bar b[c="g"] { color: var(--accent-green); }
bar b[c="b"] { color: var(--accent-blue); }

/* 属性气泡网格 */
div[g] { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
atr {
    background: rgba(255,255,255,0.05);
    padding: 8px 4px;
    text-align: center;
    border-radius: 4px;
    font-size: 1em;
    border: 1px solid var(--border);
    cursor: help;
}
atr::before { content: attr(v); display: block; font-size: 1.2em; font-weight: bold; color: var(--accent-purple); }

/* NPC 动态高亮卡片 */
n {
    display: block;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    line-height: 2;
    position: relative;
    transition: 0.5s;
}
n:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(188, 140, 255, 0.2);
    transform: translateY(-2px);
}
name { font-size: 1.1em; font-weight: bold; color: #fff; display: inline-block; }
fav { float: right; color: var(--accent-red); font-family: monospace; font-weight: bold; }
q { display: block; margin-top: 10px; padding: 8px; background: rgba(0,0,0,0.2); border-left: 2px solid var(--accent-purple); font-style: italic; font-size: 0.9em; }

/* 资财与关系 */
inv f { font-size: 1.1em; color: var(--accent-green); border: none; }
inv i { color: var(--accent-blue); text-decoration: underline dotted; cursor: help; margin: 0 3px; }
rel h { display: block; text-align: center; font-size: 0.7em; color: #8b949e; margin: 10px 0; }

/* 记忆表格 */
tab { display: block; width: 100%; overflow-x: auto; margin-bottom: 15px; }
tab h { display: block; font-size: 0.8em; color: var(--accent-blue); margin-bottom: 5px; }
r { display: flex; border-bottom: 1px solid #30363d; min-width: 300px; }
r:first-of-type { background: rgba(56, 139, 253, 0.1); color: #fff; font-weight: bold; }
c { padding: 8px 5px; flex: 1; font-size: 0.75em; border-right: 1px solid #30363d; }

/* 行动按钮 */
btn {
    display: block;
    background: linear-gradient(90deg, #21262d, #30363d);
    border: 1px solid var(--accent-blue);
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 0.9em;
    transition: 0.3s;
    animation: pulse 2s infinite ease-in-out;
}
btn:hover { background: var(--accent-blue); color: #0d0f14; transform: scale(1.02); }
@keyframes pulse { 0%, 100% { border-color: var(--accent-blue); box-shadow: 0 0 5px rgba(88, 166, 255, 0.2); } 50% { border-color: #161b22; box-shadow: 0 0 15px rgba(88, 166, 255, 0.5); } }

/* 全局气泡提示 */
[tip] { position: relative; }
[tip]:hover::after {
    content: attr(tip);
    position: absolute;
    bottom: 100%; left: 50%;
    transform: translateX(-50%);
    background: #161b22;
    border: 1px solid var(--accent-blue);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 18px;
    font-family: "SimHei";
    white-space: nowrap;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}

