/* ============================================================
   阿琛与伞 · ESO 攻略笔记  —  v3 Redesign
   ============================================================ */

:root {
    --bg-0:       #15120f;
    --bg-1:       #1e1a14;
    --bg-2:       #282218;
    --bg-3:       rgba(40,34,24,.55);
    --line:       #453a18;
    --line-mid:   #5e5024;
    --line-bright:#8f7a38;

    --text:       #f2ead8;
    --text-dim:   #c9bd9a;
    --text-mute:  #8f8158;

    --gold:       #d4a83c;
    --gold-2:     #f8d058;
    --gold-3:     #ffe88a;
    --gold-soft:  rgba(212,168,60,.18);
    --gold-glow:  rgba(212,168,60,.52);

    --red:    #c05040;
    --yellow: #e0b858;
    --purple: #9e80cc;

    --radius:    18px;
    --radius-sm: 10px;
    --t:         .26s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--line-bright) var(--bg-0);
}
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    color: var(--text);
    background-color: var(--bg-0);
    background-image:
        radial-gradient(ellipse 1600px 800px at 70% -10%, #3a2812 0%, transparent 55%),
        radial-gradient(ellipse 1000px 700px at 0%   45%,  #152535 0%, transparent 60%),
        radial-gradient(ellipse 700px  500px at 100% 85%,  #1c1834 0%, transparent 55%);
    background-attachment: fixed;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* 菱形底纹 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg,  transparent, transparent 48px, rgba(212,168,60,.028) 48px, rgba(212,168,60,.028) 49px),
        repeating-linear-gradient(-45deg, transparent, transparent 48px, rgba(212,168,60,.028) 48px, rgba(212,168,60,.028) 49px);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--gold-2); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--gold-3); }

h1, h2, h3, h4, h5 { font-family: "Cinzel", serif; letter-spacing: .04em; }

/* ========== TOPBAR ========== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 40px;
    background: rgba(21,18,15,.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--line-mid), 0 4px 32px rgba(0,0,0,.6);
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 20%, var(--gold-2) 50%, var(--gold) 80%, transparent 100%);
    opacity: .5;
}

.brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.topbar-end {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.brand-mark {
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow), 0 0 40px rgba(212,168,60,.22);
    animation: pulse-glow 3.5s ease-in-out infinite;
    line-height: 1;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 12px var(--gold-glow); }
    50%       { text-shadow: 0 0 28px var(--gold-glow), 0 0 56px rgba(212,168,60,.3); }
}

.brand-text h1 {
    font-size: 19px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 55%, var(--gold-3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text p {
    margin: 1px 0 0;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: .16em;
    text-transform: uppercase;
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.nav a {
    position: relative;
    color: var(--text-mute);
    font-size: 13px;
    padding: 7px 15px;
    border-radius: 8px;
    transition: all var(--t);
    letter-spacing: .04em;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 15px; right: 15px;
    height: 1px;
    background: var(--gold-2);
    transform: scaleX(0);
    transition: transform var(--t);
    transform-origin: center;
}

.nav a:hover { color: var(--gold-2); background: rgba(212,168,60,.1); }
.nav a:hover::after { transform: scaleX(1); }

.nav-toggle {
    display: none;
    background: none;
    color: var(--gold);
    border: 1px solid var(--line-mid);
    border-radius: 8px;
    width: 40px; height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: border-color var(--t), color var(--t);
}
.nav-toggle:hover { border-color: var(--gold); color: var(--gold-2); }

.theme-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: 0;
    border-radius: 8px;
    border: 1px solid var(--line-mid);
    background: rgba(212,168,60,.06);
    color: var(--gold);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: border-color var(--t), background var(--t), color var(--t);
    font-family: inherit;
}
.theme-toggle:hover {
    border-color: var(--gold);
    color: var(--gold-2);
    background: var(--gold-soft);
}

/* ========== HERO ========== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 36px 40px 28px;
    text-align: center;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 360px at 50% 110%, rgba(212,168,60,.1) 0%, transparent 70%),
        radial-gradient(ellipse 400px 200px at 50% -10%, rgba(212,168,60,.06) 0%, transparent 70%);
    pointer-events: none;
}

/* 顶部装饰横线 */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-mid), transparent);
}

.hero-badge {
    display: inline-block;
    padding: 3px 16px;
    border: 1px solid rgba(212,168,60,.45);
    border-radius: 999px;
    background: rgba(212,168,60,.07);
    color: var(--gold);
    font-size: 10px;
    letter-spacing: .24em;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-family: "Cinzel", serif;
    position: relative; z-index: 1;
}

.hero-title {
    font-family: "Cinzel", serif;
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 40%, var(--gold-3) 65%, var(--gold-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 22px rgba(212,168,60,.35));
    margin-bottom: 8px;
    letter-spacing: .1em;
    position: relative; z-index: 1;
}

.hero-sub {
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: .14em;
    margin-bottom: 16px;
    position: relative; z-index: 1;
}

.hero-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
    position: relative; z-index: 1;
}

.hero-ornament-line {
    width: 120px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-ornament-gem {
    color: var(--gold-2);
    font-size: 13px;
    text-shadow: 0 0 12px var(--gold-glow);
}

.hero-nav-hint {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative; z-index: 1;
}

.hero-nav-hint a {
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: .06em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: 1px solid var(--line-mid);
    border-radius: 999px;
    transition: all var(--t);
    background: rgba(0,0,0,.25);
}

.hero-nav-hint a:hover {
    color: var(--gold-2);
    border-color: var(--gold);
    background: var(--gold-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212,168,60,.18);
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 8px 40px 80px;
    position: relative;
    z-index: 1;
}

/* ========== CARD — 渐变描边 ========== */
.card {
    position: relative;
    z-index: 1;
    background: linear-gradient(155deg, #242018 0%, #191610 100%);
    border-radius: var(--radius);
    padding: 32px 36px;
    margin-bottom: 24px;
    scroll-margin-top: 90px;
    /* 渐变边框用 outline + before 实现 */
    outline: 1px solid var(--line-mid);
    box-shadow:
        0 2px 0 rgba(255,255,255,.03) inset,
        0 16px 52px rgba(0,0,0,.6);
    transition: outline-color var(--t), box-shadow var(--t);
    overflow: hidden;
}

/* 卡片顶部高亮条 */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, var(--line-bright) 30%, var(--gold) 50%, var(--line-bright) 70%, transparent 95%);
    opacity: .55;
    transition: opacity var(--t);
}

/* hover 时顶部高亮加强 + 金色外描边 */
.card:hover {
    outline-color: var(--gold);
    box-shadow:
        0 2px 0 rgba(255,255,255,.03) inset,
        0 16px 52px rgba(0,0,0,.6),
        0 0 0 1px rgba(212,168,60,.3),
        0 0 32px rgba(212,168,60,.08);
}

.card:hover::before { opacity: .9; }

/* ========== SECTION HEAD ========== */
.section-head {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-mid);
}

.section-num {
    flex: 0 0 auto;
    width: 56px; height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 35%, #383018, #161410);
    color: var(--gold-2);
    font-family: "Cinzel", serif;
    font-weight: 900;
    font-size: 17px;
    /* 三层 box-shadow：内圈描边、中圈光晕、外层模糊 */
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 5px rgba(212,168,60,.1),
        0 0 22px rgba(212,168,60,.25);
    position: relative;
}

/* 双圆内装饰 */
.section-num::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px solid rgba(212,168,60,.22);
    pointer-events: none;
}

.section-head > div { flex: 1; min-width: 0; }

.section-head h3 {
    font-size: 21px;
    color: var(--text);
    margin-bottom: 4px;
    font-weight: 700;
}

.section-head p {
    margin: 0;
    color: var(--text-mute);
    font-size: 12px;
    letter-spacing: .07em;
}

/* ========== DETAILS / COLLAPSE ========== */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

details > summary.section-head {
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--line-mid);
    margin-bottom: 0;
    border-radius: 6px;
    transition: background var(--t);
    padding: 2px 4px;
}

details > summary.section-head:hover { background: rgba(212,168,60,.04); }
details[open] > summary.section-head { margin-bottom: 28px; }
details > summary.section-head:hover .section-num {
    box-shadow:
        0 0 0 1px var(--gold-2),
        0 0 0 6px rgba(212,168,60,.16),
        0 0 30px rgba(212,168,60,.35);
}

.collapse-arrow {
    margin-left: auto;
    font-size: 20px;
    color: var(--text-mute);
    transition: transform var(--t), color var(--t);
    flex-shrink: 0;
}
details[open] .collapse-arrow { transform: rotate(180deg); color: var(--gold); }

/* ========== STORY ========== */
.story-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: stretch;
}

.story-image { position: relative; }

.story-image img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: top;
    border-radius: 12px;
    border: 1px solid var(--line-mid);
    cursor: zoom-in;
    transition: transform .3s, border-color .3s;
}

.story-image img:hover { transform: scale(1.01); border-color: var(--gold); }

.story-image figcaption {
    text-align: center;
    color: var(--text-mute);
    font-size: 12px;
    margin-top: 8px;
}

.story-notes { display: flex; flex-direction: column; gap: 12px; }

.route-card {
    background: linear-gradient(135deg, rgba(212,168,60,.07) 0%, rgba(0,0,0,.2) 100%);
    border-left: 3px solid var(--gold);
    border-top: 1px solid rgba(212,168,60,.15);
    border-right: 1px solid var(--line-mid);
    border-bottom: 1px solid var(--line-mid);
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
    transition: background var(--t), border-left-color var(--t);
}

.route-card:hover {
    background: linear-gradient(135deg, rgba(212,168,60,.12) 0%, rgba(0,0,0,.12) 100%);
    border-left-color: var(--gold-2);
}

.route-card h4 { font-size: 14px; color: var(--gold-2); margin-bottom: 7px; font-weight: 700; }

.route-card p, .route-card ul {
    margin: 0; color: var(--text-dim);
    font-size: 13px; line-height: 1.65;
}

.route-card ul { padding-left: 18px; }
.route-card li { margin: 4px 0; }

.c-red    { color: var(--red);    font-weight: 700; }
.c-yellow { color: var(--yellow); font-weight: 700; }
.c-purple { color: var(--purple); font-weight: 700; }

/* ========== FOOTER ========== */
.footer {
    position: relative;
    padding: 44px 40px;
    text-align: center;
    color: var(--text-mute);
    font-size: 13px;
    z-index: 1;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 25%, var(--gold-2) 50%, var(--gold) 75%, transparent 100%);
    opacity: .4;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 30px;
}

.footer-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 170px;
    padding: 22px 14px;
    background: linear-gradient(155deg, #242018, #191610);
    outline: 1px solid var(--line-mid);
    border-radius: var(--radius);
    text-decoration: none;
    transition: outline-color var(--t), transform var(--t), box-shadow var(--t);
}

.footer-links a:hover {
    outline-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.5), 0 0 20px rgba(212,168,60,.1);
}

.footer-links .fl-icon { font-size: 26px; }
.footer-links strong { color: var(--text); font-size: 14px; }
.footer-links em { color: var(--text-mute); font-size: 12px; font-style: normal; }
.footer .muted { margin-top: 6px; color: var(--text-mute); opacity: .5; font-size: 11px; }

/* ========== FOOD / POTIONS ========== */
.potions-bar { margin-bottom: 14px; }
.potions-search { margin-bottom: 12px; }

.potions-filter-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.potions-filter-chip {
    padding: 5px 14px;
    border: 1px solid var(--line-mid);
    border-radius: 999px;
    background: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--t);
}

.potions-filter-chip:hover { border-color: var(--gold); color: var(--gold-2); }

.potions-filter-chip.active {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--gold-2);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--gold);
    transform: scale(1.04);
}

.potions-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.potions-empty {
    grid-column: 1 / -1;
    color: var(--text-mute);
    font-size: 14px;
    text-align: center;
    padding: 40px 0;
}

.food-card {
    position: relative;
    background: linear-gradient(160deg, #262118 0%, #1a1612 100%);
    outline: 1px solid var(--line-mid);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: outline-color var(--t), transform var(--t), box-shadow var(--t);
}

.food-card:hover {
    outline-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.5), 0 0 20px rgba(212,168,60,.12);
}

.fc-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.food-card:hover .fc-img img { transform: scale(1.06); }
.pr-noimg { font-size: 11px; color: var(--text-mute); }

.fc-body {
    padding: 9px 11px;
    display: flex; flex-direction: column; gap: 6px;
    background: linear-gradient(180deg, rgba(212,168,60,.06) 0%, transparent 100%);
    border-top: 1px solid var(--line-mid);
}

.fc-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; word-break: break-all; }
.fc-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.p-tag-chip {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(212,168,60,.1);
    color: var(--gold-2);
    border: 1px solid rgba(212,168,60,.28);
    border-radius: 999px;
    font-size: 11px;
}

.p-card-del {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.65);
    color: var(--text-mute);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity var(--t), background var(--t), color var(--t);
}

.food-card:hover .p-card-del,
.tip-card:hover .p-card-del,
.equip-card:hover .p-card-del { opacity: 1; }
.p-card-del:hover { background: var(--red); color: #fff; }

/* ========== MODAL ========== */
.p-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.8);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.p-modal.open {
    display: flex;
    animation: modalIn .22s cubic-bezier(.34,1.3,.64,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.94) translateY(14px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.p-modal-box {
    background: linear-gradient(155deg, #292318 0%, #1b1712 100%);
    outline: 1px solid var(--line-bright);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px 28px;
    display: flex; flex-direction: column; gap: 18px;
    box-shadow: 0 24px 72px rgba(0,0,0,.8), 0 0 0 1px rgba(212,168,60,.1);
    position: relative;
}

.p-modal-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: .65;
}

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

.p-modal-head h4 { font-size: 17px; color: var(--gold-2); font-weight: 700; letter-spacing: .06em; }

.p-modal-x {
    background: none;
    border: 1px solid var(--line-mid);
    border-radius: 7px;
    color: var(--text-mute);
    font-size: 19px;
    cursor: pointer;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; padding: 0;
    transition: all var(--t);
}
.p-modal-x:hover { border-color: var(--red); color: #fff; background: rgba(192,80,64,.2); }

.p-form-group { display: flex; flex-direction: column; gap: 8px; }

.p-label { font-size: 10px; color: var(--text-mute); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }

.p-img-upload { cursor: pointer; display: block; }

#pImgPreview {
    width: 100%; height: 140px;
    background: var(--bg-2);
    border: 1px dashed var(--line-bright);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: var(--text-mute); font-size: 13px;
    transition: border-color var(--t);
}
.p-img-upload:hover #pImgPreview { border-color: var(--gold); }
#pImgPreview img { width: 100%; height: 100%; object-fit: contain; }
#pImgInput { display: none; }

.p-input {
    background: rgba(0,0,0,.32);
    border: 1px solid var(--line-mid);
    border-radius: 8px;
    padding: 9px 13px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--t), box-shadow var(--t);
    width: 100%;
    box-sizing: border-box;
}
.p-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,168,60,.15); }

.p-tags-check-list {
    display: flex; flex-direction: column; gap: 3px;
    max-height: 140px; overflow-y: auto; padding-right: 4px;
}

.p-tag-row {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none;
    padding: 5px 8px; border-radius: 7px;
    transition: background var(--t);
}
.p-tag-row:hover { background: rgba(255,255,255,.04); }

.p-tag-row input[type="checkbox"] {
    accent-color: var(--gold); width: 15px; height: 15px;
    cursor: pointer; flex-shrink: 0;
}
.p-tag-row span { flex: 1; font-size: 14px; color: var(--text-dim); }

.p-tag-del-btn {
    background: none; border: none;
    color: var(--text-mute); font-size: 16px;
    cursor: pointer; padding: 0 4px; line-height: 1;
    border-radius: 4px; transition: color var(--t), background var(--t);
}
.p-tag-del-btn:hover { color: var(--red); background: rgba(192,80,64,.12); }

.p-tag-adder { display: flex; gap: 8px; }
.p-tag-adder .p-input { flex: 1; }

.p-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line-mid);
}

.p-btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
    color: #140c00;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-family: inherit; font-weight: 700; font-size: 14px;
    cursor: pointer;
    transition: opacity var(--t), transform var(--t), box-shadow var(--t);
    letter-spacing: .04em;
}

.p-btn-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -70%;
    width: 40%; height: 200%;
    background: rgba(255,255,255,.3);
    transform: skewX(-22deg);
    transition: left .55s ease;
}
.p-btn-primary:hover::after { left: 130%; }
.p-btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 22px rgba(212,168,60,.45); }

.p-btn-ghost {
    background: none;
    border: 1px solid var(--line-mid);
    border-radius: 8px;
    padding: 10px 18px;
    color: var(--text-dim);
    font-family: inherit; font-size: 14px;
    cursor: pointer; transition: all var(--t);
}
.p-btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); background: rgba(212,168,60,.06); }

/* ========== TIPS ========== */
.tips-bar { margin-bottom: 14px; }

.tips-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.tip-filter-chip {
    padding: 5px 14px; border-radius: 999px;
    border: 1px solid var(--line-mid);
    background: none; font-family: inherit;
    font-size: 13px; cursor: pointer;
    color: var(--text-dim); transition: all var(--t);
}
.tip-filter-chip:hover { border-color: var(--gold); color: var(--gold-2); }
.tip-filter-chip.active { font-weight: 700; box-shadow: 0 0 0 1px currentColor; transform: scale(1.04); }

.tips-search { margin-bottom: 18px; }

.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.tips-empty { grid-column: 1 / -1; color: var(--text-mute); font-size: 14px; text-align: center; padding: 40px 0; }

.tip-card {
    position: relative;
    background: linear-gradient(135deg, #231f18 0%, #181510 100%);
    border: 1px solid var(--line-mid);
    border-left-width: 4px;
    border-radius: 10px;
    padding: 14px 16px 14px 18px;
    cursor: pointer;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    display: flex; flex-direction: column; gap: 8px;
}

.tip-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.45); }

.tip-cat-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    align-self: flex-start; border: 1px solid transparent; letter-spacing: .04em;
}

.tip-content { font-size: 13.5px; color: var(--text-dim); line-height: 1.65; white-space: pre-wrap; word-break: break-all; }

.tip-card[data-cat="游戏机制"] { border-left-color: var(--gold); }
.tip-card[data-cat="游戏机制"] .tip-cat-badge { background: rgba(212,168,60,.12); border-color: rgba(212,168,60,.4); color: var(--gold-2); }
.tip-card[data-cat="副职业"]   { border-left-color: #5ab4e8; }
.tip-card[data-cat="副职业"] .tip-cat-badge   { background: rgba(90,180,232,.12); border-color: rgba(90,180,232,.4); color: #7acff5; }
.tip-card[data-cat="日常任务"] { border-left-color: #6abf86; }
.tip-card[data-cat="日常任务"] .tip-cat-badge { background: rgba(80,185,110,.12); border-color: rgba(80,185,110,.4); color: #7ad49a; }
.tip-card[data-cat="构筑技巧"] { border-left-color: #c87be0; }
.tip-card[data-cat="构筑技巧"] .tip-cat-badge { background: rgba(180,100,220,.12); border-color: rgba(180,100,220,.4); color: #d9a0f0; }
.tip-card[data-cat="探索"]     { border-left-color: #e8a846; }
.tip-card[data-cat="探索"] .tip-cat-badge     { background: rgba(232,168,70,.12); border-color: rgba(232,168,70,.4); color: #f5c870; }
.tip-card[data-cat="其他"]     { border-left-color: var(--line-mid); }
.tip-card[data-cat="其他"] .tip-cat-badge     { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: var(--text-mute); }

.tip-filter-chip[data-cat="游戏机制"] { color: var(--gold-2);    border-color: rgba(212,168,60,.4); }
.tip-filter-chip[data-cat="游戏机制"].active { background: rgba(212,168,60,.1); }
.tip-filter-chip[data-cat="副职业"]   { color: #7acff5;          border-color: rgba(90,180,232,.4); }
.tip-filter-chip[data-cat="副职业"].active   { background: rgba(90,180,232,.1); }
.tip-filter-chip[data-cat="日常任务"] { color: #7ad49a;          border-color: rgba(80,185,110,.4); }
.tip-filter-chip[data-cat="日常任务"].active { background: rgba(80,185,110,.1); }
.tip-filter-chip[data-cat="构筑技巧"] { color: #d9a0f0;          border-color: rgba(180,100,220,.4); }
.tip-filter-chip[data-cat="构筑技巧"].active { background: rgba(180,100,220,.1); }
.tip-filter-chip[data-cat="探索"]     { color: #f5c870;          border-color: rgba(232,168,70,.4); }
.tip-filter-chip[data-cat="探索"].active     { background: rgba(232,168,70,.1); }
.tip-filter-chip[data-cat="其他"]     { color: var(--text-mute); border-color: var(--line-mid); }
.tip-filter-chip[data-cat="其他"].active     { background: rgba(255,255,255,.05); }

.tip-cat-select { display: flex; flex-wrap: wrap; gap: 8px; }

.tip-cat-opt {
    padding: 7px 14px; border-radius: 8px;
    border: 1px solid var(--line-mid); background: rgba(0,0,0,.2);
    color: var(--text-dim); font-family: inherit; font-size: 13px;
    cursor: pointer; transition: all var(--t);
}
.tip-cat-opt:hover { border-color: var(--gold); color: var(--gold-2); }
.tip-cat-opt.active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-2); font-weight: 700; }

.tip-textarea { resize: vertical; min-height: 100px; line-height: 1.65; }

/* ========== EQUIP ========== */
.equip-bar { margin-bottom: 14px; }
.equip-search { margin-bottom: 12px; }

.equip-role-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

.equip-role-tab {
    padding: 6px 18px; border-radius: 999px;
    border: 1px solid var(--line-mid); background: none;
    color: var(--text-dim); font-family: inherit; font-size: 13px;
    cursor: pointer; transition: all var(--t);
}
.equip-role-tab:hover { border-color: var(--gold); color: var(--gold-2); }
.equip-role-tab.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-2); font-weight: 700; box-shadow: 0 0 0 1px var(--gold); }

.equip-role-select { display: flex; gap: 8px; }

.equip-role-opt {
    flex: 1; padding: 9px 6px; border-radius: 8px;
    border: 1px solid var(--line-mid); background: rgba(0,0,0,.2);
    color: var(--text-dim); font-family: inherit; font-size: 13px;
    cursor: pointer; transition: all var(--t); text-align: center;
}
.equip-role-opt:hover { border-color: var(--gold); color: var(--gold-2); }
.equip-role-opt.active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-2); font-weight: 700; }

.equip-role-opt[data-role="坦克"].active,
.equip-role-tab[data-role="坦克"].active { border-color: #5ab4e8; background: rgba(90,180,232,.1); color: #7acff5; box-shadow: 0 0 0 1px #5ab4e8; }
.equip-role-opt[data-role="奶妈"].active,
.equip-role-tab[data-role="奶妈"].active { border-color: #6abf86; background: rgba(80,185,110,.1); color: #7ad49a; box-shadow: 0 0 0 1px #6abf86; }

.ec-role-badge {
    position: absolute; top: 7px; left: 7px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    pointer-events: none; letter-spacing: .04em;
}
.ec-role-badge.role-dps  { background: rgba(212,168,60,.2);  border: 1px solid rgba(212,168,60,.4);  color: var(--gold-2); }
.ec-role-badge.role-tank { background: rgba(90,180,232,.18); border: 1px solid rgba(90,180,232,.4); color: #7acff5; }
.ec-role-badge.role-heal { background: rgba(80,185,110,.18); border: 1px solid rgba(80,185,110,.4); color: #7ad49a; }

.equip-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.equip-empty { grid-column: 1 / -1; color: var(--text-mute); font-size: 14px; text-align: center; padding: 40px 0; }

.equip-card {
    position: relative;
    background: linear-gradient(180deg, #282218 0%, #181510 100%);
    outline: 1px solid var(--line-mid);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: outline-color var(--t), transform var(--t), box-shadow var(--t);
    display: flex; flex-direction: column;
}

.equip-card:hover {
    outline-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0,0,0,.55), 0 0 24px rgba(212,168,60,.14);
}

.ec-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--bg-2);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

.ec-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s; }
.equip-card:hover .ec-img img { transform: scale(1.06); }
.ec-noimg { font-size: 11px; color: var(--text-mute); }

.ec-body {
    padding: 9px 12px 11px;
    background: linear-gradient(180deg, rgba(212,168,60,.08) 0%, transparent 100%);
    border-top: 1px solid var(--line-mid);
}

.ec-name { display: block; font-size: 13px; font-weight: 600; color: var(--gold-2); line-height: 1.4; word-break: break-all; text-align: center; }

#eImgPreview, #bdImgPreview {
    width: 100%; height: 190px;
    background: var(--bg-2);
    border: 1px dashed var(--line-bright);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: var(--text-mute); font-size: 13px;
    transition: border-color var(--t);
}
#eImgPreview img, #bdImgPreview img { width: 100%; height: 100%; object-fit: contain; }
#eImgInput, #bdImgInput { display: none; }
.e-img-upload:hover #eImgPreview,
.e-img-upload:hover #bdImgPreview { border-color: var(--gold); }
.e-img-upload { cursor: pointer; display: block; }

/* ========== LIGHTBOX ========== */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 100;
    display: none;
    align-items: center; justify-content: center;
    padding: 40px; cursor: zoom-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox.open { display: flex; animation: fadeIn .22s ease-out; }

.lightbox img {
    max-width: 95%; max-height: 92vh;
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0,0,0,.9);
}

.lightbox-close {
    position: absolute; top: 20px; right: 28px;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #fff; font-size: 22px;
    cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t);
}
.lightbox-close:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }

/* ========== LOADING ========== */
.section-loading {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
    color: var(--text-mute); font-size: 14px;
    padding: 48px 0; letter-spacing: .06em;
}

.section-loading::before {
    content: '';
    width: 20px; height: 20px;
    border: 2px solid var(--line-bright);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== SCROLL TO TOP ========== */
.scroll-top {
    position: fixed; bottom: 36px; right: 36px;
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
    color: #140a00; border: none;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 18px rgba(212,168,60,.45);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t), transform var(--t), box-shadow var(--t);
    z-index: 40;
}

.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(212,168,60,.6); }

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
    .story-grid { grid-template-columns: 1fr; }
    .hero { padding: 28px 28px 20px; }
}

@media (max-width: 760px) {
    .topbar { padding: 12px 18px; flex-wrap: wrap; }
    .topbar-end {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 6px;
    }
    .nav {
        order: 5;
        flex-basis: 100%;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 10px;
        display: none;
    }
    .nav.open { display: flex; }
    .nav-toggle { display: grid; place-items: center; }
    .theme-toggle { width: 38px; height: 38px; font-size: 18px; }
    .container { padding: 0 16px 60px; }
    .card { padding: 20px 18px; }
    .section-head { gap: 14px; }
    .section-num { width: 46px; height: 46px; font-size: 15px; }
    .section-head h3 { font-size: 18px; }
    .potions-list { grid-template-columns: repeat(2, 1fr); }
    .equip-list   { grid-template-columns: repeat(2, 1fr); }
    .tips-grid    { grid-template-columns: 1fr; }
    .hero { padding: 22px 18px 16px; }
    .hero-ornament-line { width: 60px; }
    .scroll-top { bottom: 20px; right: 20px; }
}

@media (max-width: 400px) {
    .potions-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ========== 明亮主题 ========== */
html[data-theme="light"] {
    color-scheme: light;
    scrollbar-color: var(--line-bright) #e4ddd0;

    --bg-0:       #e4ddd0;
    --bg-1:       #d8d0c2;
    --bg-2:       #cbc3b4;
    --bg-3:       rgba(235,228,216,.92);
    --line:       #a89b78;
    --line-mid:   #948864;
    --line-bright:#7a6a38;

    --text:       #252018;
    --text-dim:   #3f382c;
    --text-mute:  #5c5548;

    --gold:       #7a5e14;
    --gold-2:     #624a10;
    --gold-3:     #4f3c0c;
    --gold-soft:  rgba(138,107,24,.12);
    --gold-glow:  rgba(138,107,24,.22);

    --red:    #b04030;
    --yellow: #8a7220;
    --purple: #6a5090;
}

html[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-0); }

html[data-theme="light"] body {
    background-color: var(--bg-0);
    background-image:
        radial-gradient(ellipse 1400px 720px at 70% -8%, rgba(160,130,70,.12) 0%, transparent 55%),
        radial-gradient(ellipse 900px 600px at 0% 40%, rgba(130,150,185,.14) 0%, transparent 58%),
        radial-gradient(ellipse 600px 450px at 100% 80%, rgba(150,145,175,.08) 0%, transparent 55%);
}

html[data-theme="light"] body::before {
    background-image:
        repeating-linear-gradient(45deg,  transparent, transparent 48px, rgba(138,107,24,.04) 48px, rgba(138,107,24,.04) 49px),
        repeating-linear-gradient(-45deg, transparent, transparent 48px, rgba(138,107,24,.04) 48px, rgba(138,107,24,.04) 49px);
}

html[data-theme="light"] .topbar {
    background: rgba(228,221,208,.94);
    box-shadow: 0 1px 0 var(--line-mid), 0 4px 22px rgba(40,36,28,.07);
}

html[data-theme="light"] .theme-toggle {
    background: rgba(138,107,24,.08);
}

html[data-theme="light"] .hero-nav-hint a {
    background: rgba(210,202,188,.55);
}

html[data-theme="light"] .hero-nav-hint a:hover {
    box-shadow: 0 4px 16px rgba(138,107,24,.2);
}

html[data-theme="light"] .card {
    background: linear-gradient(155deg, #ebe4d8 0%, #ddd5c8 100%);
    box-shadow:
        0 1px 0 rgba(255,255,255,.45) inset,
        0 10px 36px rgba(40,34,26,.08);
}

html[data-theme="light"] .card:hover {
    box-shadow:
        0 1px 0 rgba(255,255,255,.55) inset,
        0 12px 42px rgba(40,34,26,.1),
        0 0 0 1px rgba(98,74,16,.22),
        0 0 24px rgba(160,130,70,.1);
}

html[data-theme="light"] .section-num {
    background: radial-gradient(circle at 38% 35%, #e8e0d0, #d4c9b4);
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 5px rgba(138,107,24,.08),
        0 0 18px rgba(138,107,24,.14);
}

html[data-theme="light"] .route-card {
    background: linear-gradient(135deg, rgba(160,130,70,.1) 0%, rgba(215,208,195,.45) 100%);
}

html[data-theme="light"] .route-card:hover {
    background: linear-gradient(135deg, rgba(160,130,70,.16) 0%, rgba(215,208,195,.58) 100%);
}

html[data-theme="light"] .footer-links a {
    background: linear-gradient(155deg, #ebe4d8, #ddd5c8);
    box-shadow: none;
}

html[data-theme="light"] .footer-links a:hover {
    box-shadow: 0 10px 28px rgba(60,50,30,.12), 0 0 20px rgba(212,180,100,.1);
}

html[data-theme="light"] .food-card {
    background: linear-gradient(160deg, #e8e2d6 0%, #d8d0c2 100%);
}

html[data-theme="light"] .food-card:hover {
    box-shadow: 0 12px 32px rgba(60,50,30,.12), 0 0 20px rgba(212,180,100,.1);
}

html[data-theme="light"] .p-card-del {
    background: rgba(220,212,198,.85);
    color: var(--text-mute);
    box-shadow: 0 0 0 1px var(--line-mid);
}

html[data-theme="light"] .p-modal {
    background: rgba(40,36,28,.45);
}

html[data-theme="light"] .p-modal-box {
    background: linear-gradient(155deg, #ebe4d8 0%, #ddd5c8 100%);
    box-shadow: 0 24px 56px rgba(60,50,30,.18), 0 0 0 1px rgba(138,107,24,.12);
}

html[data-theme="light"] .p-input {
    background: rgba(210,202,190,.75);
}

html[data-theme="light"] .p-tag-row:hover {
    background: rgba(0,0,0,.04);
}

html[data-theme="light"] .tip-card {
    background: linear-gradient(135deg, #ebe4d8 0%, #ddd5c8 100%);
}

html[data-theme="light"] .tip-card:hover {
    box-shadow: 0 8px 22px rgba(60,50,30,.12);
}

html[data-theme="light"] .tip-card[data-cat="其他"] .tip-cat-badge {
    background: rgba(0,0,0,.06);
    border-color: rgba(0,0,0,.12);
}

html[data-theme="light"] .tip-filter-chip[data-cat="其他"].active {
    background: rgba(0,0,0,.06);
}

html[data-theme="light"] .tip-cat-opt,
html[data-theme="light"] .equip-role-opt {
    background: rgba(0,0,0,.05);
}

html[data-theme="light"] .equip-card {
    background: linear-gradient(180deg, #e8e2d6 0%, #d8d0c2 100%);
}

html[data-theme="light"] .equip-card:hover {
    box-shadow: 0 14px 36px rgba(60,50,30,.14), 0 0 24px rgba(212,180,100,.1);
}

html[data-theme="light"] .lightbox {
    background: rgba(28,26,22,.88);
}

html[data-theme="light"] .lightbox img {
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
