/* ── Chunks 语块 · case study styles ──────────────────────────────────
   Product-led page: problem → demo → design details → iterations → tech.
   The phone demo mirrors the real PWA's iOS tokens (light theme).      */

/* ── Problem section ───────────────────────────────────────────────── */
.ck-problem-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;
}
@media (min-width: 860px) {
    .ck-problem-grid { grid-template-columns: repeat(3, 1fr); }
}
.ck-problem {
    background: #101018;
    border: 1px solid #25252e;
    border-radius: 12px;
    padding: 1.5rem;
}
.ck-problem-app {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.ck-problem-quote {
    font-size: 1.05rem;
    line-height: 1.5;
    color: #e6e6ec;
    margin: 0 0 0.9rem;
}
.ck-problem-so {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #999;
    margin: 0;
}
.ck-problem-so strong { color: #ff6b6b; font-weight: 600; }

.ck-insight {
    margin-top: 2.5rem;
    padding: 1.6rem 1.8rem;
    border-left: 2px solid #fff;
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
}
.ck-insight-eyebrow {
    font-family: ui-monospace, monospace;
    font-size: 10px; letter-spacing: 0.2em; color: #888; margin-bottom: 0.5rem;
}
.ck-insight p { margin: 0; font-size: 1.15rem; line-height: 1.55; color: #f0f0f4; }

/* ── Demo layout ───────────────────────────────────────────────────── */
.ck-demo-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 2.5rem;
    align-items: start;
}
@media (min-width: 960px) {
    .ck-demo-layout { grid-template-columns: 400px 1fr; gap: 3.5rem; }
}

/* Phone shell */
.ck-phone {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    aspect-ratio: 390 / 780;
    background: #000;
    border-radius: 44px;
    padding: 12px;
    box-shadow:
        0 0 0 1px #2a2a33,
        0 30px 80px rgba(0,0,0,0.6),
        inset 0 0 0 1px rgba(255,255,255,0.06);
    position: relative;
}
.ck-screen {
    width: 100%; height: 100%;
    border-radius: 34px;
    overflow: hidden;
    background: #f2f2f7;
    color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    -webkit-font-smoothing: antialiased;
}
.ck-notch {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 110px; height: 30px; background: #000; border-radius: 20px; z-index: 5;
}
.ck-statusbar {
    height: 44px; flex: none;
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 0 26px 6px; font-size: 13px; font-weight: 600; color: #000;
}
.ck-navbar {
    flex: none;
    padding: 6px 18px 8px;
    background: rgba(242,242,247,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 0.5px solid rgba(60,60,67,0.12);
}
.ck-navbar h1 {
    margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', sans-serif;
}
.ck-content {
    flex: 1; overflow-y: auto; padding: 14px 16px 90px;
    scrollbar-width: none;
}
.ck-content::-webkit-scrollbar { display: none; }

/* iOS primitives (mirroring the app's style.css) */
.ck-card {
    background: #fff; border-radius: 12px; padding: 14px 16px;
    box-shadow: 0 1px 0 rgba(60,60,67,0.06);
}
.ck-textarea {
    width: 100%; min-height: 76px; resize: none; border: 0; outline: 0;
    font: inherit; font-size: 17px; line-height: 1.45; color: #000; background: transparent;
    font-family: inherit;
}
.ck-textarea::placeholder { color: rgba(60,60,67,0.3); }
.ck-btn-primary {
    display: block; width: 100%; margin-top: 12px;
    background: #007aff; color: #fff; border: 0; border-radius: 12px;
    font: inherit; font-size: 17px; font-weight: 600; padding: 13px;
    cursor: pointer; transition: transform .12s, opacity .12s;
}
.ck-btn-primary:active { transform: scale(0.98); background: #0062cc; }
.ck-btn-primary:disabled { opacity: 0.45; cursor: default; }
.ck-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.ck-chip {
    font: inherit; font-size: 13px; color: #007aff;
    background: rgba(0,122,255,0.1); border: 0; border-radius: 999px;
    padding: 6px 12px; cursor: pointer;
}
.ck-chip:active { background: rgba(0,122,255,0.2); }

.ck-result { margin-top: 14px; }
.ck-en-card { display: flex; gap: 10px; align-items: flex-start; }
.ck-en-output {
    flex: 1; font-size: 19px; line-height: 1.4; color: #000; font-weight: 500;
    letter-spacing: -0.01em; min-height: 26px;
}
.ck-en-output .cursor { display: inline-block; width: 2px; height: 1em; background: #007aff; margin-left: 2px; vertical-align: -2px; animation: ckBlink .9s steps(1) infinite; }
@keyframes ckBlink { 50% { opacity: 0; } }
.ck-icon-btn {
    flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: rgba(0,122,255,0.1); color: #007aff; display: grid; place-items: center; cursor: pointer;
}
.ck-saved-bar {
    margin-top: 10px; padding: 9px 14px; border-radius: 10px;
    background: rgba(52,199,89,0.14); color: #1f8f3d; font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 8px;
    animation: ckFadeUp .35s ease both;
}
.ck-saved-bar::before { content: '✓'; font-weight: 700; }
@keyframes ckFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ck-section-header {
    font-size: 13px; color: rgba(60,60,67,0.6); text-transform: uppercase; letter-spacing: 0.02em;
    margin: 18px 4px 6px;
}
.ck-list { background: #fff; border-radius: 12px; overflow: hidden; }
.ck-phrase {
    padding: 12px 16px; border-bottom: 0.5px solid rgba(60,60,67,0.12);
    animation: ckFadeUp .35s ease both;
}
.ck-phrase:last-child { border-bottom: 0; }
.ck-phrase-en { font-size: 17px; font-weight: 600; color: #000; }
.ck-phrase-zh { font-size: 14px; color: rgba(60,60,67,0.6); margin-top: 2px; }
.ck-phrase-ex { font-size: 13px; color: rgba(60,60,67,0.45); margin-top: 6px; font-style: italic; line-height: 1.4; }
.ck-empty { padding: 30px 16px; text-align: center; color: rgba(60,60,67,0.4); font-size: 14px; }

/* Library */
.ck-search {
    display: flex; align-items: center; gap: 6px;
    background: rgba(118,118,128,0.12); border-radius: 10px; padding: 8px 10px; margin-bottom: 12px;
    color: rgba(60,60,67,0.6); font-size: 15px;
}
.ck-search input { flex: 1; border: 0; background: transparent; font: inherit; outline: 0; color: #000; }
.ck-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; border-bottom: 0.5px solid rgba(60,60,67,0.12);
}
.ck-item:last-child { border-bottom: 0; }
.ck-item-body { flex: 1; min-width: 0; }
.ck-item-en { font-size: 16px; font-weight: 600; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-item-zh { font-size: 13px; color: rgba(60,60,67,0.6); margin-top: 1px; }
.ck-item-meta { font-size: 11px; margin-top: 3px; color: rgba(60,60,67,0.45); }
.ck-item-meta.due { color: #ff3b30; }
.ck-item-meta.soon { color: #ff9500; }
.ck-item-meta.mastered { color: #34c759; }
.ck-item.new { background: rgba(0,122,255,0.06); }

/* Review */
.ck-stats { display: flex; align-items: center; padding: 14px 0; }
.ck-stat { flex: 1; text-align: center; }
.ck-stat-num { font-size: 26px; font-weight: 700; color: #000; letter-spacing: -0.02em; }
.ck-stat-lbl { font-size: 12px; color: rgba(60,60,67,0.6); margin-top: 2px; }
.ck-stat-div { width: 0.5px; height: 32px; background: rgba(60,60,67,0.2); }
.ck-progress { font-size: 12px; color: rgba(60,60,67,0.5); text-align: center; margin: 16px 0 10px; }
.ck-flashcard {
    perspective: 1200px; height: 240px; cursor: pointer;
}
.ck-flash-inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.ck-flashcard.flipped .ck-flash-inner { transform: rotateY(180deg); }
.ck-face {
    position: absolute; inset: 0; backface-visibility: hidden;
    background: #fff; border-radius: 16px; padding: 22px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.ck-face.back { transform: rotateY(180deg); }
.ck-card-zh { font-size: 22px; font-weight: 600; color: #000; line-height: 1.4; }
.ck-tap-hint { position: absolute; bottom: 14px; font-size: 12px; color: rgba(60,60,67,0.35); }
.ck-card-en { font-size: 24px; font-weight: 700; color: #000; letter-spacing: -0.01em; line-height: 1.3; }
.ck-card-ex { font-size: 14px; color: rgba(60,60,67,0.55); margin-top: 12px; font-style: italic; line-height: 1.45; }
.ck-rates { display: flex; gap: 10px; margin-top: 14px; opacity: 0.35; pointer-events: none; transition: opacity .25s; }
.ck-rates.on { opacity: 1; pointer-events: auto; }
.ck-rate {
    flex: 1; border: 0; border-radius: 12px; padding: 12px 6px; cursor: pointer;
    font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px;
    transition: transform .12s;
}
.ck-rate:active { transform: scale(0.96); }
.ck-rate-label { font-size: 16px; font-weight: 600; }
.ck-rate-detail { font-size: 11px; opacity: 0.85; }
.ck-rate.bad  { background: rgba(255,59,48,0.12); color: #ff3b30; }
.ck-rate.mid  { background: rgba(255,149,0,0.14); color: #ff9500; }
.ck-rate.good { background: rgba(52,199,89,0.14); color: #34c759; }
.ck-done { text-align: center; padding: 40px 10px; }
.ck-done-title { font-size: 20px; font-weight: 700; color: #000; }
.ck-done-hint { font-size: 14px; color: rgba(60,60,67,0.55); margin-top: 6px; }

/* Tab bar */
.ck-tabbar {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 82px; padding: 8px 0 22px;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(60,60,67,0.2);
    display: flex; justify-content: space-around; align-items: flex-start;
}
.ck-tab {
    border: 0; background: transparent; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: rgba(60,60,67,0.5); font-size: 10px; position: relative; width: 72px;
}
.ck-tab svg { width: 26px; height: 26px; }
.ck-tab.active { color: #007aff; }
.ck-badge {
    position: absolute; top: -4px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700;
    display: grid; place-items: center;
}
.ck-badge.hidden { display: none; }
.ck-toast {
    position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(10px);
    background: rgba(0,0,0,0.82); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 10px;
    opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap;
}
.ck-toast.show { opacity: 1; transform: translateX(-50%); }

.ck-panel { display: none; }
.ck-panel.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ck-content { min-height: 0; }
#ck-demo .hidden { display: none !important; }

/* Demo side notes */
.ck-steps { display: flex; flex-direction: column; gap: 1rem; }
.ck-step {
    display: grid; grid-template-columns: 34px 1fr; gap: 0.9rem;
    padding: 1.1rem 1.2rem; border-radius: 12px;
    background: #101018; border: 1px solid #25252e;
    cursor: pointer; transition: border-color .2s, background .2s;
}
.ck-step:hover, .ck-step.active { border-color: #fff; background: #14141d; }
.ck-step-num {
    font-family: 'Orbitron', ui-monospace, monospace; font-size: 13px; color: #888;
    padding-top: 2px;
}
.ck-step.active .ck-step-num { color: #fff; }
.ck-step h4 { margin: 0 0 0.3rem; font-size: 1rem; color: #e6e6ec; font-weight: 600; }
.ck-step p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: #999; }
.ck-demo-note {
    margin-top: 1.2rem; font-family: ui-monospace, monospace; font-size: 11px; color: #666; letter-spacing: 0.05em;
}

/* ── Design details ─────────────────────────────────────────────────── */
.ck-details {
    display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 2.5rem;
}
@media (min-width: 760px) { .ck-details { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .ck-details { grid-template-columns: repeat(3, 1fr); } }
.ck-detail {
    background: #101018; border: 1px solid #25252e; border-radius: 12px; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 0.7rem;
}
.ck-detail-ui {
    background: #f2f2f7; border-radius: 10px; padding: 12px; color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; font-size: 13px;
    margin-bottom: 0.4rem;
}
.ck-detail h3 { margin: 0; font-size: 1.05rem; color: #e6e6ec; font-weight: 600; }
.ck-detail p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: #999; }
.ck-detail .because { color: #ccc; }

/* mini UI snippets inside detail cards */
.ck-mini-btn { background: #007aff; color: #fff; border-radius: 9px; padding: 9px; text-align: center; font-weight: 600; font-size: 14px; }
.ck-mini-input { background: #fff; border-radius: 9px; padding: 10px; color: rgba(60,60,67,0.3); margin-bottom: 8px; }
.ck-mini-rates { display: flex; gap: 6px; }
.ck-mini-rate { flex: 1; border-radius: 9px; padding: 7px 4px; text-align: center; font-size: 12px; font-weight: 600; }
.ck-mini-rate small { display: block; font-weight: 400; font-size: 10px; opacity: 0.8; }
.ck-mini-rate.bad { background: rgba(255,59,48,0.12); color: #ff3b30; }
.ck-mini-rate.mid { background: rgba(255,149,0,0.14); color: #ff9500; }
.ck-mini-rate.good { background: rgba(52,199,89,0.14); color: #34c759; }
.ck-mini-saved { background: rgba(52,199,89,0.14); color: #1f8f3d; border-radius: 8px; padding: 7px 10px; font-weight: 500; }
.ck-mini-card { background: #fff; border-radius: 9px; padding: 10px 12px; }
.ck-mini-card .en { font-weight: 600; font-size: 14px; }
.ck-mini-card .zh { color: rgba(60,60,67,0.6); font-size: 12px; }
.ck-mini-card .ex { color: rgba(60,60,67,0.45); font-size: 11px; font-style: italic; margin-top: 4px; }
.ck-mini-strike { text-decoration: line-through; color: rgba(60,60,67,0.4); }
.ck-mini-tag { display: inline-block; background: rgba(0,122,255,0.1); color: #007aff; border-radius: 6px; padding: 2px 7px; font-size: 11px; margin-right: 4px; }
.ck-mini-tag.x { background: rgba(255,59,48,0.1); color: #ff3b30; text-decoration: line-through; }
.ck-mini-front { background: #fff; border-radius: 9px; padding: 16px; text-align: center; font-weight: 600; font-size: 15px; }
.ck-mini-front small { display: block; font-weight: 400; font-size: 10px; color: rgba(60,60,67,0.35); margin-top: 6px; }
.ck-mini-tabs { display: flex; justify-content: space-around; background: #fff; border-radius: 9px; padding: 8px 0; }
.ck-mini-tab { font-size: 10px; color: rgba(60,60,67,0.5); position: relative; }
.ck-mini-tab.on { color: #007aff; }
.ck-mini-tab .b { position: absolute; top: -8px; right: -12px; background: #ff3b30; color: #fff; border-radius: 8px; font-size: 9px; padding: 1px 5px; font-weight: 700; }

/* ── Iterations timeline ────────────────────────────────────────────── */
.ck-timeline { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0; }
.ck-iter {
    display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem;
    padding: 1.4rem 0; border-top: 1px solid #25252e;
}
.ck-iter:last-child { border-bottom: 1px solid #25252e; }
@media (max-width: 600px) { .ck-iter { grid-template-columns: 1fr; gap: 0.4rem; } }
.ck-iter-when { font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 0.12em; color: #888; padding-top: 4px; }
.ck-iter h4 { margin: 0 0 0.35rem; font-size: 1.05rem; color: #e6e6ec; font-weight: 600; }
.ck-iter p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: #999; max-width: 760px; }
.ck-iter p + p { margin-top: 0.4rem; }
.ck-iter .verdict { color: #e6e6ec; }
.ck-iter .verdict.cut::before { content: '✕ '; color: #ff6b6b; }
.ck-iter .verdict.keep::before { content: '✓ '; color: #5ad27a; }

/* ── Under the hood (compact) ───────────────────────────────────────── */
.ck-stack-row {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem;
}
.ck-stack-row span {
    font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 0.06em;
    color: #aaa; background: #101018; border: 1px solid #25252e; border-radius: 6px; padding: 5px 10px;
}
.ck-hood .arch-interactive { margin-top: 2rem; }
