* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #1d1d1f; --muted: #64646b; --line: #dfdfe3; --blue: #0066cc; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: #f5f5f7; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; letter-spacing: 0; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.lucide { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.7; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px; background: white; z-index: 200; }
.skip-link:focus { top: 12px; }
.header { border-bottom: 1px solid var(--line); background: rgba(250,250,252,.94); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.header-inner, .main, .footer { width: min(1160px, calc(100% - 64px)); margin: auto; }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 650; white-space: nowrap; }
.wordmark .lucide { width: 25px; height: 25px; stroke-width: 2.5; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 13px; }
.nav-links button { padding: 0; background: none; border: 0; color: inherit; }
.nav-links a:hover, .nav-links button:hover { color: var(--blue); }
.intro { padding: 48px 0 40px; }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: 13px; font-weight: 550; }
h1 { margin: 0; font-size: 48px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.intro-copy { font-size: 19px; margin: 14px 0 0; color: var(--muted); }
.mobile-break { display: none; }
.collection-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h2 { font-size: 23px; margin: 0; font-weight: 650; }
.search-box { display: flex; align-items: center; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 8px; height: 44px; padding: 0 12px; width: 260px; }
.search-box > .lucide { color: var(--muted); width: 17px; }
.search-box input { width: 100%; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 13px; }
.search-box:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.search-box input:focus-visible { outline: none; }
.search-box input::-webkit-search-cancel-button { display: none; }
.icon-btn { border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; padding: 6px; border-radius: 6px; }
.icon-btn:hover { background: #eeeeef; color: var(--ink); }
.collection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0; }
.category-tabs { display: flex; padding: 3px; background: #e8e8ed; border-radius: 7px; }
.tab { min-width: 64px; height: 38px; border: 0; border-radius: 5px; background: transparent; font-size: 13px; color: #62626a; }
.tab.active { color: var(--ink); background: white; box-shadow: 0 1px 4px #00000014; }
#result-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.app-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 20px; }

/* ========== 作品卡片：统一为「封面 + 信息区」同构结构 ========== */
.app-card { grid-column: span 2; min-width: 0; display: block; border: 1px solid #e6e6e9; border-radius: 10px; overflow: hidden; background: #fff; transition: transform .18s, box-shadow .18s; }
.app-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px #17171c0d; }
.app-card:active { transform: translateY(-1px); }
.app-cover { aspect-ratio: 16/10; overflow: hidden; background: #e3e4e7; container-type: inline-size; }
.app-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-cover.pending-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: repeating-linear-gradient(135deg,#f2f2f5 0 14px,#ececf0 14px 28px); color:#8b8c95; }
.pending-cover .lucide { width: 34px; height: 34px; }
.pending-cover span { font-size: 11px; font-weight: 700; letter-spacing: 2.5px; }
.app-body { padding: 20px 22px 22px; }
.app-kind { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font-size: 22px; line-height: 1.4; font-weight: 650; }
h3 .lucide { color: #7a7a80; width: 19px; height: 19px; }
.app-meta { margin: 9px 0 0; font-size: 13px; color: var(--muted); }

/* 德扑封面：桌毡上叠三张牌 */
.poker-cover { position: relative; }
.cover-hand { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 14px; }
.cover-hand span { width: 65px; height: 92px; border: 1px solid #e6e3dc; background: #fafaf8; border-radius: 5px; padding: 6px 10px; color: #232327; font: 25px/1.2 Georgia,serif; box-shadow: 0 4px 8px #0003; }
.cover-hand span:first-child { transform: rotate(-17deg) translate(7px,2px); }
.cover-hand span:nth-child(2) { color: #ab303d; transform: translateY(-8px); z-index: 1; }
.cover-hand span:last-child { transform: rotate(17deg) translate(-7px,2px); }

/* 2048 封面：沿用游戏本体配色的一块进行中棋盘 */
.board-cover { background: #faf8ef; display: grid; place-items: center; }
.board-cover .mini-board { height: 86%; aspect-ratio: 1/1; display: grid; grid-template-columns: repeat(4,1fr); gap: 2.2cqw; padding: 2.2cqw; background: #bbada0; border-radius: 2.4cqw; box-shadow: 0 12px 26px #7c6f6333; }
.board-cover .mini-board span { display: grid; place-items: center; border-radius: 1.3cqw; background: #cdc1b4; font-size: 5.6cqw; font-weight: 750; color: #776e65; }
.board-cover .mini-board .t2 { background: #eee4da; }
.board-cover .mini-board .t4 { background: #ede0c8; }
.board-cover .mini-board .t8 { background: #f2b179; color: #fff; }
.board-cover .mini-board .t16 { background: #f59563; color: #fff; }
.board-cover .mini-board .t32 { background: #f67c5f; color: #fff; }
.board-cover .mini-board .t64 { background: #f65e3b; color: #fff; }
.board-cover .mini-board .t128,
.board-cover .mini-board .t256,
.board-cover .mini-board .t512 { background: #edcf72; color: #fff; font-size: 4.9cqw; box-shadow: 0 0 12px #edcf7266; }
.board-cover .mini-board .t256 { background: #edcc61; }
.board-cover .mini-board .t512 { background: #edc850; }
.board-cover .mini-board .t1024,
.board-cover .mini-board .t2048 { color: #fff; font-size: 4.1cqw; }
.board-cover .mini-board .t1024 { background: #edc53f; box-shadow: 0 0 14px #edc53f77; }
.board-cover .mini-board .t2048 { background: #edc22e; box-shadow: 0 0 16px #edc22e88; }

/* 博客封面：蓝脊信纸 */
.note-cover { background: linear-gradient(135deg, #eef2f8, #dde6f1); display: grid; place-items: center; }
.note-card { height: 84%; aspect-ratio: 3/4; background: #fff; border-radius: 1cqw 2.4cqw 2.4cqw 1cqw; border-left: 1.5cqw solid #6387a7; box-shadow: 0 14px 30px #36587a26; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.2cqw; padding: 4cqw; }
.note-card .lucide { width: 11cqw; height: 11cqw; color: #36587a; stroke-width: 1.4; }
.note-lines { width: 100%; display: flex; flex-direction: column; gap: 2cqw; }
.note-lines span { height: 1.1cqw; border-radius: 1cqw; background: #e3e9f1; }
.note-lines span:nth-child(1) { width: 92%; }
.note-lines span:nth-child(2) { width: 78%; }
.note-lines span:nth-child(3) { width: 88%; }
.note-lines span:nth-child(4) { width: 56%; }

.empty-state { text-align: center; padding: 72px 16px; color: var(--muted); }
.empty-state > .lucide { width: 34px; height: 34px; }
.empty-state button { border: 0; background: none; color: var(--blue); padding: 10px; }
.footer { display: flex; align-items: center; gap: 26px; border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 32px; font-size: 12px; color: var(--muted); }
.footer a { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.footer .lucide { width: 14px; height: 14px; }
dialog { border: 1px solid var(--line); border-radius: 8px; width: min(460px,calc(100% - 32px)); padding: 26px; color: var(--ink); box-shadow: 0 20px 90px #0000002a; }
dialog::backdrop { background: #00000050; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 21px; }
dialog p { font-size: 14px; line-height: 1.9; color: var(--muted); }
dialog a { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 14px; margin-top: 8px; }
@media(max-width: 850px) {
    .header-inner,.main,.footer { width: calc(100% - 40px); }
    .app-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
    .app-card { grid-column: span 1; }
    .app-body { padding: 18px; }
}
@media(max-width: 540px) {
    .header-inner { height: 58px; gap: 14px; }
    .wordmark { font-size: 15px; gap: 6px; }
    .wordmark .lucide { width: 21px; }
    .nav-links { gap: 17px; font-size: 12px; }
    .intro { padding: 30px 0 28px; }
    h1 { font-size: 38px; }
    .intro-copy { font-size: 16px; }
    .mobile-break { display: initial; }
    h2 { font-size: 21px; }
    .search-box { width: 180px; gap: 8px; padding: 0 9px; }
    .collection-head { gap: 14px; }
    .collection-toolbar { margin: 18px 0; }
    .app-grid { grid-template-columns: minmax(0,1fr); }
    .app-cover { aspect-ratio: 16/9; }
    .app-body { padding: 18px 20px; }
    .cover-hand span { width: 54px; height: 76px; font-size: 21px; }
    .footer { flex-wrap: wrap; gap: 10px 24px; margin-top: 32px; font-size: 11px; }
    .footer a { margin-left: 0; }
}
@media(prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,*::before,*::after { transition: none !important; animation: none !important; }
}
