/* DevOpsBook 抽卡頁 — feature island.
   Chrome / sections / buttons / breadcrumb 全部沿用站台主題既有 class
   (.section, .section-tag, .section-header, .btn-primary, .btn-secondary, .breadcrumb)。
   這支只補：場景切換、書櫃/輸入兩欄、書脊、近況紙條、翻書動畫、對開結果、書籤。
   三卷書脊保留自己的色盤（inline --spine/--edge/--book-accent/--vink）。 */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 標題 em 只上點綴色、不要斜體（中文斜體不好看；覆蓋主題的 h1 em italic） */
.devops-tool h1 em,
.devops-tool h2 em { font-style: normal; color: var(--accent); }

/* 收斂 section 上下間距（抽卡頁區塊較多，不需要首頁那種大留白） */
.devops-tool .section { padding: clamp(2.25rem, 5vw, 3.75rem) 2.5rem; max-width: 1180px; margin: 0 auto; }
.devops-tool .section-header { margin-bottom: 2rem; }
.devops-intro h1 { margin: 0.6rem 0 1.25rem; }
.devops-intro__lead { max-width: 50ch; margin-bottom: 2rem; }
.devops-intro .hero-actions { margin-top: 0; }

/* ── 場景切換（JS 在 #devopsBookTool 切 .is-shelf / .is-reading） ── */
.devops-tool.is-shelf .reading-stage { display: none; }
.devops-tool.is-reading .devops-intro,
.devops-tool.is-reading #shelfRegion { display: none; }

/* ── 兩欄：書櫃在左、輸入在右 ── */
.draw-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 1023px) { .draw-grid { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ── 書櫃 ── */
.bookshelf__books { display: flex; gap: 1rem; align-items: flex-end; justify-content: center; }
.book { position: relative; flex: 1 1 0; max-width: 175px; cursor: pointer; }
.book input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.book__spine {
  position: relative; display: flex; flex-direction: column; gap: 0.5rem; min-height: 300px;
  padding: 1.4rem 1.15rem; overflow: hidden; color: var(--vink);
  border-radius: 3px 6px 6px 3px;
  background: linear-gradient(115deg, var(--edge) 0%, var(--spine) 16%, var(--spine) 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .30);
  transition: transform .2s ease, box-shadow .2s ease;
}
.book__spine::before { content: ''; position: absolute; top: 0; bottom: 0; left: 6px; width: 1px; background: rgba(255, 255, 255, .18); }
.book__title { font-family: 'DM Serif Display', serif; font-size: 1.4rem; line-height: 1.1; display: block; }
.book__english { font-family: 'DM Mono', monospace; font-size: 0.66rem; letter-spacing: 0.2em; opacity: .72; display: block; margin-top: 0.3rem; }
.book__face { margin-top: auto; }
.book__tagline { font-size: 0.82rem; line-height: 1.5; opacity: .92; display: block; }
.book__pulled {
  display: inline-block; margin-top: 0.7rem; font-family: 'DM Mono', monospace; font-size: 0.7rem;
  padding: 0.2rem 0.55rem; border-radius: 2px; background: var(--book-accent); color: var(--edge);
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s;
}
.book:hover .book__spine { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(15, 23, 42, .34); }
.book.is-selected .book__spine { transform: translateY(-10px); outline: 2px solid var(--book-accent); outline-offset: 3px; }
.book.is-selected .book__pulled { opacity: 1; transform: none; }
.bookshelf__board { height: 12px; margin-top: 6px; border-radius: 2px; background: linear-gradient(#e2e8f0, #cbd5e1); box-shadow: 0 10px 18px rgba(15, 23, 42, .12); }
.bookshelf__empty { text-align: center; color: var(--muted); }

/* ── 近況紙條 ── */
.slip { display: block; }
.slip__label { display: block; font-family: 'Epilogue', sans-serif; font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.6rem; }
.slip__opt { color: var(--muted); font-weight: 400; }
.slip textarea {
  width: 100%; font-family: 'Epilogue', sans-serif; font-size: 1rem; line-height: 1.7; color: var(--ink);
  padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 3px; background: var(--paper); resize: vertical;
}
.slip textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--shadow); }
.slip__hint { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

.shelf-hint { color: var(--muted); font-size: 0.9rem; margin: 1.3rem 0 0.8rem; }
.draw-button { width: 100%; text-align: center; }
.draw-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.draw-button__loading { display: none; }
.draw-button.is-loading .draw-button__idle { display: none; }
.draw-button.is-loading .draw-button__loading { display: inline; }
.shelf-status { margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); }
.shelf-status.is-error { color: #b91c1c; }

/* ── 翻書動畫 ── */
.reading-stage:focus { outline: none; }
.reading-status { text-align: center; font-family: 'DM Mono', monospace; color: var(--muted); margin-bottom: 1.5rem; }
.book-flip { text-align: center; padding: 2.5rem 0; }
.book-flip__book { display: inline-flex; gap: 6px; perspective: 600px; }
.book-flip__leaf { width: 42px; height: 58px; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; transform-origin: left center; animation: db-flip 1s ease-in-out infinite; }
.book-flip__leaf:nth-child(2) { animation-delay: .15s; }
.book-flip__leaf:nth-child(3) { animation-delay: .3s; }
@keyframes db-flip { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(-55deg); } }
.book-flip__page-no { display: block; font-family: 'DM Mono', monospace; color: var(--muted); margin-top: 1rem; }

/* ── 對開結果（用主題卡片質感：邊框 + 陰影 + surface） ── */
.book-open { max-width: 920px; margin: 0 auto; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; background: var(--paper); box-shadow: 0 16px 44px var(--shadow); }
.book-open__inner { display: grid; grid-template-columns: 1fr 1fr; }
.page { padding: clamp(1.6rem, 3vw, 2.4rem); }
.page--left { background: var(--surface); border-right: 1px solid var(--border); }
.page__head { display: flex; justify-content: space-between; font-family: 'DM Mono', monospace; font-size: 1rem; color: var(--muted); margin-bottom: 1.5rem; }
.page__quote { font-family: 'DM Serif Display', serif; font-style: normal; font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.4; margin: 0 0 1rem; color: var(--ink); }
.page__source { color: var(--muted); visibility: hidden; height: 0; margin: 0; overflow: hidden; }
.page__index { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.page__index span { font-family: 'DM Mono', monospace; font-size: 1rem; color: var(--accent); }
.page__heading { font-family: 'DM Serif Display', serif; }
.page__heading:focus { outline: none; }
.page__interpretation { font-size: 1.1rem; line-height: 1.9; color: var(--ink); }
.page__note { color: var(--muted); font-size: 0.85rem; margin-top: 1.5rem; }
.reading-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 1.5rem clamp(1.6rem, 3vw, 2.4rem); border-top: 1px solid var(--border); background: var(--surface); }
.feedback-actions { display: inline-flex; gap: 0.4rem; align-items: center; }
.feedback-button {
  min-height: 42px; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: 3px;
  background: var(--paper); color: var(--ink); font-family: 'Epilogue', sans-serif; font-weight: 600;
  cursor: pointer; transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.feedback-button:hover { border-color: var(--accent); transform: translateY(-1px); }
.feedback-button:disabled { cursor: wait; opacity: .7; transform: none; }
.feedback-button.is-selected { border-color: var(--accent); background: var(--accent); color: var(--paper); }

/* ── 書籤（用主題 card 質感） ── */
.bookmarks__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 1023px) { .bookmarks__list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .bookmarks__list { grid-template-columns: 1fr; } }
.bookmark { position: relative; background: var(--paper); border: 1px solid var(--border); border-radius: 3px; padding: 1.5rem; transition: transform .2s, box-shadow .2s; }
.bookmark:hover { transform: translateY(-3px); box-shadow: 0 12px 30px var(--shadow); }
.bookmark__meta { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.bookmark__quote { font-family: 'DM Serif Display', serif; font-size: 1.15rem; line-height: 1.4; margin: 0.6rem 0; color: var(--ink); }
.bookmark__interpretation { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.bookmark__remove { margin-top: 1rem; font-size: 0.8rem; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; }
.bookmark__corner { display: none; }

/* ── responsive ── */
@media (max-width: 767px) {
  .book-open__inner { grid-template-columns: 1fr; }
  .page--left { border-right: none; border-bottom: 1px solid var(--border); }
  .book { max-width: 130px; }
  .book__spine { min-height: 240px; }
}

/* ── reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .book-flip__leaf { animation: none; }
  .book:hover .book__spine, .book.is-selected .book__spine { transform: none; }
}
