/* 木叶容器初始化 */
ai {
    --bg: #f5f0e6;
    --card: #fffaf0;
    --card-tint: rgba(93, 78, 55, 0.06);
    --border: rgba(93, 78, 55, 0.25);
    --header: #c9a86c;
    --header-light: #d4b88c;
    --accent: #c75b39;
    --accent-brown: #5d4e37;
    --accent-green: #6a9e4a;
    --text: #4a3f35;
    --text-light: #6d5e4c;
    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 var(--border);
  background: var(--card);
  border-radius: 6px;
  overflow: hidden;
}

/* 卷轴标题高度增加 6px (通过增加 padding 达成) */
summary {
  padding: 11px 15px;
  background: var(--header);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: bold;
  border-left: 5px solid var(--accent);
  display: flex;
  justify-content: space-between;
}

details[open] summary { background: var(--header-light); }

/* 火影岩顶部通告栏 + 忍界跑马灯 */
hd {
    display: block;
    background: rgba(201, 168, 108, 0.95);
    border-bottom: 1px solid var(--accent-brown);
    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); font-weight: bold; }
hd l { display: block; font-size: 0.8em; color: var(--text-light); margin-bottom: 5px; }
nw {
    display: block;
    background: rgba(199, 91, 57, 0.12);
    height: 22px;
    line-height: 22px;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}
nw span {
    position: absolute;
    white-space: nowrap;
    color: var(--accent);
    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: var(--text);
    letter-spacing: 2px;
    text-align: justify;
    border-bottom: 2px solid rgba(93, 78, 55, 0.12);
    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: var(--header);
    color: var(--text);
    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);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* 忍者属性与查克拉进度条 */
f { font-size: 1.3em; font-weight: bold; color: var(--accent); border-bottom: 2px solid var(--accent); 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: rgba(93, 78, 55, 0.15); 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); }

/* 忍术·体术·幻术属性气泡网格 */
div[g] { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
atr {
    background: var(--card-tint);
    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); }

/* 同伴/对手情报动态高亮卡片 */
n {
    display: block;
    background: rgba(255, 255, 255, 0.5);
    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);
    box-shadow: 0 0 15px rgba(199, 91, 57, 0.15);
    transform: translateY(-2px);
}
name { font-size: 1.1em; font-weight: bold; color: var(--text); display: inline-block; }
fav { float: right; color: var(--accent); font-family: monospace; font-weight: bold; }
q { display: block; margin-top: 10px; padding: 8px; background: var(--card-tint); border-left: 2px solid var(--accent); font-style: italic; font-size: 0.9em; }

/* 忍具资产与人际羁绊 */
inv f { font-size: 1.1em; color: var(--accent-green); border: none; }
inv i { color: var(--accent); text-decoration: underline dotted; cursor: help; margin: 0 3px; }
rel h { display: block; text-align: center; font-size: 0.7em; color: var(--text-light); 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); margin-bottom: 5px; }
r { display: flex; border-bottom: 1px solid rgba(93, 78, 55, 0.15); min-width: 300px; }
r:first-of-type { background: rgba(201, 168, 108, 0.35); color: var(--text); font-weight: bold; }
c { padding: 8px 5px; flex: 1; font-size: 0.75em; border-right: 1px solid rgba(93, 78, 55, 0.15); }

/* 忍术行动选择按钮 */
btn {
    display: block;
    background: linear-gradient(90deg, var(--header), var(--header-light));
    border: 1px solid var(--accent-brown);
    color: var(--text);
    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); color: var(--card); transform: scale(1.02); }
@keyframes pulse { 0%, 100% { border-color: var(--accent-brown); box-shadow: 0 0 5px rgba(93, 78, 55, 0.15); } 50% { border-color: var(--accent); box-shadow: 0 0 15px rgba(199, 91, 57, 0.25); } }

/* 忍具说明全局气泡提示 */
[tip] { position: relative; }
[tip]:hover::after {
    content: attr(tip);
    position: absolute;
    bottom: 100%; left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    border: 1px solid var(--accent-brown);
    color: var(--text);
    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.15);
}

/* 技能名称特效字幕 */
.jutsu {
    display: inline-block;
    font-weight: 900;
    font-size: 1.15em;
    letter-spacing: 1px;
    color: transparent !important;
    background: linear-gradient(180deg, #ff8c42 0%, #e04e2f 50%, #a83232 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0.5px #ffd76e;
    text-shadow:
        0 0 3px rgba(255, 100, 50, 0.85),
        0 0 6px rgba(199, 91, 57, 0.65),
        0 0 10px rgba(199, 91, 57, 0.35);
    padding: 0 1px;
    vertical-align: middle;
}
