/*
 * A subject's paper list in the app look (papers-subject-app.blade.php, 2026-11-18): white page, a big title,
 * the 按考点练习 start card, a sticky bar (Kertas switch + year / state / sort pills that open a bottom sheet),
 * papers grouped by year on light grey, orange for the one main action. body.ps-app.
 * Dark mode: tools/dark-css/gen.py twins the colours into dark.css.
 */
body.ps-app .chat-main,
body.ps-app .chat-scroll,
body.ps-app .ps-header { background: #fff; }
/* No padding on the scroller: the sticky bar sticks to its very top edge (padding would leave a strip of list above it). */
body.ps-app .chat-scroll { padding: 0; }
body.ps-app .ps-header-title { opacity: 0; transition: opacity 0.2s ease; font-weight: 700; }
body.ps-app .ps-header-title.is-shown { opacity: 1; }

body.ps-app .ps-wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 4px 20px 120px; }

/* ---------- Big title ---------- */
body.ps-app .ps-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 20px; }
body.ps-app .ps-hero-icon { display: grid; flex: none; place-items: center; width: 52px; height: 52px; border-bottom: 5px solid var(--e); border-radius: 16px; background: var(--c); color: #fff; --icon-size: 28px; font-size: 28px; }
body.ps-app .ps-hero-text { min-width: 0; }
body.ps-app .ps-title { margin: 0; color: #23232b; font-size: 24px; font-weight: 800; line-height: 1.25; }
body.ps-app .ps-sub { margin: 4px 0 0; color: #8a8a93; font-size: 13.5px; font-weight: 600; }
body.ps-app .ps-sub-done { color: #1f7a45; }

/* ---------- 按考点练习: one plain row between hairlines ---------- */
body.ps-app .ps-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 4px;
    border-top: 1px solid #ececee;
    border-bottom: 1px solid #ececee;
    color: #23232b;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}
body.ps-app .ps-card:hover { background: #fafafa; }
body.ps-app .ps-card:active { background: #f4f4f5; }
body.ps-app .ps-card-icon { flex: none; color: #f26a1b; --icon-size: 24px; font-size: 24px; }
body.ps-app .ps-card-title { flex: 1; font-size: 15.5px; font-weight: 700; }
body.ps-app .ps-card-note { flex: none; color: #8a8a93; font-size: 13px; }
body.ps-app .ps-card-go { flex: none; margin-left: -4px; color: #c0c0c7; --icon-size: 20px; font-size: 20px; }

/* ---------- Sticky bar ---------- */
body.ps-app .ps-bar {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 -20px;
    padding: 12px 20px 10px;
    background: #fff;
    transition: box-shadow 0.2s ease;
}
body.ps-app .ps-bar.is-stuck { box-shadow: 0 1px 0 #ececee; }
body.ps-app .ps-bar[hidden], body.ps-app .ps-sub[hidden] { display: none; }
body.ps-app .ps-seg { position: relative; display: flex; padding: 3px; border-radius: 12px; background: #f2f2f3; }
body.ps-app .ps-seg-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6b6b74;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}
body.ps-app .ps-seg-btn.is-on { color: #23232b; }
body.ps-app .ps-seg-pill { position: absolute; top: 3px; bottom: 3px; left: 0; z-index: 0; border-radius: 9px; background: #fff; box-shadow: 0 1px 2px rgba(20, 20, 30, 0.08); transition: transform 0.26s cubic-bezier(0.3, 0.9, 0.3, 1), width 0.26s cubic-bezier(0.3, 0.9, 0.3, 1); }
body.ps-app .ps-pills { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
body.ps-app .ps-pills::-webkit-scrollbar { display: none; }
body.ps-app .ps-pill {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 10px 0 14px;
    border: 0;
    border-radius: 999px;
    background: #f2f2f3;
    color: #33333d;
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    --icon-size: 18px;
}
body.ps-app .ps-pill .material-symbols-outlined { font-size: 18px; color: #8a8a93; }
body.ps-app .ps-pill:hover { background: #ececee; }
body.ps-app .ps-pill:active { transform: scale(0.97); }
body.ps-app .ps-pill.is-set { background: #fff0e6; color: #b4500f; }
body.ps-app .ps-pill.is-set .material-symbols-outlined { color: #e0782f; }
body.ps-app .ps-pill-sort { padding: 0 14px 0 10px; }
body.ps-app .ps-clear { flex: none; height: 34px; padding: 0 8px; border: 0; background: none; color: #e0600f; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }

/* ---------- The list ---------- */
body.ps-app .ps-group { margin-top: 22px; }
body.ps-app .ps-group-title { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 6px; color: #23232b; font-size: 17px; font-weight: 800; }
body.ps-app .ps-group-count { color: #8a8a93; font-size: 13px; font-weight: 600; }
body.ps-app .ps-group-flat { margin-top: 14px; }
body.ps-app .ps-rows { border-top: 1px solid #ececee; }
body.ps-app .ps-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 4px;
    border-bottom: 1px solid #ececee;
    color: #23232b;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}
body.ps-app .ps-row[hidden] { display: none; }
body.ps-app .ps-row:hover { background: #fafafa; }
body.ps-app .ps-row:active { background: #f4f4f5; }
body.ps-app .ps-row-tile { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #ffe9db; color: #d4570c; font-size: 13px; font-weight: 800; letter-spacing: 0.01em; }
body.ps-app .ps-row-tile.is-k2 { background: #e9e9ee; color: #4a4a57; }
body.ps-app .ps-row-main { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
body.ps-app .ps-row-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
body.ps-app .ps-row-meta { color: #8a8a93; font-size: 12.5px; font-weight: 500; }
body.ps-app .ps-row-year { display: none; }
body.ps-app .ps-list.is-flat .ps-row-year { display: inline; }
body.ps-app .ps-tag { display: inline-flex; flex: none; align-items: center; gap: 3px; padding: 4px 8px 4px 6px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; --icon-size: 14px; }
body.ps-app .ps-tag .material-symbols-outlined { font-size: 14px; font-variation-settings: 'FILL' 1; }
body.ps-app .ps-tag.is-going { background: #fff0e6; color: #b4500f; }
body.ps-app .ps-tag.is-done { background: #e6f5ec; color: #1f7a45; }
body.ps-app .ps-row-chev { flex: none; margin-left: -4px; color: #c0c0c7; --icon-size: 20px; font-size: 20px; }

body.ps-app .ps-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px 24px; color: #8a8a93; text-align: center; }
body.ps-app .ps-empty[hidden] { display: none; }
body.ps-app .ps-empty .material-symbols-outlined { --icon-size: 40px; font-size: 40px; color: #c0c0c7; }
body.ps-app .ps-empty p { margin: 0; font-size: 14.5px; font-weight: 600; }
body.ps-app .ps-empty-btn { height: 40px; margin-top: 8px; padding: 0 18px; border: 0; border-radius: 12px; background: #f2f2f3; color: #33333d; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
body.ps-app .ps-about { margin: 32px 4px 0; color: #9a9aa2; font-size: 12.5px; line-height: 1.65; }

/* ---------- The sheet ---------- */
.ps-sheet { position: fixed; inset: 0; z-index: 1300; }
.ps-sheet[hidden] { display: none; }
.ps-sheet-dim { position: absolute; inset: 0; background: rgba(20, 20, 30, 0.38); opacity: 0; transition: opacity 0.25s ease; }
.ps-sheet.is-open .ps-sheet-dim { opacity: 1; }
.ps-sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    max-height: 80dvh;
    padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    background: #fff;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.ps-sheet.is-open .ps-sheet-panel { transform: translateY(0); }
.ps-sheet-handle { align-self: center; width: 36px; height: 5px; margin-bottom: 8px; border-radius: 3px; background: #dcdce0; }
.ps-sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin: 0 4px 6px; }
.ps-sheet-head h3 { margin: 0; color: #23232b; font-size: 18px; font-weight: 800; }
.ps-sheet-reset { border: 0; background: none; color: #e0600f; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.ps-sheet-reset[hidden] { display: none; }
.ps-sheet-body { overflow-y: auto; overscroll-behavior: contain; }
.ps-opts { overflow: hidden; border-radius: 16px; background: #f6f6f7; }
.ps-opts[hidden] { display: none; }
.ps-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 0 14px 0 16px;
    border: 0;
    background: transparent;
    color: #23232b;
    font: inherit;
    font-size: 15.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}
.ps-opt + .ps-opt::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: #e8e8ea; }
.ps-opt:hover { background: #efeff1; }
.ps-opt > span:first-child { flex: 1; }
.ps-opt small { color: #9a9aa2; font-size: 13px; font-weight: 600; }
.ps-opt.is-none { opacity: 0.45; }
.ps-opt-tick { width: 24px; height: 24px; border-radius: 50%; color: transparent; --icon-size: 18px; font-size: 18px; display: grid; place-items: center; box-shadow: inset 0 0 0 2px #d6d6da; transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease; font-variation-settings: 'wght' 700; }
.ps-opt.is-on .ps-opt-tick { background: #f26a1b; box-shadow: none; color: #fff; }
.ps-opts[data-single] .ps-opt-tick { box-shadow: none; background: none; }
.ps-opts[data-single] .ps-opt.is-on .ps-opt-tick { background: none; color: #f26a1b; }
.ps-sheet-done { flex: none; height: 50px; margin-top: 12px; border: 0; border-radius: 16px; background: #f26a1b; color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; transition: background-color 0.15s ease, transform 0.12s ease; }
.ps-sheet-done:hover { background: #ee6412; }
.ps-sheet-done:active { background: #e35d10; transform: scale(0.98); }

@media (min-width: 721px) {
    body.ps-app .ps-wrap { padding: 8px 28px 64px; }
    body.ps-app .ps-bar { margin: 0 -28px; padding: 12px 28px 10px; flex-direction: row; align-items: center; }
    body.ps-app .ps-seg { flex: none; }
    body.ps-app .ps-seg-btn { flex: none; padding: 0 16px; }
    body.ps-app .ps-title { font-size: 28px; }
    .ps-sheet-panel { top: 50%; right: auto; bottom: auto; left: 50%; width: 420px; max-height: 76vh; padding: 16px 16px 16px; border-radius: 22px; opacity: 0; transform: translate(-50%, -47%) scale(0.98); transition: transform 0.22s ease, opacity 0.18s ease; }
    .ps-sheet.is-open .ps-sheet-panel { opacity: 1; transform: translate(-50%, -50%); }
    .ps-sheet-handle { display: none; }
}
@media (max-width: 720px) {
    body.ps-app .ps-wrap { padding: 4px 16px 120px; }
    body.ps-app .ps-bar { margin: 0 -16px; padding: 10px 16px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    body.ps-app .ps-seg-pill, body.ps-app .ps-card, .ps-sheet-panel, .ps-sheet-dim { transition: none !important; }
}
/* Rows come 30 at a time (js/papers-subject.js): the marker after the list that asks for more. */
.ps-row[hidden], .ps-group[hidden] { display: none !important; }
.ps-more { height: 1px; }
.ps-more[hidden] { display: none; }
