/* 野脉 · 周末去哪野
   视觉: 和野脉 (yeamai.com) 同一套标识和配色: 暖黑 + 奶油白 + 标识橙 #dc6101 (色阶取自 yeamai_growth 的 tailwind.config.js).
   地图页: 地图在最底层, 其余都是浮在地图上的控件; 游记页: 窄版阅读 */
@import url("../vendor/leaflet/leaflet.css");

:root {
    --dark: #090807;         /* 暖黑: 标识底, 主按钮, 选中的筛选 */
    --brand: #dc6101;        /* 标识橙 (450): 分享按钮, 强调 */
    --brand-ink: #a43f01;    /* 浅底上的橙色文字和链接 (600) */
    --brand-soft: #fea069;   /* 深底上的橙色文字 (300) */
    --cream: #fbf7f2;        /* 标识里的奶油白 */
    --paper: #f6f2ec;
    --card: #fdfbf8;
    --ink: #1a1613;
    --mute: #6f665c;
    --line: #e7e0d6;
    --shadow: 0 8px 28px rgb(9 8 7 / .16);
    --radius: 18px;
    --peek: 132px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    --gh-font-body: var(--font);
    --gh-font-heading: var(--font);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--gh-font-body); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.brand {
    display: flex; align-items: center; height: 44px; padding: 0 16px 0 12px; flex-shrink: 0;
    background: var(--dark); border-radius: 999px; text-decoration: none; box-shadow: var(--shadow);
}
.brand img { display: block; height: 26px; width: auto; }
.account {
    flex-shrink: 0; display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 999px;
    background: var(--card); box-shadow: var(--shadow); text-decoration: none; font-size: 14px; font-weight: 600;
}

/* 头像: 有图用图; 没图时地图里用名字首字 (map.js), 模板里用标识 */
.avatar {
    --size: 24px; width: var(--size); height: var(--size); flex-shrink: 0; border-radius: 50%; object-fit: cover;
    display: inline-grid; place-items: center; background: var(--dark) center / cover no-repeat;
    color: var(--cream); font-size: calc(var(--size) * .48); font-weight: 700; line-height: 1;
}
.avatar-letter { background: var(--dark) url("../images/yeamai-mark.svg") center / 62% no-repeat; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
    text-decoration: none; font-size: 15px; font-weight: 600;
}
.btn.primary { background: var(--dark); border-color: var(--dark); color: var(--paper); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { padding: 24px 8px; color: var(--mute); font-size: 14px; text-align: center; list-style: none; }
.muted { color: var(--mute); }

/* ================= 地图页 (首页, 作者页) ================= */

.map-app { position: fixed; inset: 0; overflow: hidden; }
#map { position: absolute; inset: 0; z-index: 0; background: #ece6dc; }
#map .leaflet-tile-pane { filter: saturate(.55) brightness(1.04) contrast(.95); } /* 底图降饱和, 让版图和图钉更突出 */
.leaflet-control-attribution { font-size: 10px; background: rgb(255 253 247 / .75) !important; }

.pin {
    width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 50% 50% 50% 6px; transform: rotate(-45deg);
    background: var(--pin, var(--dark)); border: 2px solid var(--cream); box-shadow: 0 3px 10px rgb(9 8 7 / .35);
}
.pin span { transform: rotate(45deg); color: var(--cream); font-size: 13px; font-weight: 700; }

.topbar {
    position: absolute; z-index: 10; top: calc(var(--safe-top) + 12px); left: 12px; right: 12px;
    display: flex; gap: 10px; align-items: center;
}
.search {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
    background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
}
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--mute); stroke-width: 2; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }

.chips {
    position: absolute; z-index: 10; top: calc(var(--safe-top) + 66px); left: 0; right: 0;
    display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 8px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px; border: 0;
    background: var(--card); box-shadow: 0 3px 12px rgb(9 8 7 / .14); font-size: 14px; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--dark); color: var(--paper); }

.stats {
    position: absolute; z-index: 10; top: calc(var(--safe-top) + 114px); left: 12px;
    padding: 6px 12px; border-radius: 999px; background: rgb(9 8 7 / .86); color: var(--paper);
    font-size: 12px; letter-spacing: .04em; pointer-events: none;
}
.stats:empty { display: none; }
.stats b { color: var(--brand-soft); font-weight: 700; }

.map-tools {
    position: absolute; z-index: 10; right: 12px; bottom: calc(var(--peek) + 86px + var(--safe-bottom));
    display: flex; flex-direction: column; gap: 10px;
}
.tool {
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow);
    display: grid; place-items: center;
}
.tool svg { width: 20px; height: 20px; fill: none; stroke: var(--dark); stroke-width: 2; }
.tool[aria-pressed="true"] { background: var(--dark); }
.tool[aria-pressed="true"] svg { stroke: var(--paper); }

.fab {
    position: absolute; z-index: 11; right: 12px; bottom: calc(var(--peek) + 18px + var(--safe-bottom));
    height: 52px; padding: 0 20px; border: 0; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .04em;
    box-shadow: 0 10px 26px rgb(220 97 1 / .4);
}
.fab span { font-size: 20px; margin-right: 2px; }

/* 底部抽屉 (手机) / 左侧面板 (桌面) */
.sheet {
    position: absolute; z-index: 12; left: 0; right: 0; bottom: 0;
    height: min(72vh, 640px); background: var(--card); border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 30px rgb(9 8 7 / .16);
    transform: translateY(calc(100% - var(--peek) - var(--safe-bottom)));
    transition: transform .32s cubic-bezier(.2, .7, .2, 1);
    display: flex; flex-direction: column; padding-bottom: var(--safe-bottom);
}
.sheet[data-state="open"] { transform: translateY(0); }
.sheet-handle { border: 0; background: transparent; padding: 10px 0 4px; flex-shrink: 0; }
.sheet-handle span { display: block; width: 42px; height: 5px; margin: 0 auto; border-radius: 3px; background: var(--line); }
.sheet-body { overflow-y: auto; flex: 1; padding-bottom: 16px; }
.sheet-head { padding: 4px 18px 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: .04em; }
.sheet-head p { margin: 4px 0 0; font-size: 13px; color: var(--mute); }

.spots, .posts { list-style: none; margin: 0; padding: 0 12px; }
.spot {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
    padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 12px;
}
.spot:hover, .spot:focus-visible, .post-row:hover { background: #f1ebe2; outline: none; }
.spot-thumb {
    width: 56px; height: 56px; border-radius: 12px; background: var(--paper) center / cover no-repeat;
    display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--cream);
}
.spot-title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; }
.spot-meta { margin: 3px 0 0; font-size: 12px; color: var(--mute); display: flex; align-items: center; gap: 5px; min-width: 0; }
.spot-author { color: var(--ink); }
.spot-dist { font-size: 12px; color: var(--mute); white-space: nowrap; }

/* 作者页: 头像, 简介, 游记列表 */
.profile { padding: 6px 18px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.profile-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 10px; }
.profile-head .avatar { --size: 64px; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brand); }
.profile-head h1 { margin: 0; font-size: 21px; letter-spacing: .04em; }
.profile-stats { margin: 4px 0 0; font-size: 13px; color: var(--brand-ink); font-weight: 600; }
.profile-bio { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--mute); }
.profile .btn { height: 36px; font-size: 14px; padding: 0 14px; }
.post-row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
    padding: 10px 6px; border-bottom: 1px solid var(--line); border-radius: 12px; text-decoration: none;
}
.post-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.post-title { font-size: 15px; font-weight: 650; line-height: 1.4; }
.post-date { font-size: 12px; color: var(--mute); }
.sheet .pagination { display: flex; justify-content: space-between; padding: 12px 18px; font-size: 14px; color: var(--mute); }

/* 卡片弹窗 */
dialog.card {
    width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 0;
    border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: 0 24px 70px rgb(9 8 7 / .35); overflow: auto;
}
dialog.card::backdrop { background: rgb(9 8 7 / .35); }
#share-dialog { padding: 26px 22px 22px; }
#share-dialog h2 { margin: 0 32px 10px 0; font-size: 20px; }
#share-dialog p { margin: 0 0 12px; line-height: 1.75; font-size: 15px; }
.close {
    position: sticky; float: right; top: 10px; margin: 10px 10px -46px 0; z-index: 2;
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: rgb(255 253 247 / .9); font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgb(9 8 7 / .18);
}
.detail-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--paper); }
.detail-cover.placeholder { display: grid; place-items: center; font-size: 46px; font-weight: 800; color: var(--cream); }
.detail { padding: 18px 20px 22px; }
.byline {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 14px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 14px; background: #f7f2eb; text-decoration: none;
}
.byline-name { font-weight: 700; font-size: 15px; }
.byline-meta { color: var(--mute); font-size: 12px; }
.byline-go { margin-left: auto; color: var(--brand-ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.detail-kicker { margin: 0; font-size: 12px; letter-spacing: .14em; color: var(--mute); }
.detail h2 { margin: 6px 0 8px; font-size: 21px; line-height: 1.35; }
.detail p { margin: 0 0 12px; line-height: 1.75; font-size: 15px; }
.detail dl { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0 0 16px; font-size: 14px; }
.detail dt { color: var(--mute); }
.detail dd { margin: 0; }
.noscript { position: absolute; inset: auto 16px 50% 16px; text-align: center; }

@media (min-width: 900px) {
    :root { --peek: 0px; }
    .sheet {
        left: 12px; right: auto; top: 120px; bottom: 12px; width: 380px; height: auto;
        border-radius: var(--radius); transform: none; box-shadow: var(--shadow);
    }
    .sheet-handle { display: none; }
    .sheet-body { padding-top: 14px; }
    .chips, .stats { left: 404px; }
    .topbar { right: 12px; }
    .search { max-width: 460px; }
    .topbar .account { margin-left: auto; }
    .map-tools { bottom: 90px; }
    .fab { bottom: 24px; right: 24px; }
}

/* ================= 游记 / 页面 ================= */

.article-bar {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
    padding: calc(var(--safe-top) + 10px) 16px 10px; background: rgb(246 241 229 / .92); backdrop-filter: blur(8px);
}
.article-bar .brand { box-shadow: none; }
.bar-link { font-size: 15px; font-weight: 600; text-decoration: none; }
.article-bar .account { margin-left: auto; box-shadow: none; border: 1px solid var(--line); height: 38px; }

.article { max-width: 720px; margin: 0 auto; padding: 24px 16px 80px; }
.article-head { margin-bottom: 32px; }
.article-head h1 { margin: 8px 0 12px; font-size: clamp(26px, 5vw, 38px); line-height: 1.3; letter-spacing: .02em; }
.kicker { font-size: 13px; letter-spacing: .14em; color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.lead { margin: 0 0 16px; font-size: 18px; line-height: 1.7; color: var(--mute); }
.article-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.article-meta .byline { width: auto; margin: 0; }
.article-meta .avatar { --size: 36px; }
.map-link {
    display: inline-flex; margin-top: 16px; padding: 10px 16px; border-radius: 999px;
    background: var(--dark); color: var(--paper); text-decoration: none; font-size: 14px; font-weight: 600;
}
.map-link[hidden] { display: none; }
.article-cover { margin: 28px -16px; }
.article-cover img { display: block; width: 100%; }
.article-cover figcaption, .gh-content figcaption { padding: 8px 16px; font-size: 13px; color: var(--mute); text-align: center; }
.article-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 40px; font-size: 14px; }
.article-tags a { color: var(--brand-ink); text-decoration: none; }

.gh-content { font-size: 17px; line-height: 1.9; }
.gh-content > * { margin: 0 0 1.2em; }
.gh-content h2 { margin-top: 2em; font-size: 24px; line-height: 1.4; }
.gh-content h3 { margin-top: 1.6em; font-size: 20px; }
.gh-content a { color: var(--brand-ink); text-underline-offset: 3px; }
.gh-content img { height: auto; border-radius: 10px; }
.gh-content blockquote { margin-left: 0; padding-left: 16px; border-left: 3px solid var(--brand); color: var(--mute); }
.gh-content figure { margin-left: 0; margin-right: 0; }

/* Ghost 编辑器卡片的宽版 / 全宽 (主题必需; 图库默认是宽版). 用 left 而不是 margin 居中,
   免得被上面 .gh-content figure 的 margin 覆盖 */
.gh-content .kg-width-wide,
.gh-content .kg-width-full { position: relative; left: 50%; transform: translateX(-50%); margin-left: 0; margin-right: 0; }
.gh-content .kg-width-wide { width: min(1000px, calc(100vw - 32px)); }
.gh-content .kg-width-full { width: 100vw; }
.kg-width-full img { border-radius: 0; }

.error-page { padding-top: 15vh; text-align: center; }
