/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.container {
    max-width: 100%;
    min-height: 100vh;
    background: #f5f5f5;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.site-footer {
    margin-top: auto;
    padding: 18px 16px 22px;
    text-align: center;
}

.site-footer .beian-link {
    color: #888;
    font-size: 12px;
    line-height: 1.5;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-footer .beian-link:hover {
    color: #555;
    text-decoration: underline;
}

.site-announcement {
    padding: 10px 16px;
    background: #fff8e6;
    color: #8a6d1d;
    font-size: 13px;
    line-height: 1.55;
    border-bottom: 1px solid #f0e0a8;
    text-align: center;
}

.announcement-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.announcement-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 主页顶部标题栏风格（后台可切换） */
.header.header-theme-sunset {
    background: linear-gradient(135deg, #ffd54f 0%, #ff9800 42%, #ff5722 72%, #e53935 100%);
    box-shadow: 0 2px 12px rgba(229, 57, 53, 0.28);
}
.header.header-theme-golden {
    background: linear-gradient(135deg, #fff3b0 0%, #ffd54f 40%, #f9a825 100%);
    color: #3e2723;
    box-shadow: 0 2px 12px rgba(249, 168, 37, 0.3);
}
.header.header-theme-coral {
    background: linear-gradient(135deg, #ffcc80 0%, #ff8a65 48%, #ff5252 100%);
    box-shadow: 0 2px 12px rgba(255, 82, 82, 0.28);
}
.header.header-theme-cherry {
    background: linear-gradient(135deg, #ff8a80 0%, #e53935 55%, #b71c1c 100%);
    box-shadow: 0 2px 12px rgba(183, 28, 28, 0.32);
}
.header.header-theme-ocean {
    background: linear-gradient(135deg, #80deea 0%, #29b6f6 45%, #1565c0 100%);
    box-shadow: 0 2px 12px rgba(21, 101, 192, 0.28);
}
.header.header-theme-jade {
    background: linear-gradient(135deg, #b2dfdb 0%, #26a69a 48%, #00695c 100%);
    box-shadow: 0 2px 12px rgba(0, 105, 92, 0.28);
}
.header.header-theme-ink {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 50%, #263238 100%);
    box-shadow: 0 2px 12px rgba(38, 50, 56, 0.35);
}
.header.header-theme-latte {
    background: linear-gradient(135deg, #efebe9 0%, #d7ccc8 40%, #8d6e63 100%);
    color: #3e2723;
    box-shadow: 0 2px 12px rgba(141, 110, 99, 0.28);
}
.header.header-theme-blossom {
    background: linear-gradient(135deg, #f8bbd0 0%, #f06292 50%, #c2185b 100%);
    box-shadow: 0 2px 12px rgba(194, 24, 91, 0.28);
}
.header.header-theme-slate {
    background: linear-gradient(135deg, #cfd8dc 0%, #78909c 48%, #455a64 100%);
    box-shadow: 0 2px 12px rgba(69, 90, 100, 0.3);
}

.header.header-theme-golden .lang-switcher-btn,
.header.header-theme-golden .lang-switcher-label,
.header.header-theme-golden .back-btn,
.header.header-theme-latte .lang-switcher-btn,
.header.header-theme-latte .lang-switcher-label,
.header.header-theme-latte .back-btn {
    color: inherit;
    border-color: rgba(62, 39, 35, 0.35);
}

.header.header-theme-golden .back-btn,
.header.header-theme-latte .back-btn {
    background: rgba(62, 39, 35, 0.08);
}

.header.header-theme-golden .back-btn:active,
.header.header-theme-latte .back-btn:active {
    background: rgba(62, 39, 35, 0.16);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    flex: 1;
}

.header-with-search {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.header-row h1 {
    min-width: 0;
}

.lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.lang-switcher-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    user-select: none;
}

.lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 132px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.lang-switcher-btn:active {
    background: rgba(255, 255, 255, 0.28);
}

.lang-switcher-current {
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-switcher-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 120;
    min-width: 148px;
    max-height: min(60vh, 360px);
    overflow-y: auto;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.lang-switcher-menu li {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
}

.lang-switcher-menu li:hover,
.lang-switcher-menu li.is-active {
    background: #f0f2ff;
    color: #5a67d8;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input[type="search"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 15px;
}

.search-box input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.search-box input[type="search"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.6);
}

.search-meta {
    padding: 10px 15px 0;
    color: #666;
    font-size: 13px;
}

.admin-search-meta {
    padding: 0 0 10px;
}

.image-caption {
    padding: 8px 8px 10px;
    text-align: center;
}

.image-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-series {
    margin-top: 3px;
    font-size: 11px;
    color: #667eea;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
}

.back-btn:active {
    background: rgba(255,255,255,0.3);
}

/* 主页系列网格 */
.series-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    overflow: visible;
}

.series-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

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

/* 蜘蛛侠透明封面：卡片框正常，人物放大并略溢出框外 */
.series-card.is-cover-pop {
    overflow: visible;
    z-index: 1;
}

.series-card.is-cover-pop .series-cover-box.is-cover-pop-box,
.series-cover-box.is-cover-pop-box {
    overflow: visible;
    background: linear-gradient(165deg, #2a2a35 0%, #16161c 100%);
    border-radius: 10px 10px 0 0;
}

.series-card.is-cover-pop .series-cover-pop {
    width: 122%;
    height: 122%;
    max-width: none;
    margin: -10% -11% 0;
    object-fit: contain;
    object-position: center bottom;
    background: transparent;
    filter:
        drop-shadow(0 12px 20px rgba(0, 0, 0, 0.58))
        drop-shadow(0 4px 10px rgba(160, 0, 0, 0.42));
    transform: translateY(-7%) scale(1.08);
    transform-origin: center bottom;
}

.series-card.is-cover-pop .series-name {
    position: relative;
    z-index: 2;
    background: #fff;
}

.series-card.is-cover-pop:active {
    transform: scale(0.98);
    z-index: 2;
}

.series-cover-box {
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #e0e0e0;
}

.series-cover {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
    background: #e0e0e0;
}

.series-cover-center {
    object-position: center center;
}

/* 主页放大裁切：偏右放大，隐藏左侧标签数字 */
.series-cover-box.is-zoom .series-cover {
    transform: scale(1.22);
    transform-origin: 85% 50%;
}

/* back image 封面：去掉手机壳边缘（上剪190px，左右各剪30px，下剪30px） */
.series-cover-box.is-back-crop {
    position: relative;
}

.series-cover-box.is-back-crop .series-cover {
    width: calc(100% + 60px);
    height: calc(100% + 220px);
    max-width: none;
    margin: -190px -30px -30px -30px;
    object-fit: cover;
    object-position: center top;
    transform: none;
}

.series-cover-wrap,
.plain-cover {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
    background: #ececec;
}

/* 套壳预览：外框与普通卡片同为 9:16；壳按真实比例居中缩小，保证不超出卡片 */
.phone-mockup {
    --camera-clear: 7.9%; /* ≈ 100/(1346-80) */
    --element-ox: 0;
    --element-oy: 0;
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #f0f0f0;
    box-sizing: border-box;
    padding: clamp(4px, 5.5%, 40px);
}

.phone-mockup__frame {
    /* 在 9:16 容器内按壳比例(613:1346)用宽度约束高度，避免撑破 */
    position: relative;
    width: min(100%, calc(100% * 16 / 9 * 613 / 1346));
    aspect-ratio: 613 / 1346;
    margin: 0 auto;
    overflow: hidden;
}

.phone-mockup__design {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    background: #fff;
    border-radius: 10% / 5%;
}

.phone-mockup__slot {
    position: absolute;
    /* left/top 的百分比分别相对父级宽/高，保证上下偏移与左右同样有效 */
    left: calc(var(--element-ox) * 100% / 613);
    top: calc(var(--element-oy) * 100% / 1346);
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.phone-mockup.is-inset .phone-mockup__slot {
    /* 摄像头留白 + 用户上下偏移 */
    top: calc(var(--camera-clear) + var(--element-oy) * 100% / 1346);
    height: calc(100% - var(--camera-clear));
}

.phone-mockup__element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* 置于壳内：不变形、不溢出，整体下移避开摄像头 */
.phone-mockup.is-inset .phone-mockup__element {
    object-fit: contain;
    object-position: center center;
}

.phone-mockup__shell {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    z-index: 2;
    user-select: none;
    display: block;
}

.image-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.media-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.media-frame .plain-cover,
.media-frame .phone-mockup {
    width: 100%;
}

.img-watermark {
    position: absolute;
    inset: -20%;
    z-index: 5;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    align-items: center;
    justify-items: center;
    gap: 8% 4%;
    overflow: hidden;
    transform: rotate(-28deg);
    --wm-opacity: 0.22;
}

.img-watermark span {
    display: block;
    width: 100%;
    text-align: center;
    padding: 2px 0;
    color: rgba(255, 255, 255, var(--wm-opacity));
    font-size: clamp(10px, 2.8vw, 14px);
    font-weight: 600;
    letter-spacing: 0.12em;
    white-space: nowrap;
    text-shadow: 0 0 1px rgba(0, 0, 0, calc(var(--wm-opacity) * 0.45));
    user-select: none;
}

.modal-stage .media-frame {
    width: 100%;
}

.modal-stage .img-watermark {
    gap: 6% 3%;
}

.modal-stage .img-watermark span {
    font-size: clamp(14px, 3.2vw, 20px);
}

/* 水印开关（靠右） */
.switch-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.switch-ui {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 88px;
    height: 34px;
    padding: 0 12px 0 38px;
    border-radius: 999px;
    background: #cfd4dc;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease, padding 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.switch-knob {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.switch-text-on {
    display: none;
}

.switch-text-off {
    display: inline;
}

.switch-toggle.is-on .switch-ui,
.switch-toggle input:checked + .switch-ui {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    justify-content: flex-start;
    padding: 0 38px 0 12px;
}

.switch-toggle.is-on .switch-knob,
.switch-toggle input:checked + .switch-ui .switch-knob {
    transform: translateX(50px);
}

.switch-toggle.is-on .switch-text-on,
.switch-toggle input:checked + .switch-ui .switch-text-on {
    display: inline;
}

.switch-toggle.is-on .switch-text-off,
.switch-toggle input:checked + .switch-ui .switch-text-off {
    display: none;
}

.opacity-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.opacity-row input[type="range"] {
    flex: 1;
    accent-color: #667eea;
}

.opacity-value {
    min-width: 28px;
    text-align: right;
    font-weight: 700;
    color: #667eea;
}

.image-item .phone-mockup,
.manage-image-item .phone-mockup {
    border-radius: 0;
    width: 100%;
}

.modal-stage {
    position: relative;
    width: min(90vw, 420px);
    max-height: 90vh;
    touch-action: none;
    will-change: transform, opacity;
    transform-origin: center center;
    transition: opacity 0.12s ease;
}

.modal-stage .phone-mockup--modal {
    width: 100%;
    max-height: 90vh;
    aspect-ratio: 9 / 16;
}

.modal-stage .modal-plain,
.modal-stage .plain-cover.modal-plain {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
    aspect-ratio: auto;
    background: transparent;
}

.series-name {
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #333;
}

/* 详情页图片网格 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

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

.image-item img.plain-cover {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

/* 加载提示 */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* 图片预览模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.modal.is-open {
    display: flex;
    touch-action: none;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    touch-action: none;
    transform-origin: center center;
}

.close {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    color: #555;
    background: rgba(170, 170, 170, 0.92);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    user-select: none;
}

.close:hover,
.close:focus {
    color: #222;
    background: rgba(200, 200, 200, 0.96);
}

/* 登录页面 */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group input {
    width: 100%;
}

.btn-primary,
.btn-secondary {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.form-group .btn-primary,
.login-container .btn-primary {
    width: 100%;
}

.input-group .btn-primary {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    width: auto;
    padding: 8px 15px;
    font-size: 14px;
}

.btn-primary:active,
.btn-secondary:active {
    opacity: 0.8;
}

.error-msg {
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

.error-msg.show {
    display: block;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
}

/* 后台管理页面 */
.admin-container {
    padding: 0;
}

.admin-section {
    background: white;
    margin: 15px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
}

/* 文件上传样式 */
.upload-label {
    font-weight: 600;
    margin-bottom: 10px;
}

.file-upload-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-select-btn {
    display: block;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.file-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-select-btn:active {
    transform: translateY(0);
}

.file-count {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    color: #667eea;
    font-weight: 500;
    text-align: center;
    display: none;
}

.file-count.show {
    display: block;
}

.pending-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 16px;
}

.pending-preview:empty {
    display: none;
    margin: 0;
}

.pending-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.pending-item img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

.pending-actions {
    display: flex;
    gap: 6px;
    padding: 8px 8px 0;
}

.pending-btn {
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pending-btn.preview {
    background: #667eea;
    color: #fff;
}

.pending-btn.remove {
    background: #dc3545;
    color: #fff;
}

.pending-btn:active {
    opacity: 0.85;
}

.pending-name {
    padding: 6px 8px 8px;
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.field-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.name-preview {
    color: #667eea;
    font-weight: 500;
}

.btn-upload {
    margin-top: 10px;
    font-size: 16px;
    padding: 15px;
}

.series-list {
    margin-top: 20px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.section-title-row h2 {
    margin: 0;
}

.series-list-toolbar {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.series-item {
    display: block;
    padding: 0;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #ececec;
}

.series-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}

.series-item-header:hover {
    background: #f1f3f5;
}

.series-toggle-btn {
    flex-shrink: 0;
    border: 1px solid #ccd0d5;
    background: #fff;
    color: #555;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    min-width: 48px;
}

.series-item.is-expanded .series-toggle-btn {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.series-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.series-item-name {
    font-weight: 600;
    color: #333;
}

.series-flag {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 12px;
    background: #eef1ff;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
}

.series-flag-index {
    background: #f0f2f5;
    color: #555;
    font-variant-numeric: tabular-nums;
}

.series-index-row .series-index-input {
    width: 80px;
}

.series-item-body {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid #e8e8e8;
}

.series-item.is-expanded .series-item-body {
    display: block;
}

.series-item-main {
    flex: 1;
    min-width: 0;
}

.series-shell-options {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shell-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
}

.shell-option input {
    margin-top: 2px;
    flex-shrink: 0;
}

.shell-option-inset {
    padding-left: 2px;
    color: #555;
}

.shell-option-inset.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.shell-offset-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    color: #444;
}

.shell-offset-row.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.shell-offset-label {
    font-weight: 600;
    color: #333;
}

.shell-offset-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shell-offset-field input {
    width: 72px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
}

.shell-offset-hint {
    width: 100%;
    color: #888;
    font-size: 12px;
}

.series-item-count {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.series-cover-manage {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e5e5;
}

.series-cover-manage-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.series-cover-manage-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.series-cover-thumb {
    width: 54px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
    flex-shrink: 0;
}

.series-cover-manage-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.btn-cover-upload {
    display: inline-block;
    padding: 6px 12px;
    background: #5a67d8;
    color: #fff;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.btn-cover-clear {
    padding: 6px 12px;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.btn-cover-clear:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-rename {
    background: #5a67d8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.btn-rename:active {
    opacity: 0.8;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.btn-delete:active {
    opacity: 0.8;
}

.upload-progress {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.upload-progress.show {
    display: block;
}

.progress-item {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.images-manage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.manage-image-item {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.manage-image-item > .plain-cover {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

.manage-image-item .delete-image-btn {
    z-index: 3;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-image-btn:active {
    background: rgba(220, 53, 69, 1);
}

.storage-settings {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.storage-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.storage-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fafafa;
    font-size: 14px;
}

.storage-mode-option input {
    margin: 0;
}

.storage-mode-option.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.storage-mode-option:has(input:checked) {
    border-color: #007bff;
    background: #eef5ff;
}

.header-style-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 560px) {
    .header-style-picker {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.header-style-option {
    appearance: none;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    text-align: left;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}

.header-style-option:hover {
    transform: translateY(-1px);
}

.header-style-option.is-selected {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-style-swatch {
    display: block;
    height: 44px;
    width: 100%;
}

.header-style-swatch.theme-sunset {
    background: linear-gradient(135deg, #ffd54f 0%, #ff9800 42%, #ff5722 72%, #e53935 100%);
}
.header-style-swatch.theme-golden {
    background: linear-gradient(135deg, #fff3b0 0%, #ffd54f 40%, #f9a825 100%);
}
.header-style-swatch.theme-coral {
    background: linear-gradient(135deg, #ffcc80 0%, #ff8a65 48%, #ff5252 100%);
}
.header-style-swatch.theme-cherry {
    background: linear-gradient(135deg, #ff8a80 0%, #e53935 55%, #b71c1c 100%);
}
.header-style-swatch.theme-ocean {
    background: linear-gradient(135deg, #80deea 0%, #29b6f6 45%, #1565c0 100%);
}
.header-style-swatch.theme-jade {
    background: linear-gradient(135deg, #b2dfdb 0%, #26a69a 48%, #00695c 100%);
}
.header-style-swatch.theme-ink {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 50%, #263238 100%);
}
.header-style-swatch.theme-latte {
    background: linear-gradient(135deg, #efebe9 0%, #d7ccc8 40%, #8d6e63 100%);
}
.header-style-swatch.theme-blossom {
    background: linear-gradient(135deg, #f8bbd0 0%, #f06292 50%, #c2185b 100%);
}
.header-style-swatch.theme-slate {
    background: linear-gradient(135deg, #cfd8dc 0%, #78909c 48%, #455a64 100%);
}

.header-style-name {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.manage-image-item .image-caption {
    padding: 8px;
}

.download-original-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #007bff;
    text-decoration: none;
    border: 1px solid #007bff;
    border-radius: 4px;
    background: #fff;
}

.download-original-btn:hover {
    background: #eef5ff;
}

/* 响应式优化 */
@media (max-width: 375px) {
    .series-grid,
    .images-grid,
    .images-manage {
        gap: 8px;
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
}

/* 平板 / PC：限制内容宽度，多列展示，避免封面被拉得过大 */
@media (min-width: 768px) {
    .container:not(.admin-container) {
        max-width: 920px;
        margin-left: auto;
        margin-right: auto;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.12);
    }

    .series-grid,
    .images-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
        padding: 20px 22px;
    }

    .series-card {
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .series-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    }

    .series-card:active {
        transform: translateY(-1px) scale(0.99);
    }
}

@media (min-width: 1100px) {
    .container:not(.admin-container) {
        max-width: 1100px;
    }

    .series-grid,
    .images-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
        padding: 22px 24px;
    }
}

@media (min-width: 1400px) {
    .container:not(.admin-container) {
        max-width: 1280px;
    }

    .series-grid,
    .images-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
