/* ==========================================================================
   Game Guide Page - 游戏配置指南页面样式
   ========================================================================== */

/* ==========================================================================
   Page Header
   ========================================================================== */

.guide-header {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    transition: var(--transition-base);
}

.back-link:hover {
    color: var(--color-primary);
}

.guide-header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.game-icon-lg {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.game-icon-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-header-text h1 {
    font-size: 1.75rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 4px;
}

.guide-header-text .game-developer {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* ==========================================================================
   Layout - Sidebar + Content
   ========================================================================== */

.guide-layout {
    padding: var(--spacing-lg) 0;
}

.guide-layout-inner {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.guide-sidebar {
    position: sticky;
    top: calc(var(--header-height, 64px) + var(--spacing-md));
    max-height: calc(100vh - var(--header-height, 64px) - var(--spacing-lg));
    overflow-y: auto;
}

.guide-toc {
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.guide-toc-title {
    font-size: 0.8125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.guide-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-toc-item {
    margin-bottom: 2px;
}

.guide-toc-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.guide-toc-link:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.guide-toc-link.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

.guide-toc-indicator {
    width: 8px;
    height: 8px;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    flex-shrink: 0;
    transition: var(--transition-base);
}

.guide-toc-link.active .guide-toc-indicator {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.guide-content {
    min-width: 0;
}

.guide-section {
    margin-bottom: var(--spacing-xl);
    scroll-margin-top: calc(var(--header-height, 64px) + var(--spacing-md));
}

.guide-section-title {
    font-size: 1.375rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--color-primary);
}

.section-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

/* ==========================================================================
   Alert Boxes
   ========================================================================== */

.guide-alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.guide-alert-info {
    background: #EBF5FF;
    border-left-color: #3B82F6;
}

.guide-alert-warning {
    background: #FEF3C7;
    border-left-color: #F59E0B;
}

.guide-alert-danger {
    background: #FEE2E2;
    border-left-color: #EF4444;
}

.guide-alert-title {
    font-weight: var(--font-weight-semibold);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.guide-alert-info .guide-alert-title {
    color: #1D4ED8;
}

.guide-alert-warning .guide-alert-title {
    color: #B45309;
}

.guide-alert-danger .guide-alert-title {
    color: #B91C1C;
}

.guide-alert-text {
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ==========================================================================
   Key Mapping Table
   ========================================================================== */

.key-mapping-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.key-mapping-table th,
.key-mapping-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.key-mapping-table th {
    background: var(--color-bg-secondary);
    font-weight: var(--font-weight-medium);
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.key-mapping-table td {
    font-size: 0.9375rem;
}

.key-mapping-table tbody tr:hover {
    background: var(--color-bg-secondary);
}

.key-mapping-table tbody tr:last-child td {
    border-bottom: none;
}

.hotkey-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.hotkey-none {
    color: var(--color-text-secondary);
}

/* ==========================================================================
   Steps List
   ========================================================================== */

.steps-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.step-item {
    display: flex;
    gap: var(--spacing-md);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 8px;
}

.step-description {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
    white-space: pre-line;
}

/* ==========================================================================
   Step Image with Hotspots
   ========================================================================== */

.step-image-container {
    position: relative;
    margin-top: var(--spacing-sm);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.step-image {
    width: 100%;
    height: auto;
    display: block;
}

.hotspot {
    position: absolute;
    z-index: 10;
}

.hotspot-dot {
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    animation: hotspot-pulse 2s ease-in-out infinite;
}

@keyframes hotspot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hotspot-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 11;
}

/* Hotspot directions */
.hotspot-right .hotspot-label {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.hotspot-left .hotspot-label {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.hotspot-top .hotspot-label {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.hotspot-bottom .hotspot-label {
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.faq-item {
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item[open] {
    border-color: var(--color-primary);
}

.faq-question {
    padding: var(--spacing-md);
    cursor: pointer;
    font-weight: var(--font-weight-medium);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    transition: var(--transition-base);
}

.faq-item[open] .faq-question::after {
    content: '−';
    color: var(--color-primary);
}

.faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .guide-layout-inner {
        grid-template-columns: 1fr;
    }
    
    .guide-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 100;
        max-height: none;
        padding: var(--spacing-sm);
        background: white;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .guide-toc {
        border: none;
        padding: 0;
        background: transparent;
    }
    
    .guide-toc-title {
        display: none;
    }
    
    .guide-toc-list {
        display: flex;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .guide-toc-list::-webkit-scrollbar {
        display: none;
    }
    
    .guide-toc-link {
        white-space: nowrap;
        padding: 8px 16px;
        background: var(--color-bg-secondary);
    }
    
    .guide-toc-link.active {
        background: var(--color-primary);
        color: white;
    }
    
    .guide-toc-indicator {
        display: none;
    }
    
    .guide-content {
        padding-bottom: 80px;
    }
    
    .guide-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .guide-header-text h1 {
        font-size: 1.5rem;
    }
    
    .key-mapping-table {
        display: block;
        overflow-x: auto;
    }
    
    .step-item {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 600px) {
    .guide-header {
        padding: var(--spacing-md) 0;
    }
    
    .game-icon-lg {
        width: 64px;
        height: 64px;
    }
    
    .guide-section-title {
        font-size: 1.25rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .hotspot-label {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}
