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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
    overflow: hidden;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h1 {
    font-size: 28px;
    margin: 0;
}

.game-info {
    display: flex;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item .label {
    font-size: 14px;
    opacity: 0.9;
}

.info-item .value {
    font-size: 18px;
    font-weight: bold;
}

.game-main {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f5f5f5;
    flex: 1;
    overflow: hidden;
}

.game-area {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

#gameCanvas {
    background: #fff8dc;
    border: 3px solid #8b4513;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 5px;
}

.start-content,
.game-over-content {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.start-content h2,
.game-over-content h2 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 10px;
}

.game-over-header {
    position: relative;
    margin-bottom: 15px;
}

.game-over-header h2 {
    margin: 0;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.close-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-over-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.start-content p,
.game-over-content p {
    color: #666;
    margin: 10px 0 20px;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.mode-btn .btn-icon {
    font-size: 24px;
}

.mode-btn .btn-text {
    font-size: 18px;
}

.difficulty-selector {
    margin-top: 20px;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.difficulty-btn {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #7f8c8d;
}

.restart-btn,
.menu-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    flex: 1;
    min-width: 120px;
}

.restart-btn:hover,
.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.menu-btn {
    background: #95a5a6;
}

.menu-btn:hover {
    background: #7f8c8d;
}

.final-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.final-stats p {
    margin: 8px 0;
    color: #333;
}

.final-stats span {
    font-weight: bold;
    color: #667eea;
}

.game-footer {
    background: #f8f9fa;
    padding: 15px 30px;
    text-align: center;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

.game-footer p {
    margin: 0;
    font-size: 14px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.start-content,
.game-over-content {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.mode-btn:hover {
    animation: pulse 1s infinite;
}

.notation-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    width: 280px;
    min-width: 280px;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
}

.game-ended-notice {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0;
    animation: slideDown 0.3s ease;
}

.notice-icon {
    font-size: 20px;
}

.notice-text {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.notice-btn {
    background: white;
    color: #f5576c;
    border: none;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.notice-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 50px;
    }
}

.panel-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.notation-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #fafafa;
}

.notation-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.notation-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notation-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.notation-item.active {
    border-color: #667eea;
    background: #f0f3ff;
}

.notation-item.current {
    border-color: #667eea;
    background: #e8ecff;
    border-width: 2px;
}

.notation-number {
    background: #667eea;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.notation-content {
    flex: 1;
    min-width: 0;
}

.notation-move {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.notation-color {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.notation-color.red {
    color: #e74c3c;
}

.notation-color.black {
    color: #2c3e50;
}

.notation-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.notation-annotation {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid #ddd;
}

.annotation-input {
    padding: 10px;
    background: white;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 10px 10px;
    display: flex;
    gap: 8px;
}

.annotation-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.annotation-input input:focus {
    border-color: #667eea;
}

.annotation-input button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#saveAnnotationBtn {
    background: #667eea;
    color: white;
}

#saveAnnotationBtn:hover {
    background: #5568d3;
}

#cancelAnnotationBtn {
    background: #95a5a6;
    color: white;
}

#cancelAnnotationBtn:hover {
    background: #7f8c8d;
}

.notation-item.has-annotation {
    border-left: 3px solid #f39c12;
}

.annotation-badge {
    font-size: 12px;
    color: #f39c12;
    background: #fef5e7;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

/* 滚动条样式 */
.notation-list::-webkit-scrollbar {
    width: 6px;
}

.notation-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.notation-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.notation-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
