/* =============================================
   书语阅读 — Modern Book-themed Design System
   ============================================= */

/* ===== Design System ===== */
:root {
    /* Warm book-inspired palette */
    --primary: #8B4513;
    --primary-light: #A0522D;
    --primary-dark: #5C2E0A;
    --secondary: #C9A96E;
    --secondary-light: #E0C992;
    --accent: #D4A574;
    --gold: #D4A017;
    --gold-light: #F0D78C;
    --success: #5B8C5A;
    --info: #6B8FA3;
    --star: #E8A317;

    /* Backgrounds */
    --bg: #F5F0EB;
    --bg-card: #FFFFFF;
    --bg-warm: #FAF6F0;
    --bg-nav: #3C2415;
    --bg-footer: #2C1810;

    /* Text */
    --text: #3C2415;
    --text-secondary: #6B5344;
    --text-muted: #9C8B7B;
    --text-light: #B8A89A;
    --text-on-dark: #F5F0EB;

    /* Borders & dividers */
    --border: #E8DDD0;
    --border-light: #F0EBE3;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(60, 36, 21, 0.06);
    --shadow-md: 0 4px 16px rgba(60, 36, 21, 0.08);
    --shadow-lg: 0 8px 32px rgba(60, 36, 21, 0.1);
    --shadow-xl: 0 16px 48px rgba(60, 36, 21, 0.12);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-serif: 'Noto Serif SC', 'Songti SC', serif;
    --font-sans: 'Source Sans Pro', 'Microsoft YaHei', -apple-system, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--text);
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-light);
}

ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, textarea, button {
    font-family: var(--font-sans);
    font-size: inherit;
    outline: none;
    border: none;
}

/* ===== Show/Hide Helpers ===== */
.pcs { display: block; }
.ms { display: none; }

/* ===== Container (Fixed Width) ===== */
.con {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header (PC) ===== */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: auto;
    padding: 18px 0;
}
.header .con {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    flex-shrink: 0;
}
.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-size: 30px;
    font-weight: 700;
    font-family: var(--font-serif);
}
.logo-link i {
    font-size: 28px;
    color: var(--secondary);
}
.logo-name {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
}
.logo-link:hover .logo-name {
    color: var(--primary-light);
}
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.logo-domain {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
}
.logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.header-search {
    flex: 1;
    max-width: 480px;
}
.search-form {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-warm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-form:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}
.search-iw {
    flex: 1;
    padding: 0 16px;
}
.search-input {
    width: 100%;
    line-height: 42px;
    height: 42px;
    font-size: 15px;
    color: var(--text);
    background: transparent;
    border: none;
}
.search-input::placeholder {
    color: var(--text-muted);
}
.search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 24px;
    height: 42px;
    font-weight: 600;
    font-size: 15px;
    color: var(--bg-card);
    background: var(--primary);
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    border-radius: 0 50px 50px 0;
}
.search-btn:hover {
    background: var(--primary-dark);
}
.search-btn i {
    font-size: 14px;
}

/* ===== Navigation (PC) ===== */
.nav {
    background: var(--bg-nav);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.nav-list {
    display: flex;
    align-items: center;
    height: 48px;
    gap: 0;
}
.nav-list li {
    height: 100%;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 20px;
    color: var(--text-on-dark);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: background var(--transition), color var(--transition);
}
.nav-item i {
    font-size: 14px;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--secondary-light);
}
.nav-item.active {
    color: var(--secondary);
    background: rgba(255, 255, 255, 0.06);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px 3px 0 0;
}

/* ===== Mobile Header & Nav ===== */
.header-m {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.header-m .con {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-m .logo-link {
    font-size: 20px;
}
.header-m .logo-name {
    font-size: 20px;
}
.header-m .logo-img {
    height: 36px;
}
.header-m .logo-text .logo-name {
    font-size: 18px;
}
.header-m .logo-domain {
    font-size: 10px;
}

/* Hamburger button */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all var(--transition);
}
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.search-box-m {
    display: none;
    padding: 8px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.search-box-m .search-form {
    border-radius: 50px;
    border-color: var(--border);
}
.search-box-m .search-iw {
    padding: 0 12px;
}
.search-box-m .search-input {
    line-height: 38px;
    height: 38px;
    font-size: 14px;
}
.search-btn-m {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 38px;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    border: none;
    border-left: 1px solid var(--border);
    font-size: 16px;
}

.nav-m {
    display: none;
    background: var(--bg-card);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    border-bottom: 1px solid var(--border);
}
.nav-m.show {
    max-height: 200px;
}
.nav-m-list {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 0;
}
.nav-m-list li {
    width: 50%;
}
.nav-m-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.nav-m-item i {
    width: 18px;
    text-align: center;
    color: var(--primary-light);
}
.nav-m-item:hover {
    background: var(--bg-warm);
}
.nav-m-item.active {
    color: var(--primary);
    background: var(--bg-warm);
    font-weight: 600;
}

/* ===== Two-Column Layout ===== */
.main {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.main .conL {
    flex: 1;
    min-width: 0;
}
.main .conR {
    width: 300px;
    flex-shrink: 0;
}

/* ===== Section Header ===== */
.section-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 14px;
}
.section-header .con {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 14px;
}
.section-header .con::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}
.section-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i {
    color: var(--secondary);
    font-size: 20px;
}
.section-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== Box Containers (Cards) ===== */
.boxI {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}
.boxI .tit,
.boxB .tit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-warm);
}
.boxI .tit i {
    font-size: 16px;
}
.boxB {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.tit-more {
    margin-left: auto;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition);
}
.tit-more i {
    font-size: 11px;
}
.tit-more:hover {
    color: var(--primary-light);
}

/* ===== PicList (Featured Books) ===== */
.picList ul {
    padding: 0;
    margin: 0;
}
.picList li {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.picList li:last-child {
    border-bottom: none;
}
.picList li:hover {
    background: var(--bg-warm);
}
.picList .picb {
    width: 100px;
    flex-shrink: 0;
}
.picList .pic {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 140%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(60, 36, 21, 0.12);
    transition: transform var(--transition), box-shadow var(--transition);
}
.picList .pic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(60, 36, 21, 0.15);
}
.picList .pic img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pic-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    background: var(--secondary);
    color: var(--bg-card);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.picList .txtb {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}
.picList .txtb .txt {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.picList .txtb .name {
    font-size: 16px;
    font-weight: 600;
}
.picList .txtb .name a {
    color: var(--text);
}
.picList .txtb .name a:hover {
    color: var(--primary-light);
}
.picList .txtb .author {
    font-size: 13px;
    color: var(--text-muted);
}
.picList .intro {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 42px;
}

/* ===== Sidebar List ===== */
.list ul {
    padding: 4px 0;
}
.list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.list li:last-child {
    border-bottom: none;
}
.list li:hover {
    background: var(--bg-warm);
}
.list li .txt {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.list li .name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: color var(--transition);
}
.list li .name:hover {
    color: var(--primary-light);
}
.list li .author {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ===== Ranking Numbers ===== */
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-warm);
    border-radius: 50%;
}
.rank-top {
    background: var(--secondary);
    color: var(--bg-card);
}
.rank-light {
    background: transparent;
    color: var(--text-light);
    font-size: 11px;
}

/* ===== List2 (Latest Updates) ===== */
.list2 ul {
    padding: 4px 0;
}
.list2 li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.list2 li:last-child {
    border-bottom: none;
}
.list2 li:hover {
    background: var(--bg-warm);
}
.list2 li .cate {
    flex-shrink: 0;
    padding: 1px 8px;
    font-size: 12px;
    color: var(--bg-card);
    background: var(--primary-light);
    border-radius: 10px;
}
.list2 li .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.list2 li .name a {
    font-weight: 500;
    color: var(--text);
}
.list2 li .name a:hover {
    color: var(--primary-light);
}
.list2 li .chapter {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--text-muted);
}
.list2 li .chapter a {
    color: var(--text-muted);
}
.list2 li .chapter a:hover {
    color: var(--primary-light);
}
.list2 li .author {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.list2 li .date {
    flex-shrink: 0;
    width: 50px;
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
}

/* ===== Two-Column Category Layout ===== */
.main3 {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px;
}
.main3 .conL,
.main3 .conR {
    width: calc(33% - 9px);
    flex: 0 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.main3 .tit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-warm);
}
.main3 .picList ul {
    padding: 0;
}
.main3 .picList li {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}
.main3 .picList li:last-child {
    border-bottom: none;
}
.main3 .picList .picb {
    width: 80px;
    flex-shrink: 0;
}
.main3 .picList .pic {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 140%;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(60, 36, 21, 0.1);
}
.main3 .picList .pic img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.main3 .picList .txtb {
    flex: 1;
    min-width: 0;
    padding: 2px 0;
}
.main3 .picList .txtb .txt {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.main3 .picList .txtb .name {
    font-size: 14px;
    font-weight: 600;
}
.main3 .picList .txtb .name a {
    color: var(--text);
}
.main3 .picList .txtb .name a:hover {
    color: var(--primary-light);
}
.main3 .picList .txtb .author {
    font-size: 12px;
    color: var(--text-muted);
}
.main3 .picList .intro {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.main3 .list ul {
    padding: 2px 0;
}
.main3 .list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    transition: background var(--transition);
}
.main3 .list li:last-child {
    border-bottom: none;
}
.main3 .list li:hover {
    background: var(--bg-warm);
}
.main3 .list li .txt {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.main3 .list li .name a {
    color: var(--text);
    font-weight: 500;
}
.main3 .list li .name a:hover {
    color: var(--primary-light);
}
.main3 .list li .author {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.view-all a {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition);
}
.view-all a:hover {
    color: var(--primary-light);
}
.view-all a i {
    font-size: 11px;
}

/* ===== Tags ===== */
.tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-light);
    background: rgba(160, 82, 45, 0.08);
    border-radius: 20px;
    white-space: nowrap;
}
.tag-sm {
    padding: 2px 8px;
    font-size: 11px;
}
.tag-finish {
    background: rgba(91, 140, 90, 0.12);
    color: var(--success);
}
.tag-serial {
    background: rgba(107, 143, 163, 0.12);
    color: var(--info);
}
.tag-halt {
    background: rgba(156, 139, 123, 0.12);
    color: var(--text-muted);
}
.tag-status {
    font-weight: 600;
}
.txt-tags {
    border-bottom: none !important;
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bg-card);
    background: var(--primary);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--bg-card);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}
.btn-blue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-card);
    background: var(--primary);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}
.btn-blue:hover {
    background: var(--primary-dark);
    color: var(--bg-card);
    transform: translateY(-1px);
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: var(--bg-warm);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
}
.page-info {
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== Detail Page ===== */
.detail-wrap {
    padding: 24px;
}
.detail-header {
    display: flex;
    gap: 28px;
}
.detail-cover {
    width: 200px;
    flex-shrink: 0;
}
.detail-cover .picb {
    width: 100%;
}
.detail-cover .pic {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 145%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(60, 36, 21, 0.15);
}
.detail-cover .pic img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.detail-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.detail-meta {
    display: flex;
    gap: 16px;
    font-size: 15px;
    color: var(--text-secondary);
}
.detail-meta i {
    margin-right: 4px;
    color: var(--text-muted);
}
.detail-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-rating i {
    color: var(--star);
    font-size: 16px;
    transition: transform 0.15s, color 0.15s;
}
.detail-rating .stars-display i:hover {
    transform: scale(1.2);
}
.detail-rating .far.fa-star {
    color: var(--border);
}
.rating-score {
    font-size: 15px;
    font-weight: 600;
    color: var(--star);
    margin-left: 4px;
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.detail-stats {
    display: flex;
    gap: 32px;
    padding: 12px 0;
}
.stat-item {
    text-align: center;
}
.stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

/* Favorite button */
.btn-fav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-fav:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fef2f2;
    transform: translateY(-1px);
}
.btn-fav.is-favorited {
    color: #fff;
    background: #e74c3c;
    border-color: #e74c3c;
}
.btn-fav.is-favorited:hover {
    background: #c0392b;
    border-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}
.btn-fav:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-fav i {
    font-size: 14px;
}

/* Interactive rating stars hover hint */
.my-rating-hint {
    font-size: 12px;
    color: var(--star);
    font-weight: 500;
    margin-left: 2px;
}

.detail-desc {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    line-height: 1.9;
}
.detail-section-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-section-title i {
    color: var(--secondary);
    font-size: 16px;
}
.detail-desc p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.9;
}

.detail-chapters {
    margin-top: 24px;
}
.chapter-count {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}
.chapter-grid {
    display: grid;
    gap: 6px;
}
.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    text-decoration: none;
}
.chapter-item:hover {
    background: var(--bg-card);
    border-color: var(--secondary);
    transform: translateX(4px);
}
.chapter-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.chapter-date {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ===== Article Page ===== */
.article-box {
    padding: 0;
}
.article-content {
    padding: 32px 36px;
}
.article-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}
.article-meta i {
    margin-right: 4px;
    color: var(--text-light);
}
.article-body {
    line-height: 2;
    font-size: 16px;
    color: var(--text);
}
.article-body p {
    margin-bottom: 20px;
    text-indent: 2em;
}

/* ===== Empty State ===== */
.empty-state-content {
    text-align: center;
    padding: 60px 24px;
}
.empty-state-content i {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
}
.empty-state-content h2,
.empty-state-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== 404 Error Page ===== */
.error-page-wrap {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.error-content {
    text-align: center;
    padding: 40px 24px;
}
.error-code {
    font-size: 120px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-family: var(--font-serif);
}
.error-title {
    font-family: var(--font-serif);
    font-size: 24px;
    color: var(--text);
    margin-bottom: 12px;
}
.error-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 28px;
}
.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Ranking Tabs ===== */
.ranking-tabs {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.ranking-tabs .con {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ranking-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}
.ranking-tabs .tab-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}
.ranking-tabs .tab-btn.active {
    background: var(--primary);
    color: var(--bg-card);
    border-color: var(--primary);
}
.ranking-tabs .tab-btn i {
    font-size: 13px;
}

/* ===== Reader Page ===== */
:root {
    --rd-bg: #FAF6F0;
    --rd-surface: #FFFFFF;
    --rd-text: #3C2415;
    --rd-text-muted: #9C8B7B;
    --rd-shadow: rgba(60, 36, 21, 0.08);
}
body.reader-active {
    background-color: var(--rd-bg);
}

.reader-settings {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--rd-surface);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    min-width: 210px;
    border: 1px solid var(--border);
}
.reader-settings.show { display: block; }
.reader-settings .setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--rd-text);
}
.reader-settings .setting-item:last-child { margin-bottom: 0; }
.reader-settings .setting-item span {
    min-width: 48px;
    flex-shrink: 0;
    font-weight: 500;
    font-size: 14px;
}
.font-size-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--rd-surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--rd-text);
    transition: all var(--transition);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.font-size-btn:hover {
    border-color: var(--secondary);
}
.font-size-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.theme-btn {
    padding: 0 14px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--rd-surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--rd-text);
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.theme-btn:hover {
    border-color: var(--secondary);
}
.theme-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.setting-close {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.reader-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 20px;
}
.reader-header {
    background: var(--rd-surface);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 2px 12px var(--rd-shadow);
}
.reader-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.reader-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--rd-text);
    line-height: 1.4;
    flex: 1;
}
.reader-toggle-btn {
    flex-shrink: 0;
}
.reader-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--rd-text-muted);
    margin-top: 10px;
}
.reader-meta a {
    color: var(--primary-light);
}
.reader-meta i {
    margin-right: 4px;
}

.reader-content {
    background: var(--rd-surface);
    padding: 40px 36px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px var(--rd-shadow);
    line-height: 2;
    font-size: 18px;
    text-indent: 2em;
    color: var(--rd-text);
    min-height: 400px;
}
.reader-content p {
    margin-bottom: 24px;
}

.reader-navigation {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.reader-navigation a,
.reader-navigation button {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
    min-width: 120px;
    font-size: 14px;
}
.reader-navigation .btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--bg-card);
}
.reader-navigation .btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}
.reader-navigation .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}
.reader-navigation .btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}
.reader-navigation button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-footer);
    color: var(--text-light);
    padding: 32px 0;
    margin-top: 40px;
}
.footer-links {
    font-size: 14px;
    line-height: 2;
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--text-light);
}
.footer-links a:hover {
    color: var(--secondary);
}
.footer-sep {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.15);
}
.footer-copy {
    font-size: 13px;
    line-height: 1.8;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    color: rgba(255, 255, 255, 0.45);
}
.footer-m {
    display: none;
}
.btn-gotop {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--secondary);
    cursor: pointer;
}

/* ===== Floating scroll to top/bottom buttons ===== */
.scroll-btns {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.scroll-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}
.scroll-btn:hover {
    background: var(--primary);
    color: var(--bg-card);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.25);
}

/* =============================================
   RESPONSIVE: MOBILE (max-width: 828px)
   ============================================= */
@media only screen and (max-width: 828px) {
    .pcs { display: none !important; }
    .ms { display: block; }

    .con {
        padding: 0 12px;
    }

    /* Mobile header */
    .header-m { display: block; }
    .search-box-m { display: block; }
    .nav-m { display: block; }

    /* Main content */
    .main {
        display: block;
        padding: 12px;
        gap: 0;
    }
    .main .conL {
        width: 100%;
    }
    .main .conR {
        width: 100%;
        margin-top: 12px;
    }

    /* Section header on mobile */
    .section-header {
        padding: 18px 12px 10px;
    }
    .section-title {
        font-size: 18px;
    }
    .section-header .con::after {
        width: 48px;
        height: 2px;
    }
    .section-desc {
        font-size: 13px;
    }

    /* Cards on mobile */
    .boxI {
        border-radius: var(--radius-sm);
        margin-bottom: 12px;
        box-shadow: none;
        border: 1px solid var(--border);
    }
    .boxI .tit,
    .boxB .tit {
        padding: 12px 14px;
        font-size: 15px;
    }
    .boxB {
        border-radius: var(--radius-sm);
        margin-bottom: 12px;
        box-shadow: none;
        border: 1px solid var(--border);
    }

    /* PicList on mobile */
    .picList li {
        padding: 12px 14px;
    }
    .picList .picb {
        width: 80px;
    }

    /* List on mobile */
    .list li {
        padding: 10px 14px;
    }

    /* List2 on mobile */
    .list2 li {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 14px;
    }
    .list2 li .cate {
        order: 1;
    }
    .list2 li .name {
        order: 2;
        width: auto;
    }
    .list2 li .chapter {
        order: 3;
        width: 100%;
        padding-left: 28px;
        font-size: 12px;
    }
    .list2 li .author {
        order: 4;
        width: auto;
    }
    .list2 li .date {
        order: 5;
    }

    /* Three-column → single on mobile */
    .main3 {
        display: block;
        padding: 0 12px 12px;
    }
    .main3 .conL,
    .main3 .conR {
        width: 100%;
        margin: 0 0 12px 0;
    }

    .main3 .list li {
        padding: 10px 14px;
    }

    /* Detail page on mobile */
    .detail-wrap {
        padding: 16px;
    }
    .detail-header {
        flex-direction: column;
        gap: 16px;
    }
    .detail-cover {
        width: 140px;
        margin: 0 auto;
    }
    .detail-title {
        font-size: 22px;
    }
    .detail-stats {
        gap: 24px;
    }
    .stat-num {
        font-size: 18px;
    }

    /* Article on mobile */
    .article-content {
        padding: 20px 16px;
    }
    .article-title {
        font-size: 20px;
    }

    /* Reader on mobile */
    .reader-container {
        padding: 12px;
    }
    .reader-content {
        padding: 24px 16px;
        font-size: 16px;
    }
    .reader-header {
        padding: 14px 16px;
    }
    .reader-title {
        font-size: 17px;
    }
    .reader-settings {
        right: 12px;
        left: 12px;
        top: 60px;
        min-width: auto;
    }

    /* Ranking tabs mobile */
    .ranking-tabs {
        padding: 10px 0;
    }
    .ranking-tabs .tab-btn {
        font-size: 13px;
        padding: 6px 14px;
    }

    /* 404 mobile */
    .error-code {
        font-size: 80px;
    }

    /* Footer mobile */
    body {
        padding-bottom: 64px;
    }
    .footer {
        display: none;
    }
    .footer-m {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: 56px;
        box-shadow: 0 -2px 8px rgba(60, 36, 21, 0.06);
    }
    .footer-m a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        flex: 1;
        color: var(--text-muted);
        font-size: 11px;
        text-decoration: none;
        padding: 4px 0;
        transition: color var(--transition);
        position: relative;
    }
    .footer-m a:hover,
    .footer-m a:active {
        color: var(--primary-light);
    }
    .footer-m a i {
        font-size: 20px;
    }
    .footer-m a span {
        display: block;
        line-height: 1;
    }

    /* Pagination mobile */
    .pagination {
        padding: 14px;
    }

    /* Empty state mobile */
    .empty-state-content {
        padding: 40px 16px;
    }
    .empty-state-content i {
        font-size: 36px;
    }

    /* Scroll buttons mobile */
    .scroll-btns {
        right: 12px;
        bottom: 76px;
    }
    .scroll-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    /* Mobile button sizes */
    .btn-primary {
        padding: 8px 20px;
        font-size: 14px;
    }
    .btn-outline {
        padding: 6px 16px;
        font-size: 13px;
    }
    .reader-navigation a,
    .reader-navigation button {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 80px;
    }
}

/* =============================================
   RESPONSIVE: SMALL MOBILE (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
    .picList .picb {
        width: 70px;
    }
    .picList li {
        gap: 10px;
        padding: 10px 12px;
    }
    .detail-cover {
        width: 120px;
    }
    .reader-content {
        padding: 20px 12px;
        font-size: 15px;
    }

    /* Scroll buttons small mobile */
    .scroll-btns {
        right: 8px;
        bottom: 72px;
    }
    .scroll-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    /* Small mobile button sizes */
    .btn-primary {
        padding: 7px 16px;
        font-size: 13px;
    }
    .btn-outline {
        padding: 5px 14px;
        font-size: 12px;
    }
    .reader-navigation a,
    .reader-navigation button {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 70px;
    }
}

/* =============================================
   MEMBER / AUTH COMPONENTS
   ============================================= */

/* ===== Header Actions (PC) ===== */
.header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Auth links (not logged in) */
.header-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}
.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 50px;
    transition: all var(--transition);
}
.auth-link:hover {
    color: var(--primary);
    background: var(--bg-warm);
}
.auth-link i {
    font-size: 13px;
}
.auth-register {
    color: var(--bg-card);
    background: var(--primary);
}
.auth-register:hover {
    background: var(--primary-dark);
    color: var(--bg-card);
}

/* Member dropdown (logged in) */
.member-dropdown {
    position: relative;
}
.member-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    color: var(--text);
}
.member-trigger:hover {
    background: var(--bg-warm);
}
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-avatar i {
    font-size: 28px;
    color: var(--secondary);
}
.member-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dropdown-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.member-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 170px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 6px;
    display: none;
    z-index: 100;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}
.dropdown-menu a:hover {
    background: var(--bg-warm);
    color: var(--primary-light);
}
.dropdown-menu a i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.dropdown-menu a:hover i {
    color: var(--primary-light);
}
.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 8px;
}

/* Logout button in dropdown */
.logout-btn {
    color: var(--text-muted) !important;
}
.logout-btn:hover {
    color: #c0392b !important;
}
.logout-btn:hover i {
    color: #c0392b !important;
}

/* ===== Mobile Header Auth ===== */
.header-m-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.m-avatar-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.m-avatar-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
}
.m-avatar-icon {
    font-size: 28px;
    color: var(--secondary);
}
.m-login-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    padding: 4px 12px;
    border: 1px solid var(--primary);
    border-radius: 50px;
    text-decoration: none;
    transition: all var(--transition);
}
.m-login-link:hover {
    background: var(--primary);
    color: var(--bg-card);
}

/* Mobile nav divider */
.nav-m-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
    width: 100% !important;
}

/* ===== Auth Pages (Login/Register) ===== */
.auth-page-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-box {
    width: 100%;
    max-width: 420px;
}
.auth-box .boxI {
    margin-bottom: 0;
}
.auth-form-wrap {
    padding: 28px 32px;
}
.auth-form-wrap .form-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 6px;
}
.auth-form-wrap .form-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}
.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
    background: var(--bg-card);
}
.form-input::placeholder {
    color: var(--text-light);
}
.form-error {
    display: none;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 13px;
    line-height: 1.5;
}
.form-error.show {
    display: block;
}
.form-submit {
    width: 100%;
    height: 44px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bg-card);
    background: var(--primary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.form-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}
.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.form-submit .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: form-spin 0.6s linear infinite;
}
.form-submit.loading .spinner {
    display: inline-block;
}
.form-submit.loading .btn-text {
    opacity: 0.7;
}
@keyframes form-spin {
    to { transform: rotate(360deg); }
}
.form-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--text-muted);
}
.form-footer a {
    color: var(--primary);
    font-weight: 600;
}
.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Member Layout (Sidebar + Content) ===== */
.member-layout {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.member-sidebar {
    width: 220px;
    flex-shrink: 0;
}
.member-content {
    flex: 1;
    min-width: 0;
}
.member-nav-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.member-nav-box .tit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-warm);
}
.member-nav-box .tit i {
    color: var(--secondary);
    font-size: 15px;
}
.member-nav-list {
    padding: 6px;
}
.member-nav-list li {
    list-style: none;
}
.member-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}
.member-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.member-nav-item:hover {
    background: var(--bg-warm);
    color: var(--primary-light);
}
.member-nav-item:hover i {
    color: var(--primary-light);
}
.member-nav-item.active {
    background: var(--bg-warm);
    color: var(--primary);
    font-weight: 600;
}
.member-nav-item.active i {
    color: var(--primary);
}
.member-nav-logout {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

/* ===== Member Center Profile ===== */
.member-profile-card {
    display: flex;
    gap: 24px;
    padding: 24px;
    align-items: center;
}
.member-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-profile-avatar i {
    font-size: 64px;
    color: var(--secondary);
}
.member-profile-info {
    flex: 1;
    min-width: 0;
}
.member-profile-name {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.member-profile-username {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.member-profile-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 13px;
    color: var(--text-secondary);
}
.member-profile-detail i {
    width: 14px;
    margin-right: 4px;
    color: var(--text-muted);
}

/* Member stats grid */
.member-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 20px;
}
.member-stat-card {
    text-align: center;
    padding: 16px 8px;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.member-stat-card:hover {
    background: var(--bg);
}
.member-stat-icon {
    font-size: 24px;
    color: var(--secondary);
    margin-bottom: 6px;
}
.member-stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.member-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Member Settings ===== */
.settings-section {
    padding: 20px 24px;
}
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}
.settings-item:last-child {
    border-bottom: none;
}
.settings-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.settings-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.settings-control {
    flex-shrink: 0;
}

/* Font size selector */
.font-size-selector {
    display: flex;
    gap: 6px;
}
.font-size-option {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.font-size-option:hover {
    border-color: var(--secondary);
}
.font-size-option.active {
    background: var(--primary);
    color: var(--bg-card);
    border-color: var(--primary);
}

/* Theme selector */
.theme-selector {
    display: flex;
    gap: 8px;
}
.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
    min-width: 80px;
}
.theme-option:hover {
    border-color: var(--secondary);
}
.theme-option.active {
    border-color: var(--primary);
    background: var(--bg-warm);
}
.theme-option i {
    font-size: 20px;
}
.theme-option span {
    font-size: 12px;
    color: var(--text-secondary);
}
.theme-light i { color: #f39c12; }
.theme-warm i { color: #e67e22; }
.theme-dark i { color: #2c3e50; }

/* Color preset selector */
.color-presets {
    display: flex;
    gap: 8px;
}
.color-preset {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}
.color-preset:hover {
    transform: scale(1.15);
}
.color-preset.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

/* Save button row */
.settings-save-row {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: none;
    max-width: 360px;
    animation: toast-in 0.3s ease;
}
.toast.show {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast i {
    font-size: 16px;
}
.toast-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Member Favorites/History List ===== */
.member-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-warm);
}
.member-list-header .list-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.member-list-header .list-title i {
    color: var(--secondary);
    font-size: 16px;
}
.member-list-body {
    min-height: 200px;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
}
.loading-spinner i {
    font-size: 32px;
    color: var(--secondary);
    animation: spin 1s linear infinite;
}
.loading-spinner span {
    font-size: 14px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Remove favorite button */
.btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-remove:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fef2f2;
}

/* History clear button */
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-danger:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* History item time */
.history-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}
.history-chapter {
    font-size: 12px;
    color: var(--info);
    margin-top: 2px;
}

/* =============================================
   RESPONSIVE: MEMBER PAGES MOBILE
   ============================================= */
@media only screen and (max-width: 828px) {
    .member-layout {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }
    .member-sidebar {
        width: 100%;
    }
    .member-nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px;
    }
    .member-nav-item {
        font-size: 13px;
        padding: 8px 12px;
    }
    .member-profile-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }
    .member-profile-info {
        text-align: center;
    }
    .member-profile-detail {
        justify-content: center;
    }
    .member-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px 14px;
    }
    .member-stat-num {
        font-size: 20px;
    }
    .settings-section {
        padding: 14px 16px;
    }
    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .settings-control {
        width: 100%;
    }
    .font-size-selector {
        justify-content: flex-start;
    }
    .theme-selector {
        justify-content: flex-start;
    }
    .auth-box {
        max-width: 100%;
    }
    .auth-form-wrap {
        padding: 20px 18px;
    }
    .member-list-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .member-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .member-stat-card {
        padding: 12px 4px;
    }
    .member-stat-num {
        font-size: 18px;
    }
}
