* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

#app { min-height: 100vh; }

.page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.page-content {
    max-width: 700px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.page-title {
    font-size: 24px;
    color: #1a73e8;
    margin-bottom: 20px;
    text-align: center;
}

h1, h2, h3 { color: #1a73e8; }
p { margin-bottom: 12px; text-indent: 0; }
ul, ol { margin: 12px 0 12px 24px; }
li { margin-bottom: 6px; }
strong { font-weight: bold; }
.hint { color: #666; font-size: 14px; }
.instruction { font-style: italic; color: #555; margin-bottom: 16px; }

.btn {
    display: inline-block;
    padding: 12px 36px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}

.btn-primary:hover { background: #1557b0; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-container {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.consent-box, .debriefing-box, .transition-box, .dictator-box, .concept-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
}

.consent-check, .quiz-option {
    display: block;
    margin: 8px 0;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.consent-check:hover, .quiz-option:hover { background: #e8f0fe; }

.warning {
    color: #d32f2f;
    background: #fff3e0;
    padding: 10px 16px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 14px;
}

.likert-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    table-layout: fixed;
}

.likert-table th, .likert-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.likert-header {
    font-size: 11px;
    font-weight: normal;
    color: #555;
    width: 11%;
    vertical-align: bottom;
    word-wrap: break-word;
}

.likert-item {
    text-align: left !important;
    font-size: 14px;
    width: 30%;
}

.likert-cell {
    cursor: pointer;
    width: 11%;
}
.likert-cell:hover { background: #e8f0fe; }
.likert-cell input[type="radio"] { cursor: pointer; }

.quiz-container { margin: 16px 0; }
.quiz-question {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
}
.quiz-text { font-weight: 500; margin-bottom: 8px; }
.quiz-wrong { border: 2px solid #f44336; background: #fff3e0; }

.chessboard-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 400px;
    height: 400px;
    border: 3px solid #333;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 32px;
    user-select: none;
}

.square.light { background: #f0d9b5; }
.square.dark { background: #b58863; }
.square.interactive { cursor: pointer; }

.white-piece { color: #fff; text-shadow: 0 0 2px #000, 1px 1px 2px #000; }
.black-piece { color: #222; }

.square.selected { background: #ffd54f !important; }
.square.legal-move::after {
    content: "";
    position: absolute;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(46, 125, 50, 0.45);
}

.square.advice-from, .square.advice-to {
    box-shadow: inset 0 0 0 4px #2196f3;
    background: rgba(33, 150, 243, 0.15) !important;
}

.coord {
    position: absolute;
    font-size: 10px;
    color: rgba(0,0,0,0.4);
    pointer-events: none;
}
.coord-rank { top: 2px; left: 3px; }
.coord-file { bottom: 1px; right: 3px; }

.puzzle-header { text-align: center; margin-bottom: 12px; }
.round-badge {
    display: inline-block;
    background: #1a73e8;
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}
.puzzle-instruction {
    text-align: center;
    color: #555;
    margin-bottom: 12px;
}

.advice-box {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    font-size: 15px;
}
.ai-advice { border-color: #7c4dff; background: #ede7f6; }
.human-advice { border-color: #2e7d32; background: #e8f5e9; }

.no-advice-box {
    background: #f5f5f5;
    border: 1px dashed #999;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    text-align: center;
    color: #666;
}

.feedback-box {
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    font-size: 15px;
}
.feedback-correct { background: #e8f5e9; border: 2px solid #4caf50; }
.feedback-incorrect { background: #fff3e0; border: 2px solid #ff9800; }

.dictator-slider { margin: 24px 0; text-align: center; }
.slider {
    width: 80%;
    max-width: 400px;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 12px 0;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.slider-display { font-size: 18px; margin: 8px 0; }

.demo-form, .probe-form, .compliance-form { margin: 16px 0; }
.form-row {
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.form-row label:first-child { font-weight: 500; display: block; margin-bottom: 6px; }
.text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.slider-row { margin: 12px 0; text-align: center; }

.mc-question {
    margin-bottom: 24px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}
.mc-text { font-weight: 500; margin-bottom: 8px; }

.group-assignment {
    text-align: center;
    padding: 24px;
    background: #e8f0fe;
    border-radius: 12px;
    margin: 16px 0;
}
.group-assignment p { font-size: 18px; }

.tutorial-board-demo, #piece-demo-board, #practice-board, #puzzle-board {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    width: 100%;
}
.tutorial-board-demo, #piece-demo-board, #practice-board {
    max-width: 480px;
}

.piece-name { font-size: 22px; font-weight: 600; color: #1a73e8; text-align: center; }
.interface-guide { margin: 16px 0; }

.complete-page {
    text-align: center;
    padding: 60px 20px;
}
.complete-page h1 { font-size: 32px; margin-bottom: 16px; }

@media (max-width: 600px) {
    .page-content { padding: 20px; }
    .page-title { font-size: 20px; }
    .likert-header { font-size: 9px; }
    .likert-item { font-size: 12px; }
    @media (max-width: 500px) { .chessboard { width: 300px; height: 300px; } .square { font-size: 24px; } }
}

/* === Piece Reference Sidebar === */
.puzzle-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.puzzle-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 540px;
}
.piece-ref-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.piece-ref-toggle {
    background: #1a73e8;
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    user-select: none;
    transition: background 0.2s;
}
.piece-ref-toggle:hover { background: #1557b0; }
.piece-ref-body {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.piece-ref-item {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    gap: 2px;
}
.piece-ref-item:last-child { border-bottom: none; }
.piece-ref-symbol {
    font-size: 28px;
    line-height: 1;
    color: #333;
}
.piece-ref-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a73e8;
}
.piece-ref-rule {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}


/* === Secondary Button === */
.btn-secondary {
    background: #555;
    color: #fff;
}
.btn-secondary:hover { background: #333; }

/* === Responsive === */
@media (max-width: 800px) {
    .puzzle-layout {
        flex-direction: column;
    }
    .piece-ref-sidebar {
        width: 100%;
        position: static;
    }
    .piece-ref-body {
        max-height: 200px;
    }
}

/* === Board Animation Demo === */
.square.hl-from {
    box-shadow: inset 0 0 0 4px #ff9800 !important;
    background: rgba(255, 152, 0, 0.2) !important;
}
.square.hl-to {
    box-shadow: inset 0 0 0 4px #ff9800 !important;
    background: rgba(255, 152, 0, 0.3) !important;
}
.piece {
    transition: transform 0.3s ease;
}
.step-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: 8px;
    background: #e3f2fd;
    margin-top: 8px;
}
.step-info .step-label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}
.step-info .step-san {
    font-weight: 700;
    color: #1a73e8;
    font-size: 16px;
}
.step-info .step-desc {
    font-size: 14px;
    color: #333;
}
.step-final {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #2e7d32;
}

/* === Puzzle Status (Multi-turn) === */
.puzzle-status {
    min-height: 50px;
    margin: 12px 0;
}
.puzzle-status .step-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-radius: 10px;
    background: #e3f2fd;
    border-left: 4px solid #1a73e8;
}
.step-icon {
    font-size: 18px;
    font-weight: bold;
}
.step-final {
    background: #e8f5e9 !important;
    border-color: #4caf50 !important;
    color: #2e7d32;
    font-weight: 600;
    font-size: 16px;
    justify-content: center;
}

/* === Move Arrow Overlay === */
.arrow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}
.arrow-overlay line {
    stroke: #2196f3;
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0.8;
    stroke-dasharray: 8 4;
    animation: dash-flow 1s linear infinite;
}
.arrow-overlay polygon {
    fill: #2196f3;
    opacity: 0.9;
}
@keyframes dash-flow {
    to { stroke-dashoffset: -12; }
}
/* 建议使用回顾 - 依赖程度滑块 */
.rely-slider-row {
    max-width: 500px;
    margin: 20px auto;
    position: relative;
    padding: 0 12px;
}
.rely-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}
.rely-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 11px;
    margin-bottom: -4px;
    position: relative;
    z-index: 1;
}
.rely-ticks .tick {
    width: 2px;
    height: 12px;
    background: #ccc;
    border-radius: 1px;
}
.rely-slider {
    width: 100%;
    max-width: 500px;
}
.rely-value-display {
    text-align: center;
    font-size: 16px;
    margin-top: 10px;
    color: #333;
}
.rely-value-display strong {
    color: #1a73e8;
    font-size: 20px;
}
\n.completion-code-box{text-align:center;margin:24px auto;padding:20px;background:#e3f2fd;border-radius:12px;max-width:400px}\n.code-display{font-size:28px;font-weight:bold;letter-spacing:3px;color:#1565c0;background:#fff;padding:12px;border-radius:8px;margin:12px 0;font-family:monospace}\n.code-hint{font-size:13px;color:#666;margin-top:8px}