/* ============================================================
   QrCode — Design System
   Quiet editorial · paper & ink · light & dark · RTL (fa)
   ============================================================ */

:root {
    --primary: #1c1917;
    --primary-ink: #9f1239;
    --stars: #b45309;
    --success: #166534;
    --danger: #991b1b;

    --font-main: 'Vazirmatn', Tahoma, sans-serif;

    --radius: 4px;
    --radius-sm: 3px;
    --radius-lg: 6px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 14px -6px rgba(0, 0, 0, .12);
    --shadow-lg: 0 10px 28px -12px rgba(0, 0, 0, .18);

    --grad: #1c1917;
    --grad-soft: rgba(28, 25, 23, .05);

    --header-h: 64px;
}

html[data-theme="light"] {
    --bg: #faf9f7;
    --bg-soft: #f3f1ec;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --surface-2: #f7f5f1;
    --border: #e7e5e0;
    --border-strong: #d6d3cd;
    --text: #1c1917;
    --muted: #6f6a63;
    --glass-shadow: 0 1px 0 rgba(0, 0, 0, .04);
    --gap-bg: transparent;
    --primary: #1c1917;
    --primary-ink: #9f1239;
    --link: #9f1239;
    --btn-fg: #faf9f7;
    --btn-bg: #1c1917;
}

html[data-theme="dark"] {
    --bg: #121212;
    --bg-soft: #1a1a1a;
    --surface: #1a1a1a;
    --surface-solid: #1a1a1a;
    --surface-2: #222222;
    --border: #2e2e2e;
    --border-strong: #404040;
    --text: #f2f0eb;
    --muted: #9a9590;
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .04);
    --gap-bg: transparent;
    --grad: #f2f0eb;
    --grad-soft: rgba(255, 255, 255, .06);
    --primary: #f2f0eb;
    --primary-ink: #fb7185;
    --link: #fda4af;
    --btn-fg: #121212;
    --btn-bg: #f2f0eb;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: rgba(159, 18, 57, .18); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 130, 170, .35); border-radius: 10px; }

.gradient-text {
    color: var(--primary-ink);
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, background .2s ease;
}

.site-header.scrolled,
.site-header.is-glass {
    background: var(--bg);
    border-bottom-color: var(--border);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo { display: flex; align-items: center; gap: 11px; }

.logo-mark {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--text);
    display: flex; align-items: center; justify-content: center;
    color: var(--bg);
    flex-shrink: 0;
}

.logo-mark svg { width: 26px; height: 26px; }

.logo-text { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.logo-text em { font-style: normal; color: var(--primary-ink); -webkit-text-fill-color: currentColor; background: none; }

.main-nav { display: flex; align-items: center; gap: 24px; }

.main-nav > a:not(.btn) {
    position: relative;
    font-weight: 500;
    font-size: .95rem;
    color: var(--muted);
    transition: color .2s;
    padding: 6px 2px;
}

.main-nav > a:not(.btn)::after {
    content: "";
    position: absolute;
    right: 0; left: 100%;
    bottom: 0;
    height: 1px;
    background: var(--text);
    transition: left .25s ease;
}

.main-nav > a:not(.btn):hover { color: var(--text); }
.main-nav > a:not(.btn):hover::after,
.main-nav > a:not(.btn).active::after { left: 0; }
.main-nav > a:not(.btn).active { color: var(--text); font-weight: 700; }

.nav-user {
    display: flex; align-items: center; gap: 9px;
    font-size: .9rem; color: var(--muted);
    background: transparent;
    border: 0;
    padding: 6px 8px;
    border-radius: 0;
}

.nav-user .user-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
}

.nav-user .user-dot svg { width: 16px; height: 16px; }

.nav-cta-group { display: flex; align-items: center; gap: 10px; }

/* theme toggle */
.theme-toggle {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
}

.theme-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); }
.theme-toggle svg { width: 20px; height: 20px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* hamburger */
.nav-toggle { display: none; }

.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.nav-overlay.open { opacity: 1; pointer-events: auto; }

body.nav-locked { overflow: hidden; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .92rem;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.5;
    text-decoration: none;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-fg);
    border-color: var(--btn-bg);
}

.btn-primary:hover {
    opacity: .88;
    border-color: var(--btn-bg);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-outline:hover { border-color: var(--text); color: var(--text); background: var(--surface-2); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text);
}

.btn-ghost:hover { background: var(--surface-2); }

.btn-danger { background: transparent; color: var(--danger); border-color: rgba(153, 27, 27, .35); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-success { background: transparent; color: var(--success); border-color: rgba(22, 101, 52, .35); }
.btn-success:hover { background: var(--success); color: #fff; border-color: var(--success); }

.btn-sm { padding: 6px 12px; font-size: .84rem; border-radius: var(--radius); }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    text-align: right;
    padding: 72px 0 48px;
    max-width: 720px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 18px;
}

.hero-badge svg { width: 15px; height: 15px; color: var(--primary-ink); }

.hero h1 {
    font-size: clamp(1.75rem, 3.8vw, 2.5rem);
    font-weight: 700;
    line-height: 1.55;
    margin-bottom: 16px;
    letter-spacing: -.02em;
}

.hero p {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.9;
    max-width: 560px;
    margin: 0 0 28px;
}

.hero-cta { display: flex; gap: 12px; justify-content: flex-start; flex-wrap: wrap; }

.hero-after {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
}

.chip-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
}

/* ---------- Sections ---------- */

.section {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding: 58px 22px;
}

.site-main { flex: 1; }

.section-head { text-align: right; margin-bottom: 36px; }

.section-title {
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    font-weight: 700;
    line-height: 1.55;
    margin-bottom: 24px;
}

.section-title .gradient-text { }

.section-sub {
    color: var(--muted);
    margin-top: 10px;
    margin-bottom: 22px;
    font-size: 1rem;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .4px;
    margin-bottom: 12px;
}

.section-eyebrow::before {
    content: "";
    width: 18px; height: 1px;
    background: var(--primary-ink);
}

/* ---------- Grid & Cards ---------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: none;
    transition: border-color .15s ease;
}

.card:hover {
    border-color: var(--border-strong);
}

.feature-card { position: relative; overflow: hidden; }

.feature-card::before { display: none; }

.feature-card > * { position: relative; z-index: 1; }

.feature-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}

.feature-icon svg { width: 25px; height: 25px; }

.feature-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: .93rem; }

/* steps */
.step-card { position: relative; text-align: center; padding: 32px 24px; overflow: hidden; }

.step-num {
    width: 52px; height: 52px;
    margin: 0 auto 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700;
    transition: background .2s, color .2s;
}

.step-card:hover .step-num {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.step-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: .92rem; }

.step-arrow {
    position: absolute;
    top: 50%;
    left: -14px;
    transform: translateY(-50%);
    color: var(--muted);
    opacity: .55;
    z-index: 2;
}

.step-arrow svg { width: 20px; height: 20px; }

/* team */
.team-card { text-align: center; }

.avatar-ring {
    width: 72px; height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    padding: 3px;
    background: var(--border);
    display: flex; align-items: center; justify-content: center;
    box-shadow: none;
}

.avatar-ring .avatar-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--surface-solid);
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
}

.avatar-inner svg { width: 34px; height: 34px; }

.team-card h3 { font-size: 1.05rem; font-weight: 700; }
.role { color: var(--muted); font-size: .88rem; margin-top: 4px; }

/* CTA band */
.cta-band {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 44px 36px;
    text-align: right;
    color: var(--bg);
    background: var(--text);
    box-shadow: none;
    margin: 8px 0;
    border: 0;
}

.cta-band::before { display: none; }

.cta-band > * { position: relative; z-index: 1; }

.cta-band h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; margin-bottom: 8px; }
.cta-band p { opacity: .85; margin-bottom: 24px; font-size: .98rem; }

.btn-light {
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
}

.btn-light:hover { opacity: .9; }

/* ---------- Alerts ---------- */

.alert {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 18px 0 0;
    font-weight: 500;
    font-size: .9rem;
    border: 1px solid transparent;
    animation: alertIn .35s ease;
    transition: opacity .3s, transform .3s;
}

.alert svg { width: 20px; height: 20px; flex-shrink: 0; }

.alert-success {
    background: rgba(22, 101, 52, .07);
    border-color: rgba(22, 101, 52, .25);
    color: var(--success);
}

.alert-error {
    background: rgba(153, 27, 27, .07);
    border-color: rgba(153, 27, 27, .25);
    color: var(--danger);
}

.alert-close {
    margin-inline-start: auto;
    background: none; border: none;
    color: inherit;
    opacity: .6;
    display: flex;
    padding: 2px;
    transition: opacity .2s;
}

.alert-close:hover { opacity: 1; }
.alert-close svg { width: 16px; height: 16px; }

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Books list ---------- */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 760px;
    margin: 0 0 32px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.filter-bar input[type="text"],
.filter-bar select {
    flex: 1 1 200px;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.filter-bar input[type="text"]::placeholder {
    color: var(--muted);
    opacity: .75;
}

.filter-bar select {
    appearance: none;
    -webkit-appearance: none;
    padding-inline-end: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a8399' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 14px;
}

.filter-bar input[type="text"]:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--text);
    background-color: var(--surface-solid);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

.filter-bar .btn { flex: 0 0 auto; }

.field {
    position: relative;
    flex: 1 1 220px;
}

.field svg {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--muted);
    pointer-events: none;
    opacity: .8;
}

.field select { appearance: none; -webkit-appearance: none; }

.field select ~ .chev {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    width: 16px; height: 16px;
}

.field input[type="text"], .field select {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input[type="text"]:focus, .field select:focus {
    outline: none;
    border-color: var(--text);
    background: var(--surface-solid);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
    gap: 22px;
}

.book-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }

.book-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--surface-2);
    overflow: hidden;
}

.book-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform .5s ease;
}

.book-card:hover .book-cover img { transform: scale(1.06); }

.book-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .12);
    opacity: 0;
    transition: opacity .2s;
}

.book-card:hover .book-cover::after { opacity: 1; }

.book-cover-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 46px;
    color: var(--muted);
    background: var(--surface-2);
}

.book-cover-placeholder svg { width: 64px; height: 64px; opacity: .8; }

.book-chip {
    position: absolute;
    top: 10px;
    bottom: auto;
    right: 10px;
    left: auto;
    z-index: 2;
    background: var(--surface);
    color: var(--text);
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: none;
}

html[data-theme="dark"] .book-chip { background: var(--surface-solid); color: var(--text); }

.book-card-body { display: flex; flex-direction: column; padding: 16px 18px 18px; flex: 1; }

.book-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 2px;
}

.book-meta {
    color: var(--muted);
    font-size: .84rem;
    margin-top: 3px;
}

.tag {
    display: inline-block;
    margin-top: 10px;
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 500;
    font-size: .74rem;
    padding: 2px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    align-self: flex-start;
}

.book-rating {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .95rem;
    color: var(--muted);
}

.book-card .book-cover {
    height: 220px;
    aspect-ratio: auto;
}

.book-card > h3 {
    margin: 16px 18px 0;
}

.book-card > .book-meta {
    margin: 4px 18px 0;
}

.book-card > .tag {
    margin: 10px 18px 0;
    align-self: flex-start;
}

.book-card > .book-rating {
    margin: auto 18px 18px;
}

.stars { display: inline-flex; gap: 3px; font-size: 1.45rem; }

.star { color: var(--border-strong); transition: color .15s; }
.star.is-filled { color: var(--stars); text-shadow: 0 0 10px rgba(245, 158, 11, .4); }

.review-count-badge {
    margin-inline-start: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted);
    padding: 2px 8px;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 64px 20px;
}

.empty-state .empty-icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
}

.empty-state .empty-icon svg { width: 34px; height: 34px; }
.empty-state h3 { color: var(--text); font-size: 1.15rem; margin-bottom: 6px; }

/* ---------- Book detail ---------- */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 22px;
}

.breadcrumb svg { width: 15px; height: 15px; opacity: .7; }
.breadcrumb a { transition: color .2s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { opacity: .5; }

.book-detail-top {
    display: flex;
    gap: 32px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    margin-bottom: 24px;
}

.book-cover-frame {
    position: relative;
    width: 240px;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: none;
    border: 1px solid var(--border);
}

.book-cover-frame img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }

.book-cover-frame .book-cover-placeholder { aspect-ratio: 3/4; }

.book-info { flex: 1; min-width: 0; }

.book-info h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.6; margin-bottom: 8px; }

.book-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 12px 0 6px;
}

.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
}

.rating-pill .val { color: var(--stars); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
    font-size: .8rem;
    padding: 5px 12px;
    border-radius: var(--radius);
}

.chip svg { width: 15px; height: 15px; }

.book-desc {
    margin-top: 18px;
    color: var(--text);
    font-size: .97rem;
    line-height: 2;
}

/* reviews */
.review-list { display: flex; flex-direction: column; gap: 16px; margin: 0 0 34px; }

.review-item {
    padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-item:hover { transform: none; box-shadow: none; }

.review-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 0; font-size: .9rem; }

.review-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: .95rem;
    flex-shrink: 0;
}

.review-avatar svg { width: 20px; height: 20px; }

.review-who strong { display: block; font-size: .96rem; }
.review-who .review-date { color: var(--muted); font-size: .78rem; }

.review-book-tag { font-size: .8rem; color: var(--muted); }

.review-stars-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px 10px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--muted);
}

.score-badge .stars { font-size: 1.15rem; }

.review-comment { color: var(--text); font-size: .92rem; line-height: 1.9; }

/* review form */
.review-form-box {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.review-form-box > h2 { margin-bottom: 18px; }

.form-hint { color: var(--muted); font-size: .83rem; margin-top: 10px; }

.review-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .9rem;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.review-note svg { width: 20px; height: 20px; color: var(--text); flex-shrink: 0; }

.review-note a { color: var(--text); font-weight: 700; }
.review-note a:hover { text-decoration: underline; }

/* ---------- Forms ---------- */

.form-group { margin-bottom: 18px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: .88rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.form-group textarea { resize: vertical; }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--text);
    background: var(--surface-solid);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

.form-group input[type="file"] { padding: 10px; }

.form-group input[type="file"]::file-selector-button {
    font-family: inherit;
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    background: var(--btn-bg);
    border: none;
    padding: 8px 16px;
    margin-inline-end: 12px;
    border-radius: var(--radius);
    cursor: pointer;
}

/* star input (review form) */
.star-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    font-size: 2.6rem;
}

.star-input input { display: none; }

.star-input label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    color: var(--border-strong);
    cursor: pointer;
    transition: color .15s, background .15s;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.star-input label:hover {
    background: rgba(180, 83, 9, .08);
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
    color: var(--stars);
    text-shadow: none;
}

/* ---------- Auth ---------- */

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    max-width: 920px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
}

.auth-visual {
    position: relative;
    background: var(--text);
    color: var(--bg);
    padding: 48px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-visual::before { display: none; }

.auth-visual > * { position: relative; z-index: 1; }

.auth-visual .brand-row { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }

.auth-visual .brand-mark {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid currentColor;
    display: flex; align-items: center; justify-content: center;
}

.auth-visual .brand-mark svg { width: 22px; height: 22px; }

.auth-visual h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 800; line-height: 1.7; margin-bottom: 12px; }
.auth-visual p { opacity: .9; font-size: .94rem; line-height: 2; }

.auth-visual .visual-points { display: flex; flex-direction: column; gap: 14px; }

.visual-point { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: .9rem; }

.visual-point .vp-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid currentColor;
    opacity: .85;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.visual-point .vp-icon svg { width: 19px; height: 19px; }

.auth-card {
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card h1 { font-size: 1.55rem; font-weight: 800; margin-bottom: 6px; }
.auth-card .auth-sub { color: var(--muted); font-size: .92rem; margin-bottom: 28px; }

.auth-switch { text-align: center; margin-top: 22px; color: var(--muted); font-size: .9rem; }
.auth-switch a { color: var(--link); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ---------- 404 ---------- */

.error-page {
    text-align: center;
    padding: 90px 22px 120px;
    position: relative;
}

.error-code {
    font-size: clamp(5rem, 16vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    -webkit-text-fill-color: currentColor;
    background: none;
    filter: none;
    letter-spacing: -4px;
}

.error-page h1 { font-size: 1.5rem; font-weight: 800; margin: 10px 0 8px; }
.error-page p { color: var(--muted); margin-bottom: 30px; }

/* ---------- Admin ---------- */

.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-bottom: 28px; }

.stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: none;
}

.stat-icon svg { width: 27px; height: 27px; }

.stat-card h3 { font-size: 1.7rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.stat-card p { color: var(--muted); font-size: .9rem; }

.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; }

.admin-form {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    margin-bottom: 32px;
}

.admin-form h2 { margin-bottom: 20px; }

.admin-table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    margin-bottom: 20px;
}

.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }

.admin-table th {
    padding: 14px 16px;
    text-align: right;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 13px 16px;
    font-size: .9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tbody tr { transition: background .2s; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table tbody tr:last-child td { border-bottom: none; }

.thumb-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }

.thumb {
    width: 40px; height: 54px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb .thumb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb .thumb-ph svg { width: 20px; height: 20px; }

.thumb-cell .t-title { font-weight: 600; line-height: 1.5; }
.thumb-cell .t-sub { color: var(--muted); font-size: .78rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-primary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-success { background: rgba(16, 185, 129, .12); color: var(--success); }

.cell-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.review-moderate-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.review-moderate-form .btn { flex: 1; min-width: 120px; }

/* ---------- Footer ---------- */

.site-footer {
    position: relative;
    margin-top: auto;
    background: var(--surface-solid);
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.site-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 0; left: 0;
    height: 1px;
    background: var(--border);
    opacity: 1;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 34px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 54px 22px 40px;
}

.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.footer-brand .logo-mark { width: 38px; height: 38px; border-radius: 11px; }
.footer-brand .logo-mark svg { width: 23px; height: 23px; }

.footer-brand .logo-text { font-size: 1.2rem; }

.footer-desc { font-size: .9rem; line-height: 2; margin-bottom: 18px; }

.social-row { display: flex; gap: 10px; }

.social-link {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s, border-color .15s;
}

.social-link:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.social-link svg { width: 18px; height: 18px; }

.footer-col h4 { color: var(--text); font-size: .98rem; font-weight: 700; margin-bottom: 14px; }

.footer-col a, .footer-col p {
    font-size: .89rem;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .2s;
}

.footer-col a:hover { color: var(--text); }
.footer-col a svg { width: 15px; height: 15px; opacity: .7; }

.footer-bottom {
    text-align: center;
    padding: 20px;
    font-size: .84rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* Back to top */
.to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 50;
    width: 42px; height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface-solid);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s, background .15s;
}

.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--surface-2); border-color: var(--text); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Reveal animation ---------- */

.will-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .6s ease, transform .6s ease;
}

.will-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .auth-shell { grid-template-columns: 1fr; max-width: 520px; }
    .auth-visual { display: none; }
    .book-detail-top { flex-direction: column; }
    .book-cover-lg { width: 220px; margin-inline: auto; }
}

@media (max-width: 860px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        padding: 8px;
        border-radius: 10px;
    }

    .nav-toggle span {
        width: 22px; height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: all .3s;
    }

    .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; }
    .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .main-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        z-index: 59;
        width: min(320px, 84vw);
        background: var(--surface-solid);
        border-inline-start: 1px solid var(--border);
        box-shadow: none;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: calc(var(--header-h) + 14px) 22px 26px;
        transform: translateX(100%);
        transition: transform .32s cubic-bezier(.22,.8,.3,1);
        overflow-y: auto;
    }

    .main-nav.open { transform: translateX(0); }

    .main-nav > a:not(.btn) {
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .main-nav > a:not(.btn)::after { display: none; }
    .main-nav > a:not(.btn).active,
    .main-nav > a:not(.btn):hover { background: var(--grad-soft); color: var(--text); }

    .main-nav .nav-cta-group { flex-direction: column; margin-top: 8px; }
    .main-nav .nav-cta-group .btn { width: 100%; }
    .nav-user { justify-content: center; }

    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 34px 24px; }
    .cta-band { padding: 40px 24px; }
    .hero { padding: 60px 18px 40px; }
    .footer-inner { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
    .book-cover-lg { width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   QrCode — Sections A/B/C
   site grain · nav user · avatars · breadcrumbs · cards
   ============================================================ */

/* ---------- Site grain overlay ---------- */
.site-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    background: none;
}

.site-grain-text {
    position: fixed;
    bottom: 18px;
    left: 18px;
    font-size: 10px;
    color: var(--muted);
    opacity: .4;
    pointer-events: none;
    z-index: 9998;
    letter-spacing: .04em;
}

/* ---------- Nav divider & user ---------- */
.nav-divider {
    display: inline-block;
    width: 1px;
    height: 26px;
    background: var(--border);
    margin: 0 14px;
    flex-shrink: 0;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.nav-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-avatar {
    width: 28px;
    height: 28px;
}

/* ---------- Avatar ring ---------- */
.avatar-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--border);
    padding: 2px;
    flex-shrink: 0;
}

.avatar-ring-sm {
    width: 28px;
    height: 28px;
    padding: 1.5px;
}

.avatar-ring-sm .avatar-inner-sm {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text);
}

.avatar-ring-sm .avatar-inner-sm svg {
    width: 60%;
    height: 60%;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

.avatar-inner svg {
    width: 55%;
    height: 55%;
}

.avatar-badge {
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--surface-solid);
}

/* ---------- Small logo variants ---------- */
.logo-mark-sm {
    width: 22px;
    height: 22px;
}

.logo-text-sm {
    font-size: 14px;
}

/* ---------- Card hover ---------- */
.card-hover {
    transition: border-color .15s ease;
}
.card-hover:hover {
    border-color: var(--border-strong);
}

/* ---------- Hero badge icon ---------- */
.hero-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}
.breadcrumb a:hover {
    color: var(--text);
}

.breadcrumb-sep {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    opacity: .5;
}
.breadcrumb-sep svg {
    width: 14px;
    height: 14px;
}

.breadcrumb-active {
    color: var(--text);
    font-weight: 600;
}

/* ============================================================
   QrCode — Sections D/E/F
   auth pages · forms · book detail
   ============================================================ */

/* ---------- Auth shell ---------- */
.auth-section {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: var(--bg);
}

.auth-box {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    padding: 40px 36px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
}

.auth-box .section-title {
    text-align: center;
    font-size: 1.45rem;
    margin-bottom: 26px;
}

.auth-box .btn-block { width: 100%; margin-top: 6px; }

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 36px;
    background: var(--text);
    color: var(--bg);
    text-align: center;
    gap: 24px;
}

.auth-visual-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: var(--radius);
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
}

.auth-visual-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.4;
}

.auth-visual-sub {
    font-size: 14px;
    opacity: .85;
    line-height: 1.7;
    max-width: 280px;
}

.auth-points {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 280px;
}

.auth-point {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: var(--radius);
    padding: 10px 14px;
    opacity: .9;
}

.auth-point-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid currentColor;
    flex-shrink: 0;
}
.auth-point-icon svg {
    width: 16px;
    height: 16px;
}

/* ---------- Auth form card ---------- */
.auth-form-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 40px;
    background: var(--surface-solid);
}

.auth-card-header {
    margin-bottom: 28px;
}

.auth-form-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-form-sub {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form-footer {
    margin-top: 24px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.auth-form-footer a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}
.auth-form-footer a:hover {
    text-decoration: underline;
}

.auth-switch {
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.auth-switch a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Form pieces ---------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
}

/* ============================================================
   QrCode — Sections G/H/I
   book detail · reviews · similar books
   ============================================================ */

/* ---------- Book detail ---------- */
.book-detail {
    padding: 36px 0 64px;
}

.book-detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.book-cover-lg {
    position: relative;
    width: 260px;
    flex-shrink: 0;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.book-cover-frame-lg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: var(--surface-2);
}

.book-cover-frame-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.4;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.book-desc {
    font-size: 15px;
    line-height: 1.9;
    color: var(--muted);
}

.book-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.book-actions-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    transition: background .15s, border-color .15s, opacity .15s;
}
.book-actions-btn:hover {
    opacity: .88;
}

/* ---------- Review scores ---------- */
.review-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.review-scores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.score-row .score-name {
    width: 100px;
    color: var(--muted);
    flex-shrink: 0;
}

.score-row .score-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-soft);
    border-radius: 999px;
    overflow: hidden;
}

.score-row .score-bar-fill {
    height: 100%;
    background: var(--text);
    border-radius: 0;
    transition: width .6s ease;
}

.score-row .score-val {
    width: 32px;
    text-align: left;
    font-weight: 700;
    color: var(--text);
    direction: ltr;
}

/* ---------- Review item head (detail page) ---------- */
.review-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.review-who {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.review-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.review-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.review-date {
    font-size: 12px;
    color: var(--muted);
}

.review-comment {
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted);
}

.review-textarea {
    min-height: 120px;
    resize: vertical;
}

.review-submit {
    align-self: flex-start;
    padding: 11px 28px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bg);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: opacity .15s;
}
.review-submit:hover {
    opacity: .88;
}

/* ---------- Rating input (stars) ---------- */
.rating-input {
    display: flex;
    gap: 4px;
    direction: ltr;
}
.rating-input input {
    display: none;
}
.rating-input label {
    cursor: pointer;
    font-size: 22px;
    color: var(--border-strong);
    transition: color .15s, transform .15s;
}
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: var(--stars);
    transform: scale(1.1);
}
.rating-input input:checked ~ label {
    color: var(--stars);
}

/* ---------- Similar books ---------- */
.similar-books {
    margin-top: 48px;
}

.similar-book {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
}
.similar-book:hover {
    border-color: var(--border-strong);
}

.similar-book-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}

/* ============================================================
   QrCode — Sections J/K/L
   admin · empty states · alerts · misc
   ============================================================ */

/* ---------- Admin stat card ---------- */
.admin-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: none;
}

.admin-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    margin-bottom: 4px;
}
.admin-stat-icon svg {
    width: 22px;
    height: 22px;
}

.admin-stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    direction: ltr;
    text-align: right;
}

.admin-stat-label {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Admin links ---------- */
.admin-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.admin-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: border-color .15s, background .15s;
}
.admin-links a:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

/* ---------- Empty state (page-level) ---------- */
.empty-state-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    gap: 16px;
    min-height: 50vh;
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    margin-bottom: 8px;
}
.empty-state-icon svg {
    width: 36px;
    height: 36px;
}

.empty-state-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.empty-state-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 420px;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---------- Alert icon ---------- */
.alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.alert-icon svg {
    width: 100%;
    height: 100%;
}

/* ---------- To-top icon ---------- */
.to-top-icon {
    width: 20px;
    height: 20px;
}

/* ---------- Lets Icons pack (Free Icon Pack 1800+ / CC BY 4.0) ---------- */
.nav-ico {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: .85;
}

.main-nav > a:not(.btn) {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.main-nav > a:not(.btn).active .nav-ico { opacity: 1; }

.rating-star {
    width: 1.15em;
    height: 1.15em;
    color: var(--stars);
    vertical-align: -0.18em;
    flex-shrink: 0;
}

.score-badge .stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    direction: ltr;
}

.score-badge .star-ico {
    width: 1.05em;
    height: 1.05em;
    color: var(--stars);
}

.star-input label .star-ui {
    width: 38px;
    height: 38px;
    color: inherit;
    fill: currentColor;
    pointer-events: none;
}

.inline-thanks {
    display: inline-flex;
    vertical-align: -0.22em;
    color: var(--text);
}

.inline-thanks svg {
    width: 1.2em;
    height: 1.2em;
}

.team-avatar-cell svg {
    width: 22px;
    height: 22px;
    color: var(--text);
    vertical-align: -5px;
}

.avatar-ring-sm svg {
    width: 16px;
    height: 16px;
}

.book-cover-placeholder svg { width: 64px; height: 64px; opacity: .8; }

.empty-state .empty-icon svg { width: 34px; height: 34px; }

.admin-stat-icon svg { width: 22px; height: 22px; }

.alert-icon svg { width: 100%; height: 100%; }

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   QrCode — Sections M/N/O
   responsive · reduced motion · print
   ============================================================ */

@media (max-width: 860px) {
    .auth-box {
        padding: 34px 24px;
    }
    .auth-visual {
        display: none;
    }
    .auth-form-card {
        padding: 36px 28px;
    }
    .book-detail-grid {
        grid-template-columns: 1fr;
    }
    .book-cover-lg {
        max-width: 260px;
        margin: 0 auto;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .nav-divider {
        display: none;
    }
    .nav-user {
        display: none;
    }
}

@media (max-width: 640px) {
    .book-title {
        font-size: 20px;
    }
    .auth-form-title {
        font-size: 18px;
    }
    .admin-stat-value {
        font-size: 24px;
    }
    .empty-state-page {
        padding: 48px 16px;
    }
    .breadcrumb {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .card-hover:hover,
    .similar-book:hover,
    .book-actions-btn:hover,
    .review-submit:hover,
    .admin-links a:hover {
        transform: none;
    }
}

@media print {
    .site-header,
    .site-grain,
    .to-top,
    .theme-toggle,
    .nav-toggle,
    .admin-links,
    .book-actions {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
}

/* ============================================================
   QrCode — flash · nav avatar · team · review counter · why rows
   ============================================================ */

.flash-wrap { padding-top: 16px; }

.nav-user .avatar-ring { margin: 0; }
.nav-user .avatar-ring > svg {
    width: 15px;
    height: 15px;
    color: var(--text);
}
.nav-user-name { line-height: 1.4; }

.team-card .avatar-ring {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    padding: 3px;
    box-shadow: none;
}
.team-card .avatar-inner {
    font-size: 34px;
    line-height: 1;
}

.char-counter {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 6px;
}
.char-counter.is-ok { color: var(--success); font-weight: 700; }
.char-counter.is-bad { color: var(--danger); }

.why-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    margin-bottom: 14px;
    background: var(--surface-2);
}
.why-row .form-group { margin-bottom: 0; }
.why-row .btn { margin-bottom: 2px; }

.team-avatar-cell { font-size: 1.4rem; }

@media (max-width: 700px) {
    .why-row { grid-template-columns: 1fr; }
    .why-row .btn { justify-self: start; }
}

/* ============================================================
   QrCode - Status badges - role badges - notices - activity
   ============================================================ */

.status-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.6;
}

.status-pending {
    background: rgba(180, 83, 9, .1);
    color: var(--stars);
    border: 1px solid transparent;
}

.status-approved {
    background: rgba(22, 101, 52, .1);
    color: var(--success);
    border: 1px solid transparent;
}

.status-rejected {
    background: rgba(153, 27, 27, .1);
    color: var(--danger);
    border: 1px solid transparent;
}

html[data-theme="dark"] .status-pending { color: #fbbf24; }
html[data-theme="dark"] .status-approved { color: #34d399; }
html[data-theme="dark"] .status-rejected { color: #f87171; }

.role-badge {
    display: inline-flex;
    align-items: center;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.role-owner { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.role-admin { background: rgba(159, 18, 57, .08); color: var(--primary-ink); border: 1px solid transparent; }
.role-student { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

html[data-theme="dark"] .role-admin { color: #22d3ee; }

.notice-box {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 12px 16px;
    font-size: .9rem;
    line-height: 1.9;
    background: var(--surface-2);
    color: var(--muted);
}

.notice-pending {
    background: rgba(180, 83, 9, .06);
    border-color: rgba(180, 83, 9, .25);
    color: var(--text);
}

.notice-approved {
    background: rgba(22, 101, 52, .06);
    border-color: rgba(22, 101, 52, .25);
    color: var(--text);
}

.notice-rejected {
    background: rgba(153, 27, 27, .05);
    border-color: rgba(153, 27, 27, .25);
    color: var(--text);
}

.reason-box {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, .08);
    border: 1px dashed rgba(239, 68, 68, .4);
    border-radius: 10px;
    color: var(--text);
    font-size: .88rem;
}

.reason-box strong { color: var(--danger); }

.reject-reason-group {
    flex: 1 1 100%;
    margin-top: 4px;
}

.reject-reason-group label {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.reject-reason-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-solid);
    color: var(--text);
    font-family: var(--font-main);
    font-size: .88rem;
    resize: vertical;
}

.reject-reason-group textarea:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

.moderate-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 100%;
}

.review-del { margin-inline-start: auto; }

.role-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.role-select {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-solid);
    color: var(--text);
    font-family: var(--font-main);
    font-size: .85rem;
}

.role-select:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

.activity-table { min-width: 720px; }
.activity-time { white-space: nowrap; font-size: .84rem; color: var(--muted); direction: ltr; text-align: right; }
.activity-detail { font-size: .86rem; max-width: 340px; word-break: break-word; }
