:root {
    --bg-dark: #0b0c10;
    --panel-bg: #1f2833;
    --text-main: #c5c6c7;
    --text-muted: #66fcf1;
    --accent-blue: #45a29e;
    --accent-gold: #ffd700;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 复用 Header 样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(to bottom, rgba(31, 40, 51, 0.95), rgba(11, 12, 16, 0.95));
    border-bottom: 1px solid var(--accent-blue);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--text-muted);
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 14px;
}

.nav-btn:hover {
    background: rgba(69, 162, 158, 0.2);
    box-shadow: 0 0 10px rgba(69, 162, 158, 0.5);
}

/* 主容器 */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-blue);
    padding-left: 15px;
}

h2 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    text-shadow: 0 0 5px rgba(102, 252, 241, 0.3);
}

.instruction {
    font-size: 13px;
    color: var(--accent-blue);
    background: rgba(69, 162, 158, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(69, 162, 158, 0.3);
}

/* --- 修复台 --- */
.restoration-section {
    flex: 6;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(102, 252, 241, 0.1);
    display: flex;
    flex-direction: column;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    border: 2px solid #333;
    cursor: crosshair;
}

.restored-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 使用 CSS 渐变模拟龙纹背景 */
    background: radial-gradient(circle at 30% 50%, #1a2a3a 0%, #0b0c10 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* 用 CSS 绘制抽象龙纹 */
.glow-dragon {
    width: 300px;
    height: 150px;
    background-image:
        radial-gradient(circle at 50% 58%, rgba(255, 215, 0, 0.18) 0%, transparent 62%),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(102, 252, 241, 0.12) 10px, rgba(102, 252, 241, 0.12) 20px);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 30px var(--accent-gold), inset 0 0 20px var(--accent-blue);
    position: relative;
}

.glow-dragon::before,
.glow-dragon::after {
    content: '🐉';
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 92px;
    opacity: 0.95;
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.95)) drop-shadow(0 0 18px rgba(102, 252, 241, 0.25));
}

.glow-dragon::before {
    left: 32%;
    transform: translate(-50%, -50%) scaleX(-1) rotate(6deg);
}

.glow-dragon::after {
    left: 68%;
    transform: translate(-50%, -50%) rotate(-6deg);
}

.dragon-orb {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 20%, transparent 42%),
        radial-gradient(circle at 50% 55%, rgba(255, 215, 0, 0.95) 0%, rgba(255, 215, 0, 0.35) 35%, rgba(102, 252, 241, 0.15) 70%, transparent 100%);
    box-shadow:
        0 0 22px rgba(255, 215, 0, 0.85),
        0 0 36px rgba(102, 252, 241, 0.35),
        inset 0 0 14px rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 215, 0, 0.75);
    z-index: 2;
    animation: orb-pulse 1.6s ease-in-out infinite;
}

.dragon-orb::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid rgba(102, 252, 241, 0.35);
    box-shadow: 0 0 26px rgba(102, 252, 241, 0.25);
    opacity: 0.85;
}

@keyframes orb-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.12);
        filter: brightness(1.25);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }
}

.dragon-text {
    position: absolute;
    bottom: 20px;
    color: var(--accent-gold);
    font-family: "LiSu", serif;
    font-size: 24px;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transition: opacity 1s;
}

.progress-bar-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--accent-blue);
}

.progress-label {
    font-size: 12px;
    color: #ccc;
}

.progress-track {
    width: 150px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
    transition: width 0.1s;
    box-shadow: 0 0 10px var(--accent-blue);
}

.progress-text {
    font-family: monospace;
    color: var(--accent-gold);
    font-weight: bold;
    width: 40px;
    text-align: right;
}

/* --- 传说地图 --- */
.legend-section {
    flex: 4;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(102, 252, 241, 0.1);
    position: relative;
}

.bridge-map-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 380px;
}

.bridge-map {
    width: 100%;
    height: 100%;
    max-height: 380px;
}

.legend-hotspot {
    cursor: pointer;
    transition: all 0.3s;
}

.legend-hotspot:hover .core-dot {
    fill: var(--accent-gold);
    r: 8;
}

.legend-hotspot:hover .marker-label {
    fill: var(--accent-gold);
    font-weight: bold;
}

.core-dot {
    fill: var(--accent-blue);
    transition: all 0.3s;
}

.pulse-ring {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 1;
    opacity: 0.5;
    animation: pulseMap 2s infinite;
    transform-origin: center;
}

.marker-label {
    fill: var(--text-main);
    font-size: 12px;
    text-anchor: middle;
    opacity: 0.8;
}

@keyframes pulseMap {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* 传说卡片 */
.legend-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 300px;
    background: rgba(11, 12, 16, 0.95);
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    text-align: center;
}

.legend-card.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
}

.card-close:hover {
    color: #fff;
}

.card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
    background: #222;
}

.legend-card h3 {
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-family: "LiSu", serif;
}

.legend-card p {
    font-size: 13px;
    line-height: 1.6;
    color: #ccc;
    text-align: left;
}