/*
 * iOS Design System for Smart Library
 * 遵循iOS设计规范 - 圆角半径8pt、SF Pro字体、iOS原生色彩系统
 */

/* ========================================
   1. CSS Variables (iOS Design Tokens)
   ======================================== */
:root {
    --ios-blue: #007AFF;
    --ios-blue-light: rgba(0, 122, 255, 0.08);
    --ios-blue-medium: rgba(0, 122, 255, 0.15);
    --ios-red: #FF3B30;
    --ios-orange: #FF9500;
    --ios-yellow: #FFCC00;
    --ios-green: #34C759;
    --ios-teal: #5AC8FA;
    --ios-purple: #AF52DE;
    --ios-pink: #FF2D55;
    --ios-gray: #8E8E93;
    --ios-gray2: #AEAEB2;
    --ios-gray3: #C7C7CC;
    --ios-gray4: #D1D1D6;
    --ios-gray5: #E5E5EA;
    --ios-gray6: #F2F2F7;
    --ios-white: #FFFFFF;
    --ios-black: #1C1C1E;
    --ios-label: #1C1C1E;
    --ios-secondary-label: #3A3A3C;
    --ios-tertiary-label: #8E8E93;
    --ios-quaternary-label: #C7C7CC;
    --ios-separator: rgba(60, 60, 67, 0.12);
    --ios-separator-light: rgba(60, 60, 67, 0.06);
    --ios-fill: rgba(120, 120, 128, 0.08);
    --ios-fill-light: rgba(120, 120, 128, 0.04);
    --ios-background: #F2F2F7;
    --ios-card-background: #FFFFFF;
    --ios-grouped-background: #F2F2F7;
    --ios-navigation-bar: rgba(255, 255, 255, 0.92);
    --ios-tab-bar: rgba(255, 255, 255, 0.92);
    --ios-blur-dark: rgba(0, 0, 0, 0.8);

    --ios-corner-radius: 8pt;
    --ios-corner-radius-sm: 6pt;
    --ios-corner-radius-lg: 14pt;
    --ios-corner-radius-xl: 20pt;

    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    --ios-font-mono: "SF Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;

    --ios-ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ios-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ios-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ios-animation-duration: 0.3s;
}

/* ========================================
   2. Base Reset & Typography
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--ios-font), serif;
    background-color: var(--ios-background);
    color: var(--ios-label);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ========================================
   3. iOS Navigation Bar
   ======================================== */
.ios-nav {
    background: var(--ios-navigation-bar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
    border-bottom: 1px solid var(--ios-separator);
}

.ios-nav-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.ios-nav-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ios-label);
    flex: 1;
}

.ios-nav-title-small {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-label);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ios-nav-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ios-gray5);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    color: var(--ios-blue);
    flex-shrink: 0;
    transition: background var(--ios-animation-duration) var(--ios-ease-out);
    border: none;
    cursor: pointer;
}

.ios-nav-back:active {
    background: var(--ios-gray4);
    transform: scale(0.92);
}

/* iOS Large Title Style */
.ios-large-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ios-label);
    padding: 16px 16px 4px;
}

/* ========================================
   4. iOS User Status Bar
   ======================================== */
.ios-user-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 10px;
    border-bottom: 1px solid var(--ios-separator-light);
    margin-bottom: 10px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.ios-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ios-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ios-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.ios-avatar-small {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.ios-greeting {
    font-size: 15px;
    color: var(--ios-label);
    font-weight: 500;
}

.ios-greeting span {
    color: var(--ios-blue);
    font-weight: 600;
}

.ios-user-action {
    font-size: 14px;
    color: var(--ios-blue);
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    background: var(--ios-blue-light);
    border-radius: 8px;
    transition: background var(--ios-animation-duration) var(--ios-ease-out);
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.ios-user-action:active {
    background: var(--ios-blue-medium);
    transform: scale(0.95);
}

.ios-user-action-logout {
    font-size: 14px;
    color: var(--ios-gray);
    text-decoration: none;
    padding: 6px 8px;
    transition: opacity var(--ios-animation-duration) var(--ios-ease-out);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.ios-user-action-logout:active {
    opacity: 0.6;
}

/* ========================================
   5. iOS Search Bar
   ======================================== */
.ios-search {
    position: relative;
    margin-bottom: 4px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

.ios-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--ios-gray);
    pointer-events: none;
    z-index: 1;
}

.ios-search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    font-size: 17px;
    font-family: inherit;
    background: var(--ios-gray5);
    border: none;
    border-radius: 10px;
    color: var(--ios-label);
    outline: none;
    transition: all var(--ios-animation-duration) var(--ios-ease-out);
    -webkit-appearance: none;
    appearance: none;
}

.ios-search-input:focus {
    background: var(--ios-gray5);
    box-shadow: 0 0 0 2px var(--ios-blue);
}

.ios-search-input::placeholder {
    color: var(--ios-gray);
}

.ios-search-cancel {
    display: none;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ios-blue);
    font-size: 17px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    font-family: inherit;
}

.ios-search-input:focus ~ .ios-search-cancel,
.ios-search-cancel.show {
    display: block;
    animation: iosFadeIn 0.2s var(--ios-ease-out);
}

/* ========================================
   6. iOS Stats Bar
   ======================================== */
.ios-stats {
    display: flex;
    gap: 1px;
    background: var(--ios-gray5);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 16px 16px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ios-stat-item {
    flex: 1;
    background: var(--ios-white);
    padding: 14px 8px;
    text-align: center;
    transition: background var(--ios-animation-duration) var(--ios-ease-out);
    cursor: pointer;
}

.ios-stat-item:active {
    background: var(--ios-gray6);
}

.ios-stat-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.ios-stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--ios-blue);
    letter-spacing: -0.3px;
    display: block;
}

.ios-stat-label {
    font-size: 13px;
    color: var(--ios-gray);
    margin-top: 2px;
    font-weight: 400;
    display: block;
}

/* ========================================
   7. iOS Section Headers
   ======================================== */
.ios-section-header {
    padding: 20px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 720px;
    margin: 0 auto;
}

.ios-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ios-label);
    letter-spacing: -0.2px;
}

.ios-section-count {
    font-size: 15px;
    color: var(--ios-gray);
}

/* ========================================
   8. iOS Book Cards — Horizontal List Layout
   ======================================== */
.ios-books-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 12px 16px;
    max-width: 720px;
    margin: 0 auto;
    transition: opacity 0.2s ease;
}

.ios-book-card {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s var(--ios-spring), box-shadow 0.2s var(--ios-ease-out);
    cursor: pointer;
    animation: iosFadeInUp 0.4s var(--ios-ease-out) both;
    display: flex;
    flex-direction: row;
    min-height: 170px;
}

.ios-book-card:nth-child(1) { animation-delay: 0.05s; }
.ios-book-card:nth-child(2) { animation-delay: 0.1s; }
.ios-book-card:nth-child(3) { animation-delay: 0.15s; }
.ios-book-card:nth-child(4) { animation-delay: 0.2s; }
.ios-book-card:nth-child(5) { animation-delay: 0.25s; }
.ios-book-card:nth-child(6) { animation-delay: 0.3s; }
.ios-book-card:nth-child(7) { animation-delay: 0.35s; }
.ios-book-card:nth-child(8) { animation-delay: 0.4s; }

.ios-book-card:active {
    transform: scale(0.985);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ios-book-cover {
    width: 38%;
    min-width: 120px;
    max-width: 160px;
    background: var(--ios-gray5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.ios-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--ios-gray5);
    transition: opacity 0.3s ease;
}

.ios-book-cover-placeholder {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    font-size: 42px;
    color: var(--ios-gray3);
    background: var(--ios-gray5);
}

.ios-book-info {
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.ios-book-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--ios-blue);
    background: var(--ios-blue-light);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    letter-spacing: 0;
    align-self: flex-start;
}

.ios-book-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ios-label);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.ios-book-author {
    font-size: 14px;
    color: var(--ios-gray);
    margin-bottom: 6px;
    font-weight: 400;
}

.ios-book-desc {
    font-size: 13px;
    color: var(--ios-secondary-label);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
    min-height: 0;
}

.ios-book-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--ios-red);
    letter-spacing: -0.2px;
    display: none;
}

.ios-book-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ios-separator-light);
}

.ios-book-actions .ios-btn {
    padding: 8px 12px;
    font-size: 13px;
    flex: 1;
    border-radius: 8px;
}

/* ========================================
   9. iOS Pagination
   ======================================== */
.ios-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px 16px calc(100px + env(safe-area-inset-bottom, 0px));
    max-width: 720px;
    margin: 0 auto;
}

.ios-pagination-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s var(--ios-ease-out), opacity 0.15s var(--ios-ease-out);
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--ios-blue);
    color: white;
}

.ios-pagination-btn:active {
    transform: scale(0.95);
    opacity: 0.85;
}

.ios-pagination-btn-disabled {
    background: var(--ios-gray5);
    color: var(--ios-gray2);
    cursor: not-allowed;
    opacity: 0.5;
}

.ios-pagination-btn-disabled:active {
    transform: none;
    opacity: 0.5;
}

.ios-pagination-info {
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-label);
    letter-spacing: -0.2px;
    min-width: 80px;
    text-align: center;
}

/* ========================================
   10. iOS Buttons
   ======================================== */
.ios-btn {
    padding: 5px 3px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s var(--ios-ease-out), opacity 0.15s var(--ios-ease-out);
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ios-btn:active {
    transform: scale(0.95);
}

.ios-btn-primary {
    background: var(--ios-blue);
    color: white;
}

.ios-btn-primary:active {
    opacity: 0.85;
}

.ios-btn-secondary {
    background: var(--ios-gray6);
    color: var(--ios-blue);
}

.ios-btn-secondary:active {
    opacity: 0.7;
}

.ios-btn-danger {
    background: var(--ios-red);
    color: white;
}

.ios-btn-danger:active {
    opacity: 0.85;
}

.ios-btn-block {
    width: 100%;
    padding: 15px 0;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.ios-btn-block:active {
    transform: scale(0.97);
    opacity: 0.8;
}

.ios-btn-block.ios-btn-danger {
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.ios-btn:disabled {
    background: var(--ios-gray3);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

/* ========================================
   10. iOS Form Elements
   ======================================== */
.ios-form-group {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.ios-form-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    transition: background var(--ios-animation-duration) var(--ios-ease-out);
}

.ios-form-row + .ios-form-row {
    border-top: 1px solid var(--ios-separator-light);
}

.ios-form-row.has-error {
    background: #FFF5F5;
}

.ios-form-label {
    font-size: 16px;
    color: var(--ios-label);
    width: 70px;
    flex-shrink: 0;
    font-weight: 500;
}

.ios-form-input {
    flex: 1;
    font-size: 16px;
    color: var(--ios-label);
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    min-width: 0;
}

.ios-form-input::placeholder {
    color: var(--ios-gray3);
}

.ios-form-input:focus::placeholder {
    color: transparent;
}

.ios-form-textarea {
    width: 100%;
    font-size: 16px;
    color: var(--ios-label);
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    padding: 14px 16px;
    line-height: 1.5;
}

.ios-form-textarea::placeholder {
    color: var(--ios-gray3);
}

.ios-form-select {
    flex: 1;
    font-size: 16px;
    color: var(--ios-label);
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    padding: 4px 0;
    cursor: pointer;
}

.ios-form-select-wrapper {
    flex: 1;
    position: relative;
}

.ios-form-select-wrapper::after {
    content: '›';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 18px;
    color: var(--ios-gray);
    font-weight: 600;
}

/* Form Error */
.ios-form-error {
    font-size: 12px;
    color: var(--ios-red);
    padding: 8px 16px;
    background: #FFF5F5;
    border-top: 1px solid var(--ios-separator-light);
    display: none;
    animation: iosShakeX 0.4s var(--ios-ease-out);
}

.ios-form-error.show {
    display: block;
}

.ios-form-global-error {
    background: var(--ios-red);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
    animation: iosFadeIn 0.3s var(--ios-ease-out);
}

.ios-form-global-error.show {
    display: block;
}

/* Helper Text */
.ios-helper-text {
    font-size: 13px;
    color: var(--ios-gray);
    padding: 0 4px 16px;
    line-height: 1.5;
}

/* Password Toggle */
.ios-password-toggle {
    background: none;
    border: none;
    color: var(--ios-gray);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px;
    font-family: inherit;
    transition: color var(--ios-animation-duration) var(--ios-ease-out);
}

.ios-password-toggle:active {
    color: var(--ios-blue);
}

/* ========================================
   11. iOS Tab Switcher
   ======================================== */
.ios-tab-switcher {
    background: var(--ios-gray5);
    border-radius: 10px;
    padding: 4px;
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.ios-tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-gray);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s var(--ios-ease-out);
    font-family: inherit;
}

.ios-tab-btn.active {
    background: white;
    color: var(--ios-label);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ========================================
   12. iOS Divider
   ======================================== */
.ios-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--ios-gray);
    font-size: 13px;
}

.ios-divider::before,
.ios-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ios-gray3);
}

.ios-divider span {
    padding: 0 16px;
}

/* ========================================
   13. iOS Social Buttons
   ======================================== */
.ios-social-buttons {
    display: flex;
    gap: 12px;
}

.ios-social-btn {
    flex: 1;
    padding: 14px 0;
    border: 1px solid var(--ios-gray5);
    background: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-label);
    cursor: pointer;
    transition: background 0.2s var(--ios-ease-out);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ios-social-btn:active {
    background: var(--ios-gray6);
    transform: scale(0.97);
}

/* ========================================
   14. iOS Toast
   ======================================== */
.ios-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--ios-blur-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    opacity: 0;
    transition: all 0.35s var(--ios-ease-out);
    z-index: 999;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
    max-width: 80vw;
}

.ios-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   15. iOS Loading Spinner
   ======================================== */
.ios-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--ios-gray5);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: iosSpin 0.8s linear infinite;
    display: inline-block;
}

@keyframes iosSpin {
    to { transform: rotate(360deg); }
}

.ios-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.ios-loading.show {
    display: block;
}

/* ========================================
   16. iOS Empty State
   ======================================== */
.ios-empty {
    text-align: center;
    padding: 60px 40px;
    color: var(--ios-gray);
}

.ios-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.ios-empty-text {
    font-size: 17px;
    font-weight: 500;
    color: var(--ios-secondary-label);
}

.ios-empty-subtext {
    font-size: 15px;
    color: var(--ios-gray);
    margin-top: 4px;
}

/* ========================================
   17. iOS Tab Bar (Bottom)
   ======================================== */
.ios-tab-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-bottom: 1px solid var(--ios-separator);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04),
                0 8px 40px rgba(0, 0, 0, 0.03);
    display: flex;
    padding: 6px 12px;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
    gap: 4px;
}

.ios-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    color: var(--ios-gray2);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border-radius: 14px;
    min-height: 54px;
    justify-content: center;
}

.ios-tab-item:hover {
    color: var(--ios-gray);
    background: rgba(0, 122, 255, 0.04);
}

.ios-tab-item:active {
    transform: scale(0.96);
}

.ios-tab-item.active {
    color: var(--ios-blue);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(0, 122, 255, 0.03) 100%);
}

.ios-tab-item.active::before {
    content: '';
    position: absolute;
    top: 6px;
    width: 28px;
    height: 4px;
    background: linear-gradient(90deg, var(--ios-blue) 0%, rgba(0, 122, 255, 0.6) 100%);
    border-radius: 2px;
    animation: tabIndicatorSlide 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes tabIndicatorSlide {
    from {
        transform: scaleX(0.3);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

.ios-tab-icon {
    font-size: 26px;
    line-height: 1;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

.ios-tab-item.active .ios-tab-icon {
    transform: translateY(-1px) scale(1.1);
    filter: drop-shadow(0 2px 8px rgba(0, 122, 255, 0.15));
    animation: tabIconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tabIconBounce {
    0% {
        transform: translateY(-1px) scale(1.1);
    }
    50% {
        transform: translateY(-4px) scale(1.05);
    }
    100% {
        transform: translateY(-1px) scale(1.1);
    }
}

.ios-tab-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.1px;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.9;
}

.ios-tab-item.active .ios-tab-label {
    opacity: 1;
    font-weight: 700;
    transform: translateY(-1px);
}

/* ========================================
   17.1 Tab Bar Responsive
   ======================================== */
@media (max-width: 374px) {
    .ios-tab-bar {
        padding: 4px 6px;
        gap: 1px;
    }
    
    .ios-tab-item {
        padding: 6px 2px;
        min-height: 48px;
        border-radius: 10px;
        gap: 2px;
    }

    .ios-tab-item.active::before {
        display: none;
    }
    
    .ios-tab-icon {
        font-size: 22px;
    }
    
    .ios-tab-label {
        font-size: 9px;
    }
}

@media (min-width: 375px) and (max-width: 479px) {
    .ios-tab-bar {
        padding: 5px 8px;
        gap: 2px;
    }
    
    .ios-tab-item {
        padding: 7px 3px;
        min-height: 50px;
    }

    .ios-tab-item.active::before {
        width: 24px;
        height: 3px;
        top: 4px;
    }
    
    .ios-tab-icon {
        font-size: 24px;
    }
    
    .ios-tab-label {
        font-size: 10px;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .ios-tab-bar {
        padding: 6px 12px;
        gap: 4px;
    }
    
    .ios-tab-item {
        padding: 8px 4px;
        min-height: 54px;
    }

    .ios-tab-item.active::before {
        width: 28px;
        height: 4px;
        top: 5px;
    }
    
    .ios-tab-icon {
        font-size: 26px;
    }
    
    .ios-tab-label {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .ios-tab-bar {
        padding: 10px 24px;
        gap: 6px;
    }
    
    .ios-tab-item {
        padding: 10px 8px;
        min-height: 60px;
        gap: 4px;
    }
    
    .ios-tab-icon {
        font-size: 28px;
    }
    
    .ios-tab-label {
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    .ios-tab-bar {
        padding: 12px 32px;
        gap: 8px;
    }
}

/* ========================================
   18. iOS Detail Page - Hero Section
   ======================================== */
.ios-hero {
    position: relative;
    width: 100%;
    height: 320px;
    background: var(--ios-gray5);
    overflow: hidden;
}

.ios-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ios-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--ios-background) 0%, transparent 100%);
    pointer-events: none;
}

.ios-detail-content {
    padding: 0 16px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   19. iOS Info Group (Table Style)
   ======================================== */
.ios-info-group {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.ios-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    min-height: 44px;
}

.ios-info-row + .ios-info-row {
    border-top: 1px solid var(--ios-separator-light);
}

.ios-info-label {
    font-size: 15px;
    color: var(--ios-gray);
    flex-shrink: 0;
}

.ios-info-value {
    font-size: 16px;
    color: var(--ios-label);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* ========================================
   20. iOS Card
   ======================================== */
.ios-card {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.ios-card-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ios-label);
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.ios-card-author {
    font-size: 16px;
    color: var(--ios-gray);
    margin-bottom: 12px;
}

/* ========================================
   21. iOS Price Display
   ======================================== */
.ios-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
}

.ios-price-label {
    font-size: 15px;
    color: var(--ios-gray);
}

.ios-price-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--ios-red);
    letter-spacing: -0.5px;
}

.ios-price-unit {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-red);
}

/* ========================================
   22. iOS Description Card
   ======================================== */
.ios-description {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    line-height: 1.7;
    font-size: 16px;
    color: var(--ios-secondary-label);
}

.ios-description p + p {
    margin-top: 12px;
}

/* ========================================
   23. iOS Stats Grid
   ======================================== */
.ios-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ios-stat-card {
    background: var(--ios-card-background);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s var(--ios-ease-out);
}

.ios-stat-card:active {
    transform: scale(0.95);
}

/* ========================================
   24. iOS Action Sheet (Bottom)
   ======================================== */
.ios-bottom-action {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ios-navigation-bar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--ios-separator);
    padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
    display: flex;
    gap: 10px;
    z-index: 100;
}

/* ========================================
   25. iOS Modal / Action Sheet
   ======================================== */
.ios-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: flex-end;
    animation: iosFadeIn 0.2s var(--ios-ease-out);
}

.ios-modal-overlay.show {
    display: flex;
}

.ios-modal-sheet {
    background: white;
    border-radius: 14px 14px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
    animation: iosSlideUp 0.35s var(--ios-spring);
    margin: 0 auto;
}

.ios-modal-handle {
    width: 36px;
    height: 5px;
    background: var(--ios-gray4);
    border-radius: 3px;
    margin: 0 auto 16px;
    display: block;
}

.ios-modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--ios-label);
}

.ios-modal-close {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    background: var(--ios-gray6);
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-blue);
    cursor: pointer;
    font-family: inherit;
    margin-top: 16px;
    transition: background 0.2s;
}

.ios-modal-close:active {
    background: var(--ios-gray5);
}

/* ========================================
   26. iOS Swipe to Delete
   ======================================== */
.ios-swipe-item {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.ios-swipe-content {
    position: relative;
    z-index: 1;
    background: var(--ios-card-background);
    transition: transform 0.25s var(--ios-ease-out);
}

.ios-swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    z-index: 0;
}

.ios-swipe-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-width: 80px;
}

.ios-swipe-action.delete {
    background: var(--ios-red);
}

.ios-swipe-action.edit {
    background: var(--ios-blue);
}

.ios-swipe-action.more {
    background: var(--ios-gray);
}

/* ========================================
   27. iOS Animations
   ======================================== */
@keyframes iosFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --- Page Transition Animation --- */
@keyframes iosPageIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ios-page {
    animation: iosPageIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    min-height: 100vh;
}

.ios-page-slow {
    animation: iosPageIn 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes iosFadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes iosSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes iosSlideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

@keyframes iosShakeX {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

@keyframes iosPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes iosRipple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ========================================
   28. iOS Utility Classes
   ======================================== */
.ios-container {
    padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
    max-width: 480px;
    margin: 0 auto;
}

.ios-container-wide {
    padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 100px);
    max-width: 720px;
    margin: 0 auto;
}

.ios-text-center { text-align: center; }
.ios-text-blue { color: var(--ios-blue); }
.ios-text-red { color: var(--ios-red); }
.ios-text-gray { color: var(--ios-gray); }

.ios-mt-8 { margin-top: 8px; }
.ios-mt-16 { margin-top: 16px; }
.ios-mt-24 { margin-top: 24px; }
.ios-mb-16 { margin-bottom: 16px; }
.ios-mb-24 { margin-bottom: 24px; }

.ios-flex { display: flex; }
.ios-flex-center { display: flex; align-items: center; justify-content: center; }
.ios-flex-between { display: flex; align-items: center; justify-content: space-between; }
.ios-gap-8 { gap: 8px; }
.ios-gap-12 { gap: 12px; }

.ios-hidden { display: none; }

/* Logo Section */
.ios-logo-section {
    text-align: center;
    padding: 30px 0;
}

.ios-logo-icon {
    font-size: 80px;
    margin-bottom: 12px;
    display: block;
}

.ios-app-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ios-label);
    letter-spacing: -0.3px;
}

.ios-app-subtitle {
    font-size: 15px;
    color: var(--ios-gray);
    margin-top: 4px;
}

/* Footer */
.ios-footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--ios-gray);
    margin-top: 24px;
    line-height: 1.6;
}

.ios-footer-link {
    color: var(--ios-blue);
    text-decoration: none;
}

/* Floating Action Button */
.ios-fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ios-blue);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ios-spring), box-shadow 0.2s var(--ios-ease-out);
    z-index: 50;
    font-family: inherit;
}

.ios-fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* Badge */
.ios-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

.ios-badge-blue {
    background: var(--ios-blue-light);
    color: var(--ios-blue);
}

.ios-badge-red {
    background: rgba(255, 59, 48, 0.08);
    color: var(--ios-red);
}

.ios-badge-green {
    background: rgba(52, 199, 89, 0.08);
    color: var(--ios-green);
}

/* ========================================
   29. iOS Responsive — 移动优先完整方案
   ======================================== */

/* === 极小屏: 320px-374px (iPhone SE/5/5S) === */
@media (max-width: 374px) {
    /* 导航栏 */
    .ios-nav {
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
    }
    .ios-nav-title {
        font-size: 22px;
    }
    .ios-nav-title-small {
        font-size: 16px;
    }
    .ios-nav-back {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .ios-large-title {
        font-size: 26px;
        padding: 12px 12px 2px;
    }

    /* 用户状态栏 */
    .ios-user-status {
        padding: 4px 0 8px;
    }
    .ios-avatar {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .ios-greeting {
        font-size: 13px;
    }
    .ios-user-action,
    .ios-user-action-logout {
        font-size: 12px;
        padding: 5px 8px;
    }

    /* 搜索栏 */
    .ios-search {
        padding: 0 10px;
    }
    .ios-search-icon {
        left: 22px;
        font-size: 14px;
    }
    .ios-search-input {
        padding: 10px 12px 10px 36px;
        font-size: 15px;
        border-radius: 8px;
    }
    .ios-search-cancel {
        font-size: 15px;
        right: 10px;
        padding: 6px;
    }

    /* 统计栏 */
    .ios-stats {
        margin: 0 10px 12px;
        max-width: none;
        border-radius: 10px;
    }
    .ios-stat-item {
        padding: 10px 6px;
    }
    .ios-stat-icon {
        font-size: 16px;
        margin-bottom: 2px;
    }
    .ios-stat-number {
        font-size: 16px;
    }
    .ios-stat-label {
        font-size: 11px;
    }

    /* 区块标题 */
    .ios-section-header {
        padding: 14px 12px 6px;
    }
    .ios-section-title {
        font-size: 18px;
    }
    .ios-section-count {
        font-size: 13px;
    }

    /* 书籍网格 */
    .ios-books-grid {
        gap: 10px;
        padding: 0 8px 12px;
    }
    .ios-book-card {
        min-height: 140px;
    }
    .ios-book-cover {
        width: 36%;
        min-width: 100px;
        max-width: 130px;
    }
    .ios-book-cover-placeholder {
        font-size: 34px;
    }
    .ios-book-info {
        padding: 10px 10px 8px;
    }
    .ios-book-badge {
        font-size: 9px;
        padding: 1px 6px;
        margin-bottom: 4px;
    }
    .ios-book-title {
        font-size: 15px;
        margin-bottom: 3px;
    }
    .ios-book-author {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .ios-book-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    .ios-book-actions {
        gap: 6px;
        margin-top: 8px;
        padding-top: 8px;
    }
    .ios-book-actions .ios-btn {
        padding: 7px 8px;
        font-size: 12px;
    }

    /* 分页 */
    .ios-pagination {
        gap: 6px;
        padding: 16px 10px calc(90px + env(safe-area-inset-bottom, 0px));
    }
    .ios-pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 6px;
    }
    .ios-pagination-info {
        font-size: 12px;
        min-width: 60px;
    }

    /* 按钮 */
    .ios-btn {
        font-size: 12px;
        padding: 5px 2px;
        border-radius: 6px;
    }
    .ios-btn-block {
        padding: 12px 0;
        font-size: 15px;
        border-radius: 10px;
    }

    /* 表单 */
    .ios-form-group {
        margin-bottom: 14px;
    }
    .ios-form-row {
        padding: 12px 12px;
    }
    .ios-form-label {
        font-size: 14px;
        width: 60px;
    }
    .ios-form-input,
    .ios-form-textarea,
    .ios-form-select {
        font-size: 14px;
    }
    .ios-form-textarea {
        padding: 12px;
        min-height: 64px;
    }
    .ios-form-error {
        font-size: 11px;
        padding: 6px 12px;
    }
    .ios-form-global-error {
        padding: 8px 12px;
        font-size: 13px;
    }
    .ios-helper-text {
        font-size: 12px;
        padding: 0 2px 12px;
    }
    .ios-tab-switcher {
        margin-bottom: 16px;
    }
    .ios-tab-btn {
        padding: 8px 0;
        font-size: 14px;
    }

    /* 分割线和社交按钮 */
    .ios-divider {
        margin: 16px 0;
        font-size: 12px;
    }
    .ios-social-btn {
        padding: 12px 0;
        font-size: 13px;
        border-radius: 10px;
    }

    /* Toast */
    .ios-toast {
        bottom: 80px;
        padding: 10px 18px;
        font-size: 13px;
        border-radius: 10px;
        max-width: 85vw;
    }

    /* Logo区域 */
    .ios-logo-section {
        padding: 20px 0;
    }
    .ios-logo-icon {
        font-size: 60px;
    }
    .ios-app-title {
        font-size: 20px;
    }
    .ios-app-subtitle {
        font-size: 13px;
    }

    /* 容器 */
    .ios-container {
        padding: 14px 12px calc(env(safe-area-inset-bottom, 0px) + 40px);
    }
    .ios-container-wide {
        padding: 14px 12px calc(env(safe-area-inset-bottom, 0px) + 90px);
    }

    /* 空状态 */
    .ios-empty {
        padding: 40px 20px;
    }
    .ios-empty-icon {
        font-size: 48px;
    }
    .ios-empty-text {
        font-size: 15px;
    }
    .ios-empty-subtext {
        font-size: 13px;
    }

    /* 统计卡片网格 */
    .ios-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .ios-stat-card {
        padding: 10px 6px;
    }
    .ios-stat-card .ios-stat-number {
        font-size: 17px;
    }

    /* 信息行 */
    .ios-info-row {
        padding: 12px 16px;
        min-height: 40px;
    }
    .ios-info-label {
        font-size: 14px;
    }
    .ios-info-value {
        font-size: 14px;
    }

    /* 卡片 */
    .ios-card {
        padding: 16px;
    }
    .ios-card-hero-title {
        font-size: 20px;
    }

    /* 价格 */
    .ios-price-value {
        font-size: 26px;
    }
    .ios-price-unit {
        font-size: 15px;
    }
    .ios-price-row {
        margin-bottom: 12px;
    }

    /* 描述 */
    .ios-description {
        padding: 16px;
        font-size: 14px;
    }

    /* 底部操作栏 */
    .ios-bottom-action {
        padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
        gap: 8px;
    }

    /* Hero区域 (非详情页) */
    .ios-hero {
        height: 200px;
    }
}

/* === 小屏: 375px-479px (iPhone 6/7/8/X/11/12/13/14/15) === */
@media (min-width: 375px) and (max-width: 479px) {
    /* 导航栏 */
    .ios-nav-title {
        font-size: 24px;
    }
    .ios-large-title {
        font-size: 28px;
        padding: 14px 14px 3px;
    }

    /* 统计栏 */
    .ios-stats {
        margin: 0 12px 14px;
    }
    .ios-stat-item {
        padding: 12px 8px;
    }
    .ios-stat-icon {
        font-size: 18px;
    }
    .ios-stat-number {
        font-size: 18px;
    }
    .ios-stat-label {
        font-size: 12px;
    }

    /* 书籍网格 */
    .ios-books-grid {
        gap: 12px;
        padding: 0 10px 14px;
    }
    .ios-book-card {
        min-height: 155px;
    }
    .ios-book-cover {
        width: 37%;
        min-width: 110px;
        max-width: 145px;
    }
    .ios-book-info {
        padding: 12px 12px 10px;
    }
    .ios-book-title {
        font-size: 17px;
    }
    .ios-book-author {
        font-size: 13px;
    }
    .ios-book-desc {
        font-size: 13px;
    }
    .ios-book-actions .ios-btn {
        padding: 7px 10px;
        font-size: 12px;
    }

    /* 区块标题 */
    .ios-section-header {
        padding: 16px 14px 6px;
    }
    .ios-section-title {
        font-size: 20px;
    }

    /* 分页 */
    .ios-pagination {
        gap: 8px;
        padding: 18px 14px calc(95px + env(safe-area-inset-bottom, 0px));
    }
    .ios-pagination-btn {
        padding: 7px 12px;
        font-size: 13px;
    }
    .ios-pagination-info {
        font-size: 13px;
        min-width: 70px;
    }

    /* 按钮 */
    .ios-btn-block {
        padding: 13px 0;
        font-size: 16px;
    }

    /* 容器 */
    .ios-container {
        padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 40px);
    }

    /* 统计卡片网格 */
    .ios-stats-grid {
        gap: 6px;
    }
    .ios-stat-card {
        padding: 12px 6px;
    }

    /* Hero */
    .ios-hero {
        height: 220px;
    }
    .ios-card-hero-title {
        font-size: 22px;
    }
    .ios-price-value {
        font-size: 28px;
    }

    /* 空状态 */
    .ios-empty {
        padding: 50px 30px;
    }
    .ios-empty-icon {
        font-size: 56px;
    }
}

/* === 中屏: 480px-599px (大屏手机/小平板) === */
@media (min-width: 480px) and (max-width: 599px) {
    .ios-books-grid {
        gap: 14px;
        padding: 0 16px 16px;
        max-width: 600px;
    }
    .ios-book-card {
        min-height: 180px;
    }
    .ios-book-cover {
        width: 38%;
        min-width: 130px;
        max-width: 170px;
    }
    .ios-book-title {
        font-size: 19px;
    }
    .ios-book-desc {
        font-size: 14px;
    }
    .ios-section-title {
        font-size: 22px;
    }
    .ios-stats {
        margin: 0 16px 16px;
    }
    .ios-container {
        padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
    }
    .ios-pagination {
        padding: 20px 16px calc(100px + env(safe-area-inset-bottom, 0px));
    }
    .ios-hero {
        height: 260px;
    }
    .ios-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .ios-empty {
        padding: 60px 40px;
    }
}

/* === 平板及以上: 600px+ === */
@media (min-width: 600px) {
    .ios-books-grid {
        gap: 16px;
        padding: 0 16px 20px;
        max-width: 720px;
    }
    .ios-book-card {
        min-height: 190px;
    }
    .ios-book-cover {
        width: 37%;
        min-width: 140px;
        max-width: 180px;
    }
    .ios-book-title {
        font-size: 20px;
    }
    .ios-book-author {
        font-size: 15px;
    }
    .ios-book-desc {
        font-size: 14px;
    }
    .ios-book-actions .ios-btn {
        padding: 9px 16px;
        font-size: 14px;
    }
    .ios-container {
        padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 40px);
        max-width: 600px;
    }
    .ios-detail-content {
        max-width: 600px;
    }
}

@media (min-width: 768px) {
    .ios-books-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        max-width: 920px;
        gap: 16px;
        padding: 0 24px 24px;
    }
    .ios-nav-inner,
    .ios-search,
    .ios-section-header,
    .ios-pagination,
    .ios-user-status {
        max-width: 920px;
    }
    .ios-stats {
        max-width: 920px;
    }
    .ios-book-card {
        min-height: 155px;
    }
    .ios-book-cover {
        width: 37%;
        min-width: 110px;
        max-width: 140px;
    }
    .ios-book-title {
        font-size: 16px;
    }
    .ios-book-author {
        font-size: 13px;
    }
    .ios-book-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    .ios-book-actions .ios-btn {
        padding: 7px 8px;
        font-size: 12px;
    }
    .ios-container {
        padding-top: 40px;
    }
}

@media (min-width: 1024px) {
    .ios-books-grid {
        max-width: 1000px;
        gap: 20px;
        padding: 0 32px 32px;
    }
    .ios-nav-inner,
    .ios-search,
    .ios-section-header,
    .ios-pagination,
    .ios-user-status {
        max-width: 1000px;
    }
    .ios-stats {
        max-width: 1000px;
    }
    .ios-book-card {
        min-height: 175px;
    }
    .ios-book-cover {
        width: 36%;
        min-width: 130px;
        max-width: 170px;
    }
    .ios-book-title {
        font-size: 18px;
    }
    .ios-book-author {
        font-size: 14px;
    }
    .ios-book-desc {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    .ios-book-info {
        padding: 16px 16px 14px;
    }
    .ios-book-actions .ios-btn {
        padding: 9px 14px;
        font-size: 14px;
    }
}

/* 安全区兼容 - 确保所有固定定位元素 */
@supports (padding: env(safe-area-inset-bottom)) {
    .detail-bottom-bar,
    .ios-bottom-action {
        padding-bottom: calc(env(safe-area-inset-bottom));
    }
}

/* ========================================
   30. iOS Blur Effect (Frosted Glass)
   ======================================== */
.ios-blur-light {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.ios-blur-dark {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========================================
   31. Gradient Accents
   ======================================== */
.ios-gradient-blue {
    background: linear-gradient(135deg, #007AFF, #5856D6);
}

.ios-gradient-green {
    background: linear-gradient(135deg, #34C759, #30B350);
}

.ios-gradient-orange {
    background: linear-gradient(135deg, #FF9500, #FF3B30);
}

.ios-gradient-purple {
    background: linear-gradient(135deg, #AF52DE, #5856D6);
}

/* ========================================
   32. Delete Confirmation (iOS Style)
   ======================================== */
.ios-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    display: none;
    justify-content: center;
    align-items: center;
    animation: iosFadeIn 0.2s var(--ios-ease-out);
}

.ios-confirm-overlay.show {
    display: flex;
}

.ios-confirm-alert {
    background: white;
    border-radius: 14px;
    width: 280px;
    padding: 24px 20px 16px;
    text-align: center;
    animation: iosFadeInUp 0.3s var(--ios-spring);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.ios-confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ios-label);
    margin-bottom: 8px;
}

.ios-confirm-message {
    font-size: 13px;
    color: var(--ios-gray);
    margin-bottom: 20px;
    line-height: 1.5;
}

.ios-confirm-buttons {
    display: flex;
    gap: 8px;
}

.ios-confirm-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.ios-confirm-btn:active {
    opacity: 0.7;
}

.ios-confirm-btn-cancel {
    background: var(--ios-gray6);
    color: var(--ios-blue);
}

.ios-confirm-btn-delete {
    background: var(--ios-red);
    color: white;
}

/* ========================================
   33. Book Detail Page — iOS Redesign
   ======================================== */

.detail-body {
    background: var(--ios-background);
    padding-bottom: 0;
}

/* --- Navigation Bar (Frosted Glass) --- */

.detail-nav-blur {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
    background: rgba(242, 242, 247, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.detail-nav-blur.scrolled {
    background: rgba(242, 242, 247, 0.92);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.detail-nav-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--ios-label);
    flex-shrink: 0;
    transition: transform 0.2s var(--ios-ease-out), background 0.2s;
}

.detail-nav-back:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.5);
}

.detail-nav-title {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-label);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-nav-title.visible {
    opacity: 1;
}

.detail-nav-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--ios-red);
    flex-shrink: 0;
    transition: transform 0.2s var(--ios-ease-out), background 0.2s;
}

.detail-nav-action:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.5);
}

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

.detail-hero {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
}

.detail-hero-bg {
    position: absolute;
    inset: -20px;
    transition: transform 0.1s linear;
    background: linear-gradient(135deg, var(--ios-gray5) 0%, var(--ios-gray4) 100%);
}

.detail-hero-img {
    width: 100%;
    height: calc(100% + 40px);
    object-fit: cover;
    display: block;
}

.detail-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.02) 30%,
        rgba(0, 0, 0, 0.4) 70%,
        var(--ios-background) 100%
    );
    pointer-events: none;
}

.detail-hero-overlay-content {
    position: absolute;
    bottom: 24px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    z-index: 2;
}

.detail-hero-cover-wrapper {
    width: 100px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    animation: detailCoverIn 0.6s 0.15s var(--ios-spring) both;
    background: var(--ios-gray5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-hero-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--ios-gray5);
    transition: opacity 0.3s ease;
}

.detail-hero-cover-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--ios-gray5);
    color: var(--ios-gray3);
}

.detail-hero-meta {
    flex: 1;
    min-width: 0;
    animation: detailFadeUp 0.5s 0.25s var(--ios-ease-out) both;
}

.detail-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.detail-hero-author {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.detail-hero-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.2px;
}

/* --- Content Area --- */

.detail-content {
    padding: 0 16px;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: detailFadeUp 0.5s 0.3s var(--ios-ease-out) both;
}

.detail-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.detail-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 0;
    border: none;
    border-radius: var(--ios-corner-radius-lg);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s var(--ios-ease-out), opacity 0.15s;
}

.detail-action-btn:active {
    transform: scale(0.96);
    opacity: 0.85;
}

.detail-action-primary {
    flex: 2;
    background: var(--ios-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}

.detail-action-secondary {
    width: 52px;
    background: var(--ios-card-background);
    color: var(--ios-blue);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

/* --- Rating Card --- */

.detail-rating-card {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.detail-rating-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.detail-rating-score {
    font-size: 44px;
    font-weight: 700;
    color: var(--ios-label);
    letter-spacing: -1px;
    line-height: 1;
}

.detail-rating-stars-row {
    display: flex;
    gap: 2px;
}

.detail-star {
    font-size: 16px;
    color: var(--ios-gray4);
}

.detail-star.full {
    color: #FF9500;
}

.detail-star.half {
    background: linear-gradient(90deg, #FF9500 50%, var(--ios-gray4) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-rating-count {
    font-size: 13px;
    color: var(--ios-gray);
}

.detail-rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-rating-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-rating-bar-label {
    font-size: 12px;
    color: var(--ios-gray);
    width: 12px;
    text-align: right;
}

.detail-rating-bar-track {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--ios-gray5);
    overflow: hidden;
}

.detail-rating-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #FF9500, #FFCC00);
}

/* --- Section (reusable card group) --- */

.detail-section {
    margin-bottom: 20px;
}

.detail-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 12px;
}

.detail-section-icon {
    font-size: 18px;
}

.detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ios-label);
    letter-spacing: -0.2px;
}

/* --- Info Table (iOS grouped style) --- */

.detail-info-table {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.detail-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    min-height: 44px;
}

.detail-info-row + .detail-info-row {
    border-top: 1px solid var(--ios-separator-light);
}

.detail-info-label {
    font-size: 15px;
    color: var(--ios-gray);
    flex-shrink: 0;
}

.detail-info-value {
    font-size: 16px;
    color: var(--ios-label);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.detail-price {
    font-weight: 700;
    color: var(--ios-red);
    letter-spacing: -0.2px;
}

/* --- Description --- */

.detail-description {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    line-height: 1.75;
    font-size: 16px;
    color: var(--ios-secondary-label);
}

.detail-description-text + .detail-description-text {
    margin-top: 14px;
}

.detail-description strong {
    color: var(--ios-label);
}

/* --- Stats Row --- */

.detail-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.detail-stat-item {
    background: var(--ios-card-background);
    border-radius: 12px;
    padding: 14px 6px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s var(--ios-ease-out);
    cursor: default;
}

.detail-stat-item:active {
    transform: scale(0.95);
}

.detail-stat-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 4px;
}

.detail-stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--ios-blue);
    letter-spacing: -0.3px;
    display: block;
}

.detail-stat-label {
    font-size: 13px;
    color: var(--ios-gray);
    margin-top: 2px;
    display: block;
}

/* --- Related Books --- */

.detail-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.detail-related-card {
    background: var(--ios-card-background);
    border-radius: var(--ios-corner-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s var(--ios-ease-out), box-shadow 0.2s;
    cursor: pointer;
    display: block;
}

.detail-related-card:active {
    transform: scale(0.96);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.detail-related-cover {
    width: 100%;
    aspect-ratio: 3/4;
    background: var(--ios-gray5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-related-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--ios-gray5);
    transition: opacity 0.3s ease;
}

.detail-related-cover-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 36px;
    color: var(--ios-gray3);
    background: var(--ios-gray5);
}

.detail-related-info {
    padding: 10px;
}

.detail-related-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-label);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.detail-related-author {
    font-size: 12px;
    color: var(--ios-gray);
}

.detail-related-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 0;
    color: var(--ios-gray);
    font-size: 15px;
}

.detail-bottom-spacer {
    height: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* --- Bottom Action Bar --- */

.detail-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--ios-navigation-bar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--ios-separator);
    padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: detailSlideUp 0.4s 0.5s var(--ios-spring) both;
}

.detail-bottom-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-bottom-price-label {
    font-size: 13px;
    color: var(--ios-gray);
}

.detail-bottom-price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--ios-red);
    letter-spacing: -0.3px;
}

.detail-bottom-btn {
    flex: 1;
    padding: 14px 0;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s var(--ios-ease-out), opacity 0.15s;
}

.detail-bottom-btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.detail-bottom-btn-primary {
    background: var(--ios-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}

/* --- Keyframes --- */

@keyframes detailCoverIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes detailFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes detailSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes collectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- 收藏按钮样式 --- */

.ios-btn-collect {
    padding: 6px 10px;
    font-size: 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ios-ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.ios-btn-collect:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.ios-btn-collect:active {
    transform: scale(0.95);
}

.ios-btn-collect-active {
    background: rgba(255, 59, 48, 0.1);
    color: var(--ios-red);
}

.ios-btn-collect-active:active {
    transform: scale(0.95);
}

.ios-btn-collect.pulse {
    animation: collectPulse 0.3s ease-out;
}

/* --- 详情页面收藏按钮样式 --- */

.detail-action-collect {
    transition: all 0.2s var(--ios-ease-out);
}

.detail-action-collect-active {
    background: rgba(255, 59, 48, 0.1);
}

.detail-action-collect-active svg {
    stroke: var(--ios-red);
}

.detail-action-collect.pulse {
    animation: collectPulse 0.3s ease-out;
}

.detail-nav-action.pulse {
    animation: collectPulse 0.3s ease-out;
}

/* ========================================
   34. Detail Page Responsive
   ======================================== */

/* 极小屏 320-374px */
@media (max-width: 374px) {
    .detail-hero {
        height: 300px;
    }
    .detail-hero-title {
        font-size: 18px;
    }
    .detail-hero-author {
        font-size: 13px;
        margin-bottom: 6px;
    }
    .detail-hero-cover-wrapper {
        width: 72px;
        height: 100px;
        border-radius: 8px;
    }
    .detail-hero-overlay-content {
        bottom: 14px;
        left: 12px;
        right: 12px;
        gap: 10px;
    }
    .detail-hero-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    .detail-hero-meta {
        min-width: 0;
    }
    .detail-nav-blur {
        padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px 6px;
        gap: 6px;
    }
    .detail-nav-back,
    .detail-nav-action {
        width: 32px;
        height: 32px;
    }
    .detail-nav-title {
        font-size: 15px;
    }
    .detail-content {
        padding: 0 10px;
    }
    .detail-actions-row {
        gap: 6px;
        margin-bottom: 14px;
    }
    .detail-action-btn {
        padding: 12px 0;
        font-size: 14px;
        border-radius: 10px;
    }
    .detail-action-secondary {
        width: 44px;
    }
    .detail-rating-card {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 14px 16px;
        margin-bottom: 14px;
    }
    .detail-rating-stars {
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
    .detail-rating-score {
        font-size: 34px;
    }
    .detail-rating-count {
        font-size: 12px;
    }
    .detail-section {
        margin-bottom: 14px;
    }
    .detail-section-header {
        padding: 2px 0 8px;
    }
    .detail-section-title {
        font-size: 16px;
    }
    .detail-section-icon {
        font-size: 16px;
    }
    .detail-info-row {
        padding: 12px 14px;
        min-height: 40px;
    }
    .detail-info-label {
        font-size: 13px;
    }
    .detail-info-value {
        font-size: 14px;
    }
    .detail-description {
        padding: 16px;
        font-size: 14px;
    }
    .detail-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .detail-stat-item {
        padding: 10px 4px;
    }
    .detail-stat-icon {
        font-size: 18px;
    }
    .detail-stat-num {
        font-size: 16px;
    }
    .detail-stat-label {
        font-size: 11px;
    }
    .detail-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .detail-related-info {
        padding: 8px;
    }
    .detail-related-title {
        font-size: 12px;
    }
    .detail-related-author {
        font-size: 11px;
    }
    .detail-bottom-bar {
        padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
        gap: 8px;
    }
    .detail-bottom-price-value {
        font-size: 18px;
    }
    .detail-bottom-price-label {
        font-size: 11px;
    }
    .detail-bottom-btn {
        font-size: 15px;
        padding: 12px 0;
        border-radius: 10px;
    }
    .detail-bottom-spacer {
        height: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* 小屏 375-479px */
@media (min-width: 375px) and (max-width: 479px) {
    .detail-hero {
        height: 360px;
    }
    .detail-hero-title {
        font-size: 22px;
    }
    .detail-hero-cover-wrapper {
        width: 88px;
        height: 124px;
    }
    .detail-hero-overlay-content {
        bottom: 18px;
        left: 16px;
        right: 16px;
        gap: 14px;
    }
    .detail-content {
        padding: 0 14px;
    }
    .detail-actions-row {
        gap: 8px;
        margin-bottom: 16px;
    }
    .detail-action-btn {
        padding: 13px 0;
        font-size: 15px;
    }
    .detail-action-secondary {
        width: 48px;
    }
    .detail-rating-card {
        padding: 16px 18px;
        margin-bottom: 16px;
    }
    .detail-rating-score {
        font-size: 38px;
    }
    .detail-info-row {
        padding: 13px 16px;
    }
    .detail-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .detail-stat-num {
        font-size: 18px;
    }
    .detail-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .detail-bottom-price-value {
        font-size: 20px;
    }
    .detail-bottom-btn {
        font-size: 16px;
        padding: 13px 0;
    }
    .detail-bottom-spacer {
        height: calc(90px + env(safe-area-inset-bottom, 0px));
    }
}

/* 中屏 480-599px */
@media (min-width: 480px) and (max-width: 599px) {
    .detail-hero {
        height: 400px;
    }
    .detail-hero-title {
        font-size: 24px;
    }
    .detail-hero-cover-wrapper {
        width: 100px;
        height: 140px;
    }
    .detail-stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
    .detail-related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* 600px+ 详情页规则 */
@media (min-width: 600px) {
    .detail-hero {
        height: 480px;
    }
    .detail-hero-title {
        font-size: 30px;
    }
    .detail-hero-cover-wrapper {
        width: 120px;
        height: 168px;
    }
}
