/* Carnet · 独立手账本商店：黑白灰、真实封面与可拖动 3D 预览 */
:root{
  --store-bg:#f4f4f1;--store-ink:#111111;--store-muted:#747474;
  --store-line:#d8d8d3;--store-soft:#eaeae6
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;min-height:100%;background:var(--store-bg);color:var(--store-ink)}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif}
body.detail-open{overflow:hidden}
button,a{font:inherit;color:inherit}
button{border:0;cursor:pointer}
a{text-decoration:none}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:2px solid #111;outline-offset:4px}
[hidden]{display:none!important}
.store-shell{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.store-header,.detail-header{
  position:relative;height:82px;padding:0 38px;display:flex;align-items:center;justify-content:space-between;
  border-bottom:1px solid var(--store-line);flex:0 0 auto
}
.store-back{width:42px;height:42px;display:grid;place-items:center;border:1px solid #c9c9c4;border-radius:50%;transition:background .18s,color .18s}
.store-back:hover{background:#111;color:#fff}
.store-back svg{width:21px;height:21px}
.store-wordmark{position:absolute;left:50%;transform:translateX(-50%);font-size:14px;font-weight:750;letter-spacing:.28em}
.store-edition{font-family:"Courier New",monospace;font-size:11px;letter-spacing:.14em;color:#666}
.store-main{width:min(1120px,100%);margin:0 auto;padding:62px 38px 76px;flex:1}
.store-intro{text-align:center;margin-bottom:58px}
.store-kicker,.detail-kicker{margin:0 0 16px;font-family:"Courier New",monospace;font-size:11px;letter-spacing:.19em;color:#686868}
.store-intro h1{margin:0;font-size:clamp(34px,4vw,50px);line-height:1.2;letter-spacing:.08em;font-weight:650}
.store-subtitle{margin:18px 0 0;font-size:14px;letter-spacing:.08em;color:var(--store-muted)}
.store-tabs{display:flex;justify-content:center;gap:8px;margin:-18px 0 38px}
.store-tabs button{min-width:92px;padding:10px 20px;border:1px solid #cfcfca;border-radius:99px;background:transparent;font-size:13px;letter-spacing:.08em;color:#666;transition:background .18s,color .18s}
.store-tabs button:hover{border-color:#111;color:#111}
.store-tabs button.on{background:#111;border-color:#111;color:#fff}
.store-source{margin:28px 0 0;text-align:center;font-size:10px;letter-spacing:.1em;color:#929292}
.store-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:50px 30px}
.store-message{margin:70px 0;text-align:center;font-size:13px;line-height:1.8;color:var(--store-muted)}
/* 手账本：四个板块各占一行，卡片横向滚动，触屏直接左右滑。 */
.store-grid.as-rows{display:block}
.store-group{margin:0 0 58px}
.store-group:last-child{margin-bottom:0}
.store-group-head{display:flex;align-items:center;gap:14px;margin:0 0 20px}
.store-group-head h2{margin:0;font-size:15px;font-weight:600;letter-spacing:.16em;white-space:nowrap}
.store-group-rule{flex:1;height:1px;background:var(--store-line)}
.store-group-count{font-family:"Courier New",monospace;font-size:11px;letter-spacing:.1em;color:#8a8a8a}
.store-group-more{font-size:14px;line-height:1;color:#8a8a8a}
.store-group-row{
  display:flex;gap:18px;overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
  padding:4px 0 18px;margin:-4px 0 -18px;
  scrollbar-width:thin;scrollbar-color:#c9c9c4 transparent
}
.store-group-row::-webkit-scrollbar{height:5px}
.store-group-row::-webkit-scrollbar-thumb{background:#c9c9c4;border-radius:9px}
.store-group-row.dragging{cursor:grabbing;scroll-snap-type:none;user-select:none}
.store-group-row.dragging .store-card{pointer-events:none}
.store-group-row .store-card{flex:0 0 230px;scroll-snap-align:start}
.store-group-row .store-card-preview{height:280px}
.store-group-row .store-card .cover{--cover-w:148px;--cr-scale:.63}
.store-group-row:focus-visible{outline:2px solid #111;outline-offset:2px}
.store-card{position:relative;min-width:0;padding:0;background:transparent;text-align:center}
.store-card-preview{
  position:relative;height:310px;display:grid;place-items:center;background:transparent;
  transition:background .25s ease
}
.store-card .cover{--cover-w:154px;--cr-scale:.66;transition:transform .35s cubic-bezier(.2,.75,.25,1),box-shadow .35s ease}
.store-card:hover .store-card-preview{background:#ecece8}
.store-card:hover .cover{transform:translateY(-8px) rotate(-1.2deg);box-shadow:0 30px 38px -22px rgba(0,0,0,.35),0 7px 13px -7px rgba(0,0,0,.2)}
.store-card-name{display:block;margin-top:20px;font-size:16px;font-weight:600;letter-spacing:.12em}
.store-card-meta{display:block;margin-top:7px;font-family:"Courier New",monospace;font-size:10px;letter-spacing:.15em;color:#858585}
.sticker-card-grid{display:grid;grid-template-columns:repeat(2,74px);gap:20px;align-items:center;justify-content:center}
.sticker-card-grid img{display:block;width:74px;height:74px;object-fit:contain;filter:drop-shadow(0 8px 8px rgba(0,0,0,.10));transition:transform .25s ease}
.store-card:hover .sticker-card-grid img:nth-child(odd){transform:rotate(-5deg) translateY(-4px)}
.store-card:hover .sticker-card-grid img:nth-child(even){transform:rotate(5deg) translateY(-4px)}
.font-card-sample{display:block;font-size:94px;line-height:1;font-weight:400}
.font-card-word{display:block;margin-top:15px;font-size:25px;letter-spacing:.04em}
.asset-preview{min-height:460px;flex:1;display:grid;place-items:center;padding:34px}
.sticker-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(110px,160px));gap:34px;align-items:center}
.sticker-detail-grid img{display:block;width:100%;height:160px;object-fit:contain;filter:drop-shadow(0 14px 12px rgba(0,0,0,.12))}
.font-detail-sample{width:min(100%,440px);text-align:center;color:#191919;overflow:hidden}
.font-detail-sample b{display:block;font-size:150px;line-height:1;font-weight:400}
.font-detail-sample strong{display:block;margin:20px 0 34px;font-size:52px;line-height:1.1;font-weight:400;overflow-wrap:anywhere}
.font-detail-sample span{display:block;font-size:25px;line-height:1.65;letter-spacing:.06em;overflow-wrap:anywhere}
.store-card-added{
  display:none;position:absolute;right:14px;top:14px;padding:5px 8px;border-radius:99px;
  background:#111;color:#fff;font-size:10px;letter-spacing:.08em
}
.store-card.installed .store-card-added{display:block}
.store-footer{padding:22px 30px 28px;border-top:1px solid var(--store-line);text-align:center;font-size:11px;letter-spacing:.12em;color:#777}

/* 商品详情作为商店内的一张完整页面展开，书架 DOM 与主页脚本不参与。 */
.store-detail{position:fixed;inset:0;z-index:100;background:#f8f8f6;opacity:0;transform:translateY(10px);transition:opacity .2s ease,transform .24s ease}
.store-detail.show{opacity:1;transform:none}
.detail-header{height:74px;background:#f8f8f6}
.detail-close{display:flex;align-items:center;gap:9px;padding:10px 0;background:transparent;font-size:13px;letter-spacing:.05em}
.detail-close svg{width:20px;height:20px}
.detail-header-brand{position:absolute;left:50%;transform:translateX(-50%);font-size:11px;font-weight:700;letter-spacing:.2em}
.detail-scroll{height:calc(100dvh - 74px);overflow:auto}
.detail-layout{min-height:100%;display:grid;grid-template-columns:minmax(0,1.45fr) minmax(330px,.85fr)}
.detail-visual{min-height:620px;padding:40px 40px 26px;background:var(--store-soft);display:flex;flex-direction:column;justify-content:center}
.book-stage{
  position:relative;min-height:460px;flex:1;display:grid;place-items:center;perspective:1150px;
  cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;outline-offset:-6px!important
}
.book-stage:active{cursor:grabbing}
.book-stage::after{
  content:"";position:absolute;left:50%;top:73%;width:280px;height:46px;transform:translateX(-50%);
  border-radius:50%;background:radial-gradient(ellipse,rgba(0,0,0,.18),rgba(0,0,0,0) 68%);pointer-events:none
}
.book-3d{
  --cover-w:222px;position:relative;transform-style:preserve-3d;transform:rotateX(7deg) rotateY(-24deg);
  transition:transform .28s cubic-bezier(.2,.75,.25,1);will-change:transform;z-index:1
}
.book-3d.dragging{transition:none}
.book-face{transform-style:preserve-3d;backface-visibility:hidden}
.book-face.front{position:relative;transform:translateZ(11px)}
.book-face.back{position:absolute;inset:0;transform:rotateY(180deg) translateZ(11px)}
.book-face .cover{--cover-w:inherit;--cr-scale:.9;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14),inset 0 -1px 0 rgba(0,0,0,.18)}
.book-pages{
  position:absolute;top:5px;bottom:5px;right:-11px;width:22px;transform:rotateY(90deg);
  background:repeating-linear-gradient(90deg,#e8e6df 0,#e8e6df 1px,#faf9f4 1px,#faf9f4 3px);
  border-radius:1px;box-shadow:inset 0 0 5px rgba(0,0,0,.13);backface-visibility:hidden
}
.book-spine{
  position:absolute;left:-11px;top:0;bottom:0;width:22px;transform:rotateY(-90deg);
  background:linear-gradient(90deg,#202020,#525252 48%,#171717);backface-visibility:hidden
}
.preview-tools{display:flex;align-items:center;justify-content:center;gap:18px;padding-top:22px;font-size:11px;letter-spacing:.07em;color:#747474}
.preview-tools button{padding:6px 10px;background:transparent;border:1px solid #c9c9c4;border-radius:99px;font-size:11px}
.preview-tools button:hover{background:#111;color:#fff;border-color:#111}
.detail-info{padding:70px 48px 50px;display:flex;flex-direction:column;justify-content:center}
.detail-info h2{margin:0;font-size:40px;line-height:1.25;letter-spacing:.1em;font-weight:600}
.detail-meta{margin:18px 0 0;font-size:12px;letter-spacing:.1em;color:#707070}
.detail-description{margin:30px 0 0;max-width:360px;font-size:14px;line-height:1.9;color:#5f5f5f;letter-spacing:.035em}
.detail-actions{margin-top:38px;display:flex;flex-direction:column;align-items:flex-start;gap:14px}
.download-button{
  min-width:210px;min-height:50px;padding:14px 24px;border-radius:2px;background:#111;color:#fff;
  display:flex;align-items:center;justify-content:center;gap:11px;font-size:14px;letter-spacing:.09em;
  transition:background .18s,transform .18s
}
.download-button:hover:not(:disabled){background:#353535;transform:translateY(-2px)}
.download-button:disabled{cursor:default;background:#e4e4e0;color:#777;border:1px solid #cfcfca}
.download-button svg{width:18px;height:18px}
.download-button.busy svg{animation:storeDownload 1s ease-in-out infinite}
@keyframes storeDownload{50%{transform:translateY(3px)}}
.open-shelf{font-size:12px;letter-spacing:.08em;border-bottom:1px solid #111;padding-bottom:4px}
.remove-font-button{min-width:210px;min-height:44px;padding:10px 20px;border:1px solid #d6b4b4;border-radius:2px;background:transparent;color:#8b2828;font-size:12px;letter-spacing:.08em;transition:background .18s,color .18s}
.remove-font-button:hover:not(:disabled){background:#8b2828;color:#fff}
.remove-font-button:disabled{cursor:default;opacity:.5}
.download-status{min-height:20px;margin:18px 0 0;font-size:12px;line-height:1.6;color:#333}
.download-status.error{color:#8b2828}
.download-note{margin:8px 0 0;font-size:11px;line-height:1.7;color:#929292}
.store-noscript{margin:40px;text-align:center}

@media (min-width:1400px){.book-3d{--cover-w:250px}.detail-info{padding-left:64px;padding-right:64px}}
@media (max-width:900px){
  .store-grid{gap:38px 18px}.store-card-preview{height:280px}.store-card .cover{--cover-w:138px}
  .store-group{margin-bottom:48px}.store-group-row .store-card{flex-basis:200px}.store-group-row .store-card-preview{height:250px}.store-group-row .store-card .cover{--cover-w:132px}
  .detail-layout{grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr)}
  .detail-info{padding:46px 30px}.detail-visual{padding:28px 24px}.book-3d{--cover-w:190px}
  .detail-info h2{font-size:34px}
}
@media (max-width:680px){
  .store-header{height:68px;padding:0 20px}.store-back{width:38px;height:38px}.store-edition{font-size:9px}
  .store-wordmark{font-size:12px}.store-main{padding:40px 18px 56px}.store-intro{margin-bottom:38px}
  .store-intro h1{font-size:32px}.store-subtitle{font-size:12px;margin-top:14px}.store-kicker{font-size:9px;margin-bottom:13px}
  .store-tabs{margin:-12px 0 28px;gap:5px}.store-tabs button{min-width:0;padding:9px 17px;font-size:12px}
  .store-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:32px 10px}
  .store-group{margin-bottom:40px}.store-group-head{margin-bottom:14px}.store-group-head h2{font-size:14px}
  .store-group-row .store-card{flex-basis:160px}.store-group-row .store-card-preview{height:200px}.store-group-row .store-card .cover{--cover-w:104px;--cr-scale:.49}
  .store-group-row .store-card-name{margin-top:10px;font-size:14px}.store-group-row .store-card-meta{font-size:8px;margin-top:4px}
  .store-card-preview{height:236px}.store-card .cover{--cover-w:112px;--cr-scale:.48}
  .store-card:hover .store-card-preview{background:transparent}.store-card:hover .cover{transform:none}
  .store-card-name{margin-top:12px;font-size:14px}.store-card-meta{font-size:8px;margin-top:5px}
  .store-card-added{right:4px;top:8px;font-size:9px;padding:4px 6px}.store-footer{font-size:9px}
  .detail-header{height:64px;padding:0 20px}.detail-header-brand{display:none}.detail-close{font-size:12px}
  .detail-scroll{height:calc(100dvh - 64px)}.detail-layout{display:block;min-height:0}
  .detail-visual{min-height:0;padding:16px 20px 20px}.book-stage{min-height:370px;flex:none}
  .book-3d{--cover-w:174px}.book-stage::after{top:75%;width:230px}
  .asset-preview{min-height:340px;padding:24px 10px}.sticker-card-grid{grid-template-columns:repeat(2,54px);gap:14px}
  .sticker-card-grid img{width:54px;height:54px}.font-card-sample{font-size:70px}.font-card-word{font-size:20px}
  .sticker-detail-grid{grid-template-columns:repeat(2,minmax(90px,125px));gap:24px}.sticker-detail-grid img{height:125px}
  .font-detail-sample b{font-size:110px}.font-detail-sample strong{font-size:40px}.font-detail-sample span{font-size:20px}
  .preview-tools{padding-top:6px}.detail-info{padding:34px 26px 42px;display:block}
  .detail-info h2{font-size:30px}.detail-kicker{margin-bottom:12px}.detail-meta{margin-top:12px}
  .detail-description{margin-top:20px;font-size:13px}.detail-actions{margin-top:26px}
  .download-button{width:100%;min-height:50px}.open-shelf{align-self:center}
}
@media (max-width:350px){.store-card-preview{height:210px}.store-card .cover{--cover-w:98px}.store-main{padding-left:12px;padding-right:12px}
  .store-group-row .store-card{flex-basis:140px}.store-group-row .store-card .cover{--cover-w:86px}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
