/**
 * 交互式城门转盘组件样式 - 中心指针版本
 */

/* ===== 转盘区块 ===== */
.wheel-section {
    padding: 5rem 2rem;
    background: linear-gradient(180deg, #f8f6f1 0%, #f0ece3 100%);
    overflow: hidden;
    position: relative;
}

.wheel-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(201, 169, 97, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 69, 19, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.wheel-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ===== 转盘包装器 ===== */
.wheel-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
}

/* ===== 转盘主体 ===== */
.wheel {
    position: relative;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    user-select: none;
}

/* 转盘背景 */
.wheel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 0 0 12px #d4b896,
        0 0 0 16px rgba(212, 184, 150, 0.3),
        inset 0 0 80px rgba(139, 69, 19, 0.03);
}

/* 转盘装饰圈 */
.wheel-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 2px dashed rgba(139, 69, 19, 0.2);
    pointer-events: none;
}

/* ===== 固定指针 ===== */
.fixed-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    z-index: 20;
    pointer-events: none;
}

.fixed-pointer .pointer-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 70px solid #c44d34;
    transform: translate(-50%, -100%) rotate(0deg);
    transform-origin: center bottom;
    filter: drop-shadow(0 3px 6px rgba(196, 77, 52, 0.4));
    animation: pointerPulse 2s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-pointer .pointer-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #c44d34;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(196, 77, 52, 0.4);
}

@keyframes pointerPulse {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(196, 77, 52, 0.4));
    }
    50% {
        filter: drop-shadow(0 4px 8px rgba(196, 77, 52, 0.6));
    }
}

/* ===== 转盘项目 ===== */
.wheel-items {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wheel-item {
    position: absolute;
    width: 110px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

/* 南门 - 底部，中心与转盘边缘相切 */
.wheel-item[data-gate="south"] {
    bottom: -55px;
    left: 50%;
    transform: translateX(-50%);
}

/* 东门 - 右侧，中心与转盘边缘相切 */
.wheel-item[data-gate="east"] {
    right: -55px;
    top: 50%;
    transform: translateY(-50%);
}

/* 北门 - 顶部，中心与转盘边缘相切 */
.wheel-item[data-gate="north"] {
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
}

/* 西门 - 左侧，中心与转盘边缘相切 */
.wheel-item[data-gate="west"] {
    left: -55px;
    top: 50%;
    transform: translateY(-50%);
}

.item-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    width: 100%;
}

.wheel-item:hover .item-marker,
.wheel-item.active .item-marker {
    transform: scale(1.08);
    border-color: #c44d34;
    box-shadow: 0 8px 25px rgba(196, 77, 52, 0.2);
}

.wheel-item.active .item-marker {
    background: linear-gradient(135deg, #fff 0%, #fef6f4 100%);
}

/* 城门图片 */
.item-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e8e0d0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wheel-item:hover .item-image,
.wheel-item.active .item-image {
    border-color: #c44d34;
    box-shadow: 0 4px 15px rgba(196, 77, 52, 0.25);
}

.wheel-item:hover .item-image img,
.wheel-item.active .item-image img {
    transform: scale(1.1);
}

/* 城门标签 */
.item-label {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
    color: #5a4a3a;
    white-space: nowrap;
    margin-top: 4px;
}

.item-direction {
    font-size: 12px;
    color: #8b7355;
    padding: 3px 10px;
    background: #f5f0e8;
    border-radius: 12px;
    font-weight: 500;
}

/* ===== 拖拽提示 ===== */
.wheel-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.wheel.dragging .wheel-hint {
    opacity: 0;
}

.hint-icon {
    font-size: 2.5rem;
    animation: hintBounce 1.5s ease-in-out infinite;
}

.hint-text {
    font-size: 13px;
    color: #8b7355;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-weight: 500;
}

@keyframes hintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== 信息面板 ===== */
.info-panel {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e8e0d0;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, #c44d34 0%, #d4654a 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.panel-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.panel-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.panel-title-group {
    flex: 1;
    position: relative;
    z-index: 1;
}

.panel-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.panel-direction {
    font-size: 14px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-direction::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
}

.panel-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.info-panel:hover .panel-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.panel-content {
    padding: 1.75rem;
}

.panel-description {
    font-size: 15px;
    line-height: 1.9;
    color: #4a4035;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #e8e0d0;
}

.panel-features,
.panel-history {
    margin-bottom: 1.5rem;
}

.panel-features h4,
.panel-history h4 {
    font-family: var(--font-serif);
    font-size: 16px;
    color: #8b4513;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.panel-features h4::before,
.panel-history h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, #c44d34, #d4654a);
    border-radius: 2px;
}

.feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.feature-list li {
    font-size: 13px;
    color: #6b5d4d;
    padding: 8px 12px;
    background: #f8f6f1;
    border-radius: 10px;
    position: relative;
    line-height: 1.5;
    border-left: 3px solid #d4b896;
    transition: all 0.3s ease;
}

.feature-list li:hover {
    background: #f0ece3;
    transform: translateX(4px);
}

.panel-history p {
    font-size: 14px;
    color: #6b5d4d;
    line-height: 1.8;
    padding: 12px 16px;
    background: #f8f6f1;
    border-radius: 12px;
    border-left: 3px solid #c44d34;
}

.panel-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, #f8f6f1 0%, #f0ece3 100%);
    color: #8b4513;
    font-weight: 600;
    transition: all 0.3s ease;
    border-top: 1px solid #e8e0d0;
    font-size: 15px;
    cursor: pointer;
}

.panel-link:hover {
    background: linear-gradient(135deg, #c44d34 0%, #d4654a 100%);
    color: #fff;
}

.panel-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.panel-link:hover svg {
    transform: translateX(6px);
}

/* ===== 面板过渡动画 ===== */
.info-panel.transitioning .panel-content {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

.info-panel.transitioning .panel-image img {
    opacity: 0.6;
    transform: scale(1.02);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .wheel-container {
        gap: 3rem;
    }
    
    .wheel {
        width: 400px;
        height: 400px;
    }
    
    .wheel-ring {
        width: 340px;
        height: 340px;
    }
    
    .fixed-pointer {
        width: 50px;
        height: 50px;
    }
    
    .fixed-pointer .pointer-arrow {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 55px solid #c44d34;
    }
}

@media (max-width: 992px) {
    .wheel-section {
        padding: 4rem 1.5rem;
    }
    
    .wheel-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .wheel-wrapper {
        min-height: 450px;
        order: 1;
    }
    
    .info-panel {
        order: 2;
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }
    
    .wheel {
        width: 380px;
        height: 380px;
    }
    
    .wheel-ring {
        width: 320px;
        height: 320px;
    }
    
    .wheel-item {
        width: 100px;
        height: 120px;
    }
    
    .item-image {
        width: 65px;
        height: 65px;
    }
    
    .panel-image {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .wheel-section {
        padding: 3rem 1rem;
    }
    
    .wheel-wrapper {
        min-height: 380px;
    }
    
    .wheel {
        width: 320px;
        height: 320px;
    }
    
    .wheel-bg {
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.1),
            0 0 0 8px #d4b896,
            0 0 0 12px rgba(212, 184, 150, 0.3),
            inset 0 0 50px rgba(139, 69, 19, 0.03);
    }
    
    .wheel-ring {
        width: 270px;
        height: 270px;
    }
    
    .fixed-pointer {
        width: 45px;
        height: 45px;
    }
    
    .fixed-pointer .pointer-arrow {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 45px solid #c44d34;
    }
    
    .fixed-pointer .pointer-dot {
        width: 16px;
        height: 16px;
        border-width: 3px;
    }
    
    .wheel-item {
        width: 85px;
        height: 105px;
    }
    
    .wheel-item[data-gate="south"] {
        bottom: -45px;
    }
    
    .wheel-item[data-gate="east"] {
        right: -45px;
    }
    
    .wheel-item[data-gate="north"] {
        top: -45px;
    }
    
    .wheel-item[data-gate="west"] {
        left: -45px;
    }
    
    .item-marker {
        padding: 8px 6px;
        border-radius: 12px;
    }
    
    .item-image {
        width: 55px;
        height: 55px;
        border-width: 2px;
    }
    
    .item-label {
        font-size: 12px;
    }
    
    .item-direction {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .panel-header {
        padding: 1.25rem;
    }
    
    .panel-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    
    .panel-title {
        font-size: 1.5rem;
    }
    
    .panel-image {
        height: 180px;
    }
    
    .panel-content {
        padding: 1.25rem;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .panel-description {
        font-size: 14px;
    }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) {
    .wheel {
        cursor: default;
    }
    
    .wheel:active {
        cursor: default;
    }
    
    .wheel-hint {
        opacity: 0.8;
    }
    
    .wheel.dragging .wheel-hint {
        opacity: 0;
    }
    
    .item-marker {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    .wheel {
        transition: none;
    }
    
    .pointer-arrow {
        animation: none;
    }
    
    .hint-icon {
        animation: none;
    }
    
    .info-panel {
        transition: none;
    }
    
    .wheel-item,
    .item-marker {
        transition: none;
    }
}
