/* ==========================================================================
   Shiro 静态博客 · 扩展样式（2026-09 批次）
   新功能页：游戏库 / 学习路线 / 工具收藏 / 问答墙 / 投票站 / 问卷 / 建议箱 / 排行榜 / 年度报告
   小功能：页面转场 / 滚动渐入 / 定时深色 / 自定义右键菜单 / 悬浮通知 Toast
   ========================================================================== */

/* ================= 游戏库 ================= */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.game-card {
    padding: 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.game-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}
.game-card__name {
    font-size: var(--text-title-20);
    line-height: var(--text-title-20--lh);
    font-weight: 600;
    margin: 0;
}
.games-chip {
    flex: none;
    font-size: var(--text-label-12);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
}
.game-card__meta {
    margin: 0;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
}
.game-card__rate {
    display: flex;
    gap: 0.12rem;
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--color-neutral-4);
}
.game-star.is-on { color: #d9a441; }
.game-card__desc {
    margin: 0;
    font-size: var(--text-copy-14);
    color: var(--color-neutral-7);
}
.games-count {
    margin-top: 1rem;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
}

/* ================= 学习路线 ================= */
.road-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 640px;
}
.road-card { padding: 1.15rem 1.2rem; }
.road-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}
.road-card__name {
    margin: 0;
    font-size: var(--text-title-20);
    font-weight: 600;
}
.road-level {
    font-size: var(--text-label-12);
    color: var(--color-accent);
    background: color-mix(in srgb, var(--color-accent) 10%, transparent);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
}
.road-progress {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-3);
    overflow: hidden;
}
.road-progress__bar {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 65%, #fff 35%));
    transition: width 0.6s ease;
}
.road-progress__text {
    margin: 0.4rem 0 0.7rem;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
}
.road-card__note {
    margin: 0 0 0.8rem;
    font-size: var(--text-copy-14);
    color: var(--color-neutral-7);
}
.road-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.road-skill {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: var(--text-label-12);
    padding: 0.28rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-2);
    color: var(--color-neutral-6);
}
.road-skill.is-done {
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
    color: var(--color-success);
}

/* ================= 工具收藏 ================= */
.tool-group { margin-bottom: 1.5rem; }
.tool-group__title {
    font-size: var(--text-copy-14);
    color: var(--color-neutral-6);
    font-weight: 600;
    margin: 0 0 0.6rem;
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
}
.tool-card {
    padding: 1rem 1.05rem;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.07);
}
.tool-card__name {
    margin: 0 0 0.35rem;
    font-size: var(--text-copy-15);
    font-weight: 600;
}
.tool-card__desc {
    margin: 0;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
}

/* ================= 问答墙 ================= */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 720px;
}
.faq-item { padding: 0 1.1rem; }
.faq-item__q {
    list-style: none;
    cursor: pointer;
    padding: 0.95rem 0;
    font-size: var(--text-copy-15);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__mark {
    flex: none;
    font-size: 15px;
    color: var(--color-neutral-5);
    transition: transform 0.25s ease;
}
.faq-item[open] .faq-item__mark { transform: rotate(45deg); }
.faq-item__a {
    padding: 0 0 1rem;
    font-size: var(--text-copy-14);
    color: var(--color-neutral-7);
    line-height: 1.7;
}

/* ================= 投票站 ================= */
.vote-poll { padding: 1.15rem 1.2rem; margin-bottom: 1rem; }
.vote-poll__q {
    margin: 0 0 0.25rem;
    font-size: var(--text-title-20);
    font-weight: 600;
}
.vote-poll__meta {
    margin: 0 0 0.9rem;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
}
.vote-poll__opts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.vote-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: var(--text-copy-14);
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    transition: border-color 0.2s ease;
}
.vote-opt:hover { border-color: var(--color-accent); }
.vote-opt__bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: color-mix(in srgb, var(--color-accent) 12%, transparent);
    transition: width 0.5s ease;
}
.vote-opt__text { position: relative; z-index: 1; }
.vote-opt__pct {
    position: relative;
    z-index: 1;
    margin-left: auto;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
    font-variant-numeric: tabular-nums;
}
.vote-poll.is-voted .vote-opt { cursor: default; }
.vote-poll.is-voted .vote-opt:hover { border-color: var(--color-border); }
.vote-poll.is-disabled .vote-opt { cursor: default; opacity: 0.92; }

/* ================= 问卷 ================= */
.survey-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: 640px;
}
.survey-intro {
    padding: 0.9rem 1.1rem;
    font-size: var(--text-copy-14);
    color: var(--color-neutral-7);
}
.survey-q {
    border: none;
    margin: 0;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.survey-q__title {
    padding: 0;
    margin: 0 0 0.4rem;
    font-size: var(--text-copy-15);
    font-weight: 600;
}
.survey-opt {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-copy-14);
    transition: background 0.2s ease;
}
.survey-opt:hover { background: var(--color-neutral-2); }
.survey-opt input { accent-color: var(--color-accent); }
.survey-form .btn { align-self: flex-start; margin-top: 0.4rem; }

/* ================= 建议箱 ================= */
.sugg-intro {
    padding: 1rem 1.15rem;
    font-size: var(--text-copy-14);
    color: var(--color-neutral-7);
    line-height: 1.7;
    margin-bottom: 1.4rem;
    max-width: 720px;
}

/* ================= 排行榜 ================= */
.rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.rank-panel { padding: 1.15rem 1.2rem; }
.rank-panel__title {
    margin: 0 0 0.8rem;
    font-size: var(--text-copy-15);
    font-weight: 600;
    color: var(--color-neutral-8);
}
.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.rank-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: var(--text-copy-14);
}
.rank-item__no {
    flex: none;
    width: 1.4em;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--color-neutral-5);
}
.rank-item:nth-child(-n+3) .rank-item__no { color: var(--color-accent); }
.rank-item__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}
.rank-item__name:hover { color: var(--color-accent); }
.rank-item__val {
    flex: none;
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
    font-variant-numeric: tabular-nums;
}
.rank-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.rank-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-copy-13);
}
.rank-bar__label {
    flex: none;
    width: 3.4em;
    color: var(--color-neutral-7);
    font-variant-numeric: tabular-nums;
}
.rank-bar__track {
    flex: 1;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-3);
    overflow: hidden;
}
.rank-bar__fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 60%, #fff 40%));
}
.rank-bar__val {
    flex: none;
    width: 1.6em;
    text-align: right;
    color: var(--color-neutral-6);
    font-variant-numeric: tabular-nums;
}
.rank-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.rank-tag {
    font-size: var(--text-label-12);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-2);
    color: var(--color-neutral-7);
}
.rank-tag em {
    font-style: normal;
    margin-left: 0.3rem;
    color: var(--color-neutral-5);
}

/* ================= 年度报告 ================= */
.report-year {
    padding: 1.3rem 1.35rem;
    margin-bottom: 1rem;
}
.report-year__title {
    margin: 0 0 1rem;
    font-size: var(--text-title-24);
    font-weight: 700;
}
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1rem;
}
.report-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.8rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-neutral-2);
}
.report-cell strong {
    font-size: var(--text-title-24);
    font-weight: 700;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}
.report-cell span {
    font-size: var(--text-copy-13);
    color: var(--color-neutral-6);
}
.report-meta__line {
    margin: 0.35rem 0;
    font-size: var(--text-copy-14);
    color: var(--color-neutral-7);
}
.report-meta__line a { color: var(--color-accent); }
.report-tag {
    display: inline-block;
    margin: 0 0.25rem 0.25rem 0;
    font-size: var(--text-label-12);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-accent) 10%, transparent);
    color: var(--color-accent);
}

/* ================= 小功能 · 77 页面转场 ================= */
/* 每次进入页面时内容区淡入上移（与现有 loading 遮罩叠加） */
.section--first {
    animation: shiroPageIn 0.45s ease both;
}
@keyframes shiroPageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .section--first { animation: none; }
}

/* ================= 小功能 · 78 滚动渐入 ================= */
.shiro-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.shiro-reveal.is-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .shiro-reveal { opacity: 1; transform: none; transition: none; }
}

/* ================= 小功能 · 80 定时深色（指示器） ================= */
.shiro-auto-dark-pill {
    position: fixed;
    right: 14px;
    bottom: 76px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-label-12);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--bg-opacity);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    color: var(--color-neutral-7);
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.06);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.shiro-auto-dark-pill.is-on { opacity: 1; transform: none; }
.shiro-auto-dark-pill b { color: var(--color-accent); font-weight: 600; }

/* ================= 小功能 · 83 自定义右键菜单 ================= */
.shiro-ctxmenu {
    position: fixed;
    z-index: 300;
    min-width: 168px;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    background: var(--bg-opacity);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 36px rgb(0 0 0 / 0.12);
    opacity: 0;
    transform: scale(0.96);
    transform-origin: top left;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}
.shiro-ctxmenu.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.shiro-ctxmenu__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: none;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--color-neutral-8);
    font: inherit;
    font-size: var(--text-copy-13);
    text-align: left;
    cursor: pointer;
}
.shiro-ctxmenu__item:hover { background: var(--color-neutral-2); }
.shiro-ctxmenu__sep {
    height: 1px;
    margin: 0.3rem 0.4rem;
    background: var(--color-border);
}

/* ================= 悬浮通知 Toast ================= */
.shiro-toast-wrap {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    width: min(92vw, 380px);
}
.shiro-toast {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 100%;
    padding: 0.6rem 0.95rem;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-9);
    color: #faf9f6;
    font-size: var(--text-copy-13);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.22);
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: auto;
}
.shiro-toast.is-in { opacity: 1; transform: none; }
.shiro-toast.is-out { opacity: 0; transform: translateY(-8px) scale(0.97); }
.shiro-toast--success { background: color-mix(in srgb, var(--color-success) 88%, #000 12%); }
.shiro-toast--error   { background: color-mix(in srgb, var(--color-error) 88%, #000 12%); }
.shiro-toast__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    background: rgb(255 255 255 / 0.18);
}
@media (prefers-reduced-motion: reduce) {
    .shiro-toast { transition: none; }
}


/* 全局区块滚动渐入（仅 JS 正常时生效；html.shiro-js 由 app.js 添加） */
html.shiro-js .section:not(.section--first) {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
html.shiro-js .section.is-visible {
    opacity: 1;
    transform: none;
}
html.shiro-js .section:not(.section--first):not(.is-visible) * { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    html.shiro-js .section:not(.section--first) { opacity: 1; transform: none; transition: none; }
}
/* ================= 响应式 ================= */
@media (max-width: 720px) {
    .games-grid { grid-template-columns: 1fr 1fr; }
    .tool-grid  { grid-template-columns: 1fr 1fr; }
    .rank-grid  { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .games-grid { grid-template-columns: 1fr; }
    .tool-grid  { grid-template-columns: 1fr; }
}
