/**
 * 成员卷轴模式 v3.0 - 古风卷轴质感
 * 独立功能模块，不依赖任何其他模块
 */

/* ========== 模式切换按钮 ========== */
.members-mode-toggle {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
}

.mode-toggle-btn {
    background: linear-gradient(135deg, #2a1f14 0%, #1a1209 100%);
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: #d4af37;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    letter-spacing: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(212,175,55,0.1);
}

.mode-toggle-btn:hover {
    background: linear-gradient(135deg, #3a2a1a 0%, #2a1f14 100%);
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), 0 2px 8px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

/* ========== 卷轴模式容器 ========== */
.scroll-mode-container {
    display: none;
    width: 100%;
    min-height: 600px;
    position: relative;
}

.scroll-mode-container.active {
    display: block;
}

.members-grid.scroll-hidden { display: none !important; }

/* ========== 整体标题 ========== */
.scroll-header {
    text-align: center;
    padding: 20px 0 30px;
}

.scroll-header h2 {
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 32px;
    color: #d4af37;
    margin: 0;
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(212,175,55,0.3), 0 2px 4px rgba(0,0,0,0.5);
    position: relative;
    display: inline-block;
}

.scroll-header h2::before,
.scroll-header h2::after {
    content: '✦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #d4af37;
    text-shadow: 0 0 8px rgba(212,175,55,0.6), 0 0 20px rgba(212,175,55,0.3);
}
.scroll-header h2::before { left: -30px; }
.scroll-header h2::after { right: -30px; }

/* ========== 主布局：左详情 + 右卷轴列表 ========== */
.scroll-main-layout {
    display: flex;
    gap: 30px;
    align-items: center;
    padding: 10px 28px 0;
    min-width: 0;
}

/* ========== 左侧详情面板 ========== */
.scroll-detail-panel {
    flex: 0 0 400px;
    min-height: 560px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid rgba(212,175,55,0.4);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 30px rgba(212,175,55,0.08);
    background: #1a1209;
}

.scroll-detail-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.scroll-detail-bg.active {
    opacity: 1;
}

.scroll-detail-panel:hover .scroll-detail-bg.active {
    transform: scale(1.03);
}

/* 多图指示器 */
.scroll-img-dots {
    position: absolute;
    bottom: 16px;
    right: 24px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.s-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 1.5px solid rgba(212,175,55,0.6);
    transition: all 0.3s ease;
    cursor: pointer;
}

.s-dot:hover:not(.active) {
    background: rgba(212,175,55,0.5);
    transform: scale(1.2);
}

.s-dot.active {
    background: #d4af37;
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212,175,55,0.5);
    transform: scale(1.3);
}

.scroll-detail-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top,
        rgba(15, 10, 5, 0.98) 0%,
        rgba(15, 10, 5, 0.85) 25%,
        rgba(15, 10, 5, 0.4) 55%,
        rgba(15, 10, 5, 0.1) 80%,
        transparent 100%);
}

/* 内边框装饰 */
.scroll-detail-panel::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
}

/* 角落装饰 */
.scroll-detail-panel::after {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border-radius: 10px;
    background:
        radial-gradient(circle at top left, rgba(212,175,55,0.15) 0%, transparent 30%),
        radial-gradient(circle at top right, rgba(212,175,55,0.1) 0%, transparent 25%);
    z-index: 1;
    pointer-events: none;
}

/* 身份标签 */
.scroll-detail-badge {
    display: inline-block;
    margin-top: 6px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.5);
    padding: 5px 18px;
    border-radius: 3px;
    font-size: 15px;
    color: #d4af37;
    letter-spacing: 3px;
    backdrop-filter: blur(10px);
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
}

/* 详情按钮 */
.scroll-detail-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
}

.scroll-action-btn {
    background: rgba(212,175,55,0.25);
    border: 1px solid rgba(212,175,55,0.7);
    padding: 2px 4px;
    border-radius: 12px;
    font-size: 15px;
    color: #fff5d4;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    margin-left: 6px;
    backdrop-filter: blur(10px);
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.scroll-action-btn:hover {
    background: rgba(212,175,55,0.3);
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212,175,55,0.3);
}

/* 详情文字内容 */
.scroll-detail-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px;
    z-index: 2;
}

.scroll-detail-name {
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 40px;
    font-weight: 400;
    color: #d4af37;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 15px rgba(0,0,0,0.8);
    letter-spacing: 5px;
}

.scroll-detail-quote {
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 15px;
    color: #c9a96e;
    margin: 0 0 14px 0;
    line-height: 1.8;
    padding-left: 14px;
    border-left: 2px solid rgba(212,175,55,0.5);
    font-style: italic;
}

.scroll-detail-desc {
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 右侧卷轴列表 ========== */
.scroll-list-panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 20px;
    overflow: auto;
    position: relative;
    min-height: 660px;
    background: transparent;
}

/* 移除左右轴头装饰 */
.scroll-list-panel::before {
    display: none;
}

.scroll-list-panel::after {
    display: none;
}

/* 卡片之间的滚筒 - 隐藏 */
.scroll-roller {
    display: none;
}

/* 翻页三个点按钮 */
.scroll-more-dots {
    width: 40px;
    height: 600px;
    min-width: 40px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-more-dots:hover {
    background: rgba(212,175,55,0.2);
    transform: scale(1.05);
}

.scroll-more-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4af37;
    box-shadow: 0 0 6px rgba(212,175,55,0.5);
    animation: dotsBreathe 2s ease-in-out infinite;
}

.scroll-more-dots span:nth-child(2) { animation-delay: 0.3s; }
.scroll-more-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotsBreathe {
    0%, 100% { opacity: 0.2; box-shadow: 0 0 2px rgba(212,175,55,0.1); }
    50% { opacity: 1; box-shadow: 0 0 8px rgba(212,175,55,0.8), 0 0 16px rgba(212,175,55,0.3); }
}

/* 自定义滚动条 - 古风样式 */
.scroll-list-panel::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.scroll-list-panel::-webkit-scrollbar-track {
    background: rgba(26,18,9,0.5);
    border-radius: 3px;
}
.scroll-list-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212,175,55,0.4), rgba(212,175,55,0.2));
    border-radius: 3px;
}
.scroll-list-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(212,175,55,0.6), rgba(212,175,55,0.3));
}

/* 收起/展开按钮 */
.scroll-collapse-action {
    background: linear-gradient(135deg, rgba(139,115,85,0.3), rgba(90,70,50,0.5)) !important;
    border: 1px solid rgba(139,115,85,0.5) !important;
}

.scroll-collapse-action:hover {
    background: linear-gradient(135deg, rgba(139,115,85,0.5), rgba(110,90,60,0.7)) !important;
    border-color: rgba(212,175,55,0.6) !important;
}

/* 收起时居中布局 */
.scroll-main-layout.collapsed {
    justify-content: center;
}

.scroll-main-layout.collapsed .scroll-list-panel {
    flex: 0 1 auto;
    justify-content: center;
}

/* ========== 单个卷轴卡片 ========== */
.scroll-card {
    width: 55px;
    height: 600px;
    min-width: 55px;
    flex-shrink: 0;
    position: relative;
    border-radius: 28px / 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(160,138,101,0.5);
    background: #2a1f14;
    /* 圆柱立体阴影 */
    box-shadow: inset 6px 0 10px rgba(0,0,0,0.4), inset -6px 0 10px rgba(0,0,0,0.4), 0 4px 15px rgba(0,0,0,0.5);
}

/* 卷轴顶部金箍装饰 - 金属光泽 + 仿轴头 */
.scroll-card::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 2px;
    right: 2px;
    height: 1px;
    z-index: 5;
    background: linear-gradient(90deg,
        rgba(139,115,50,0.2) 2%,
        rgba(212,175,55,0.5) 12%,
        #c9a030 30%,
        #f5e07a 50%,
        #c9a030 68%,
        rgba(212,175,55,0.5) 88%,
        rgba(139,115,50,0.2) 98%);
    box-shadow:
        0 0 5px rgba(212,175,55,0.25),
        0 4px 0 0 rgba(180,150,50,0.4),
        0 5px 3px rgba(0,0,0,0.4),
        /* 左轴头: 暗底托 + 亮金属点 */
        -1px 0 0 2.5px rgba(40,28,10,0.85),
        -1px 0 0 1px #d4af37,
        /* 右轴头: 暗底托 + 亮金属点 */
        1px 0 0 2.5px rgba(40,28,10,0.85),
        1px 0 0 1px #d4af37;
}

/* 卷轴底部金箍装饰 - 金属光泽 + 仿轴头 */
.scroll-card::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 2px;
    right: 2px;
    height: 1px;
    z-index: 5;
    background: linear-gradient(90deg,
        rgba(139,115,50,0.2) 2%,
        rgba(212,175,55,0.5) 12%,
        #c9a030 30%,
        #f5e07a 50%,
        #c9a030 68%,
        rgba(212,175,55,0.5) 88%,
        rgba(139,115,50,0.2) 98%);
    box-shadow:
        0 0 5px rgba(212,175,55,0.25),
        0 -4px 0 0 rgba(180,150,50,0.4),
        0 -5px 3px rgba(0,0,0,0.4),
        /* 左轴头 */
        -1px 0 0 2.5px rgba(40,28,10,0.85),
        -1px 0 0 1px #d4af37,
        /* 右轴头 */
        1px 0 0 2.5px rgba(40,28,10,0.85),
        1px 0 0 1px #d4af37;
}

.scroll-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: inset 8px 0 12px rgba(0,0,0,0.3), inset -8px 0 12px rgba(0,0,0,0.3), 0 12px 30px rgba(0,0,0,0.5);
    border-color: #d4af37;
}

.scroll-card.active {
    width: 160px;
    min-width: 160px;
    border: 2px solid #d4af37;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(212,175,55,0.3), 0 8px 25px rgba(0,0,0,0.5);
}

.scroll-card.active::before {
    left: 6px;
    right: 6px;
    box-shadow:
        0 0 7px rgba(212,175,55,0.4),
        0 4px 0 0 rgba(180,150,50,0.5),
        0 5px 3px rgba(0,0,0,0.4),
        -1px 0 0 3px rgba(40,28,10,0.9),
        -1px 0 0 1.5px #e8c840,
        1px 0 0 3px rgba(40,28,10,0.9),
        1px 0 0 1.5px #e8c840;
}

.scroll-card.active::after {
    left: 6px;
    right: 6px;
    box-shadow:
        0 0 7px rgba(212,175,55,0.4),
        0 -4px 0 0 rgba(180,150,50,0.5),
        0 -5px 3px rgba(0,0,0,0.4),
        -1px 0 0 3px rgba(40,28,10,0.9),
        -1px 0 0 1.5px #e8c840,
        1px 0 0 3px rgba(40,28,10,0.9),
        1px 0 0 1.5px #e8c840;
}

/* 卷轴背景图 */
.scroll-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    border-radius: inherit;
    opacity: 0.85;
    transition: all 0.4s ease;
}

.scroll-card:hover .scroll-card-bg {
    opacity: 1;
}

.scroll-card.active .scroll-card-bg {
    opacity: 1;
    border-radius: 12px;
}

/* 卷轴上的轻度渐变 */
.scroll-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0) 60%,
        rgba(0,0,0,0.6) 100%);
    z-index: 1;
    border-radius: inherit;
}

/* 文字区域 - 紧凑居中，身份标签固定高度保证对齐 */
.scroll-card-text {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* 身份标签：固定高度=52px（容纳2字），内部文字顶部对齐 */
.scroll-card-order {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 52px;
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 24px;
    color: #d4af37;
    letter-spacing: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 8px rgba(212,175,55,0.4);
    white-space: nowrap;
}

/* 分隔符 */
.scroll-card-sep {
    font-size: 24px;
    color: #f0c040;
    text-shadow: 0 0 12px rgba(212,175,55,1), 0 0 5px rgba(255,200,50,0.9);
    line-height: 1;
    font-weight: bold;
}

/* 名字：固定高度=120px（容纳最多4字），内部文字顶部对齐 */
.scroll-card-name {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 120px;
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 26px;
    color: #e8d5a0;
    font-weight: 400;
    letter-spacing: 6px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 12px rgba(212,175,55,0.5);
    line-height: 1.5;
    white-space: nowrap;
}

/* 选中时保持同样布局 */
.scroll-card.active .scroll-card-text {
    gap: 4px;
}

.scroll-card:hover .scroll-card-name {
    color: #fff5d4;
    text-shadow: 0 0 12px rgba(212,175,55,0.6), 0 1px 8px rgba(0,0,0,0.8);
}

.scroll-card.active .scroll-card-order {
    font-size: 30px;
    height: 66px;
    letter-spacing: 5px;
}

.scroll-card.active .scroll-card-sep {
    font-size: 28px;
}

.scroll-card.active .scroll-card-name {
    color: #f0e0b0;
    font-size: 32px;
    height: 150px;
    letter-spacing: 8px;
    text-shadow: 0 0 12px rgba(212,175,55,0.6), 0 1px 10px rgba(0,0,0,0.8);
}

/* ========== 分页 ========== */
.scroll-pagination {
    text-align: center;
    padding: 20px 0 10px;
    color: rgba(212,175,55,0.6);
    font-size: 14px;
    letter-spacing: 3px;
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
}

.scroll-pagination button {
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.3);
    color: #d4af37;
    padding: 6px 16px;
    border-radius: 15px;
    cursor: pointer;
    margin: 0 8px;
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    transition: all 0.3s;
}

.scroll-pagination button:hover {
    background: rgba(212,175,55,0.2);
    border-color: #d4af37;
}

.scroll-pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== 空状态 ========== */
.scroll-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(212,175,55,0.4);
}

.scroll-empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.4;
}

.scroll-empty p {
    font-family: 'Ma Shan Zheng', cursive, 'SimHei', 'STHeiti', sans-serif;
    font-size: 16px;
    letter-spacing: 3px;
}

/* ========== 动画 ========== */
@keyframes scrollUnfurl {
    from { opacity: 0; transform: translateY(20px) scaleY(0.9); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
}

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

.scroll-mode-container.active .scroll-detail-panel {
    animation: scrollFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-mode-container.active .scroll-card {
    animation: scrollUnfurl 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: both;
}

.scroll-mode-container.active .scroll-card:nth-child(1) { animation-delay: 0.05s; }
.scroll-mode-container.active .scroll-card:nth-child(2) { animation-delay: 0.1s; }
.scroll-mode-container.active .scroll-card:nth-child(3) { animation-delay: 0.15s; }
.scroll-mode-container.active .scroll-card:nth-child(4) { animation-delay: 0.2s; }
.scroll-mode-container.active .scroll-card:nth-child(5) { animation-delay: 0.25s; }
.scroll-mode-container.active .scroll-card:nth-child(6) { animation-delay: 0.3s; }
.scroll-mode-container.active .scroll-card:nth-child(7) { animation-delay: 0.35s; }
.scroll-mode-container.active .scroll-card:nth-child(8) { animation-delay: 0.4s; }
.scroll-mode-container.active .scroll-card:nth-child(9) { animation-delay: 0.45s; }
.scroll-mode-container.active .scroll-card:nth-child(10) { animation-delay: 0.5s; }
.scroll-mode-container.active .scroll-card:nth-child(n+11) { animation-delay: 0.55s; }

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .scroll-detail-panel { flex: 0 0 350px; min-height: 500px; }
    .scroll-detail-name { font-size: 28px; }
    .scroll-card { width: 50px; height: 520px; min-width: 50px; }
    .scroll-card.active { width: 140px; min-width: 140px; }
    .scroll-more-dots { width: 40px; height: 520px; min-width: 40px; }
}

@media (max-width: 992px) {
    .scroll-main-layout { flex-direction: column; }
    .scroll-detail-panel { flex: none; width: 100%; min-height: 400px; }
    .scroll-list-panel { max-height: none; overflow: auto; padding: 16px 20px; width: 100%; align-self: stretch; }
    .scroll-card { width: 45px; height: 460px; min-width: 45px; }
    .scroll-card.active { width: 130px; min-width: 130px; }
    .scroll-more-dots { width: 40px; height: 460px; min-width: 40px; }
}

@media (max-width: 576px) {
    .scroll-header h2 { font-size: 24px; letter-spacing: 4px; }
    .scroll-detail-panel { min-height: 350px; }
    .scroll-detail-name { font-size: 22px; letter-spacing: 2px; }
    .scroll-detail-content { padding: 20px; }
    .scroll-card { width: 40px; height: 380px; min-width: 40px; }
    .scroll-card.active { width: 110px; min-width: 110px; }
    .scroll-card-name { font-size: 11px; }
    .scroll-list-panel { gap: 4px; }
    .scroll-more-dots { width: 35px; height: 380px; min-width: 35px; }
}
