/* 検索結果をシュパッと出すための演出 */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/*
 * Apple Dictionary XML — 読み取りやすさ優先
 * - 主文（定義）: 明るいグレー白
 * - 副情報（発音・品詞・ラベル）: 抑えたグレー
 * - 用例: イタリック + 一段暗い色
 * - 階層: 左インデント + 番号列
 */

.dict-entry-body {
    color: #cbd5e1;
}

.apple-dict-root {
    --dict-fg: #f1f5f9;
    --dict-fg-muted: #94a3b8;
    --dict-fg-subtle: #64748b;
    --dict-accent: #7dd3fc;
    --dict-line: rgba(71, 85, 105, 0.65);
    --dict-indent: 1.25rem;
    --dict-indent-deep: 2rem;

    color: #cbd5e1;
    line-height: 1.6;
    font-size: 15px;
}

/* XML 変換後は div.entry（旧 d:entry） */
.apple-dict-root .entry {
    display: block;
}

/* 見出し語はページの h1 と重複するため非表示（発音行だけ残す） */
.apple-dict-root .hg .hw {
    display: none;
}

/* 発音: 小さめ・抑えた色（Apple のメタ行に近い） */
.apple-dict-root .hg {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.35rem;
    margin: 0 0 0.5rem;
}

.apple-dict-root .prx {
    display: inline;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--dict-fg-muted);
    font-family: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.apple-dict-root .ph {
    font-style: normal;
    color: var(--dict-fg-muted);
}

/* 品詞: 一段小さく、彩度を抑える */
.apple-dict-root .posg {
    display: block;
    margin: 0.2rem 0 0.85rem;
    line-height: 1.45;
}

.apple-dict-root .pos {
    display: inline;
    margin: 0;
    font-style: italic;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--dict-fg-muted);
}

.apple-dict-root .infg {
    display: inline;
    margin: 0 0 0 0.35rem;
    font-size: 0.85rem;
    color: var(--dict-fg-subtle);
}

/* 分野・用法ラベル（Statistics, informal など） */
.apple-dict-root .lg,
.apple-dict-root .sj {
    font-size: 0.82rem;
    color: var(--dict-fg-subtle);
    font-style: normal;
    font-weight: 500;
}

.apple-dict-root .reg,
.apple-dict-root .ge {
    font-size: 0.8rem;
    color: var(--dict-fg-subtle);
    font-style: italic;
}

.apple-dict-root .lbl {
    font-size: 0.85em;
    color: var(--dict-fg-muted);
}

/* 区切り文字は行内のまま */
.apple-dict-root .gp,
.apple-dict-root .tg_df,
.apple-dict-root .tg_eg,
.apple-dict-root .tg_gg,
.apple-dict-root .tg_msDict,
.apple-dict-root .tg_pos,
.apple-dict-root .tg_infg,
.apple-dict-root .tg_hw,
.apple-dict-root .tg_etym,
.apple-dict-root .tg_vg,
.apple-dict-root .tg_fg,
.apple-dict-root .tg_se2,
.apple-dict-root .tg_subEntryBlock {
    display: inline;
}

/* 定義ブロック全体を少しインデント */
.apple-dict-root .sg {
    padding-left: var(--dict-indent);
    border-left: 2px solid rgba(51, 65, 85, 0.5);
    margin-left: 0.15rem;
}

/* 番号付き義（元 XML は span.se2） */
.apple-dict-root .se2 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
    margin-top: 0.65rem;
}

.apple-dict-root .se2 > span:first-child {
    flex: 0 0 auto;
    min-width: 1.25rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--dict-fg-subtle);
}

.apple-dict-root .se2 > .msDict {
    flex: 1 1 12rem;
    min-width: 0;
    margin: 0;
}

.apple-dict-root .se2 > .msDict.t_subsense,
.apple-dict-root .se2 > .msDict.hasSn.t_subsense {
    flex-basis: 100%;
    padding-left: var(--dict-indent-deep);
    margin-top: 0.4rem;
    margin-left: 0.25rem;
    border-left: 2px solid rgba(100, 116, 139, 0.45);
}

.apple-dict-root .se1 {
    display: block;
    margin-top: 0.2rem;
}

/* 定義本文 */
.apple-dict-root .df {
    display: inline;
    font-weight: 500;
    color: var(--dict-fg);
}

.apple-dict-root .gg {
    display: inline;
    font-size: 0.84rem;
    color: var(--dict-fg-subtle);
    font-style: italic;
    margin-right: 0.2rem;
}

/* 用例 */
.apple-dict-root .eg {
    display: inline;
    margin: 0;
    color: var(--dict-fg-muted);
    font-style: italic;
}

.apple-dict-root .eg + .eg {
    margin-left: 0.2rem;
}

.apple-dict-root .ex {
    display: inline;
    margin: 0 0.15rem;
    padding-left: 0.4rem;
    border-left: 2px solid rgba(100, 116, 139, 0.5);
    color: var(--dict-fg-muted);
    font-style: italic;
}

.apple-dict-root .bold {
    font-weight: 700;
    font-style: normal;
    color: #e2e8f0;
}

/* 小見出し PHRASES / ORIGIN（線は section / aside 側に一本化） */
.apple-dict-root .x_xoLblBlk.ty_label {
    display: block;
    margin: 0 0 0.55rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dict-fg-subtle);
}

.apple-dict-root .subEntryBlock {
    display: block;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dict-line);
}

.apple-dict-root .subEntry {
    display: block;
    margin-top: 0.75rem;
    padding-left: 0.35rem;
}

.apple-dict-root .subEntry .l,
.apple-dict-root .x_xoh .l {
    font-weight: 600;
    color: #e2e8f0;
}

.apple-dict-root .etym {
    display: block;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dict-line);
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--dict-fg-muted);
    font-style: italic;
}

.apple-dict-root .etym .gp.ty_label,
.apple-dict-root .etym .gp.x_xoLblBlk {
    font-style: normal;
    display: inline;
    margin-right: 0.35rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dict-fg-subtle);
}

.apple-dict-root .subentry {
    display: block;
    margin-top: 0.75rem;
}

.apple-dict-root a {
    color: var(--dict-accent);
    text-decoration: none;
    pointer-events: none;
}

.apple-dict-root .ff {
    font-style: italic;
}

.apple-dict-root .date,
.apple-dict-root .la {
    color: var(--dict-fg-subtle);
    font-size: 0.9em;
}

