/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Mode Colors */
    --primary-color: #6aaa64;
    --secondary-color: #c9b458;
    --absent-color: #787c7e;
    --bg-color: #ffffff;
    --text-color: #1a1a1b;
    --border-color: #d3d6da;
    --key-bg: #d3d6da;
    --key-text: #1a1a1b;
    --correct-color: #6aaa64;
    --present-color: #c9b458;
    --header-bg: #ffffff;
    --modal-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);

    /* Spacing */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --gap-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition: all 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    --bg-color: #121213;
    --text-color: #ffffff;
    --border-color: #3a3a3c;
    --key-bg: #818384;
    --key-text: #ffffff;
    --header-bg: #121213;
    --modal-bg: #1a1a1b;
    --shadow: rgba(255, 255, 255, 0.1);
    --absent-color: #3a3a3c;
}

/* Color Blind Mode */
body.colorblind-mode {
    --correct-color: #f5793a;
    --present-color: #85c0f9;
}

body {
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px var(--shadow);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: var(--gap-lg);
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--key-bg);
}

.settings-btn,
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.settings-btn:hover,
.menu-toggle:hover {
    background-color: var(--key-bg);
}

.menu-toggle {
    display: none;
    font-size: 24px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--key-bg);
    color: var(--key-text);
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--key-bg);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--modal-bg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px var(--shadow);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--gap-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-color);
    line-height: 1;
}

.modal-body {
    padding: var(--gap-lg);
}

/* Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--gap-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 13px;
    color: var(--absent-color);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Select Input */
.select-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
}

/* Game Board */
.game-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-sm);
    margin: var(--gap-xl) 0;
}

.board-row {
    display: flex;
    gap: var(--gap-sm);
}

.tile {
    width: 62px;
    height: 62px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.tile.filled {
    border-color: var(--absent-color);
    animation: pop 0.1s ease;
}

.tile.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: white;
}

.tile.present {
    background-color: var(--present-color);
    border-color: var(--present-color);
    color: white;
}

.tile.absent {
    background-color: var(--absent-color);
    border-color: var(--absent-color);
    color: white;
}

/* Keyboard */
.keyboard {
    max-width: 500px;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 8px;
}

.key {
    min-width: 43px;
    height: 58px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--key-bg);
    color: var(--key-text);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    opacity: 0.8;
}

.key.large {
    min-width: 65px;
    font-size: 12px;
}

.key.correct {
    background-color: var(--correct-color);
    color: white;
}

.key.present {
    background-color: var(--present-color);
    color: white;
}

.key.absent {
    background-color: var(--absent-color);
    color: white;
}

/* Invert Keys */
body.invert-keys .keyboard-row {
    flex-direction: row-reverse;
}

/* Message */
.message {
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-md);
    margin: var(--gap-md) 0;
    font-weight: 600;
    animation: slideDown 0.3s ease;
    min-height: 20px;
}

.message.success {
    background-color: var(--correct-color);
    color: white;
}

.message.error {
    background-color: #e53935;
    color: white;
}

.message.info {
    background-color: var(--secondary-color);
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 8px var(--shadow);
    }

    .nav-menu.show {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        padding: var(--gap-md);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 12px;
    }

    .menu-toggle {
        display: block;
    }

    .tile {
        width: 52px;
        height: 52px;
        font-size: 28px;
    }

    .key {
        min-width: 36px;
        height: 48px;
        font-size: 12px;
    }

    .key.large {
        min-width: 55px;
    }
}

/*
  添加到 common.css 或创建新的 game-layout.css 文件
  这些是新增的样式，不需要删除原有样式
*/

/* Game Top Bar - 顶部控制栏 */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-lg);
    padding: var(--gap-md);
    background-color: var(--bg-color);
    border-radius: var(--radius-lg);
    border: 0px solid var(--border-color);
    max-width: 500px; /* 与键盘宽度一致 */
    margin-left: auto;
    margin-right: auto;
}

/* Mode Switcher - 模式切换器 */
.mode-switcher {
    display: flex;
    gap: 0;
    background-color: var(--bg-color);
    border: 0px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
}

.mode-btn {
    padding: 5px 12px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    color: var(--text-color);
}

.mode-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.mode-btn:hover:not(.active) {
    background-color: var(--key-bg);
}

/* Action Buttons - 右侧功能按钮 */
.action-buttons {
    display: flex;
    gap: var(--gap-sm);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.icon-btn:hover {
    background-color: var(--key-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.icon-btn:active {
    transform: translateY(0);
}

/* Create Game Modal Styles */
.create-game-form {
    max-width: 500px;
}

.form-section {
    margin-bottom: var(--gap-xl);
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--gap-sm);
    color: var(--text-color);
}

.form-hint {
    font-size: 14px;
    color: var(--absent-color);
    margin-bottom: var(--gap-md);
}

.word-input {
    width: 100%;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
    color: var(--text-color);
    text-align: center;
    letter-spacing: 2px;
    transition: var(--transition);
}

.word-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 170, 100, 0.1);
}

.word-length-indicator {
    text-align: center;
    margin-top: var(--gap-sm);
    font-size: 14px;
    color: var(--absent-color);
}

.option-row {
    padding: var(--gap-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.option-row:last-child {
    border-bottom: none;
}

.option-row label {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    cursor: pointer;
    font-size: 16px;
}

.option-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.share-preview {
    background-color: rgba(106, 170, 100, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--gap-lg);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--gap-md);
}

.share-preview p {
    margin: 0;
    color: var(--absent-color);
    font-size: 14px;
}

.share-preview.has-link {
    background-color: rgba(106, 170, 100, 0.2);
    border-style: solid;
}

.share-preview code {
    display: block;
    background-color: var(--bg-color);
    padding: var(--gap-md);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
    margin-top: var(--gap-sm);
}

.button-group {
    display: flex;
    gap: var(--gap-sm);
    flex-wrap: wrap;
}

.btn-block {
    width: 100%;
}

/* Statistics Modal Styles */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-md);
    margin-bottom: var(--gap-xl);
}

.stat-box {
    text-align: center;
    padding: var(--gap-md);
    background-color: rgba(106, 170, 100, 0.1);
    border-radius: var(--radius-md);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--absent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guess-distribution {
    margin-bottom: var(--gap-xl);
}

.guess-distribution h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--gap-md);
}

.distribution-bar {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-sm);
}

.bar-label {
    width: 20px;
    text-align: center;
    font-weight: 600;
}

.bar-container {
    flex: 1;
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 32px;
}

.bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--gap-sm);
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: width 0.5s ease;
    min-width: 32px;
}

.bar-fill.highlight {
    background-color: var(--correct-color);
    animation: pulse 0.5s ease;
}

.next-wordle {
    text-align: center;
    padding: var(--gap-lg);
    background-color: rgba(106, 170, 100, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: var(--gap-lg);
}

.next-wordle p {
    font-size: 14px;
    color: var(--absent-color);
    margin-bottom: var(--gap-sm);
}

.countdown {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* Help Modal Styles */
.help-content {
    max-width: 400px;
}

.help-content p {
    margin-bottom: var(--gap-md);
}

.help-content ul {
    margin-bottom: var(--gap-lg);
    padding-left: var(--gap-lg);
}

.help-content li {
    margin-bottom: var(--gap-sm);
}

.example {
    margin: var(--gap-xl) 0;
}

.example p {
    font-size: 14px;
}

.example-row {
    display: flex;
    gap: 4px;
    margin: var(--gap-md) 0;
    justify-content: flex-start;
}

.example-tile {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.example-tile.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: white;
}

.example-tile.present {
    background-color: var(--present-color);
    border-color: var(--present-color);
    color: white;
}

.example-tile.absent {
    background-color: var(--absent-color);
    border-color: var(--absent-color);
    color: white;
}

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

/* Responsive Design for New Layout */
@media (max-width: 768px) {
    .game-top-bar {
        flex-direction: column;
        gap: var(--gap-md);
    }

    .mode-switcher {
        width: 100%;
    }

    .mode-btn {
        flex: 1;
    }

    .action-buttons {
        width: 100%;
        justify-content: space-around;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .mode-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* 新增：内容覆盖容器 */
.content-overlay {
    display: none;
    position: relative;
    background-color: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    min-height: 500px;
    animation: slideIn 0.3s ease;
}

.content-overlay.active {
    display: block;
}

.content-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-lg);
    padding-bottom: var(--gap-md);
    border-bottom: 2px solid var(--border-color);
}

.content-overlay-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.close-overlay-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.close-overlay-btn:hover {
    background-color: var(--border-color);
}

/* 新增：隐藏游戏区域的类 */
.game-board.hidden,
.keyboard.hidden {
    display: none;
}

/* 修改：Settings 中的 word length 选择器 */
.word-length-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.length-box {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.length-box:hover {
    border-color: var(--primary-color);
    background-color: rgba(106, 170, 100, 0.1);
}

.length-box.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 修改：Statistics 标签切换 */
.stats-tabs {
    display: flex;
    gap: var(--gap-md);
    margin-bottom: var(--gap-lg);
    border-bottom: 2px solid var(--border-color);
}

.stats-tab {
    padding: var(--gap-md) var(--gap-lg);
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--absent-color);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.stats-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.stats-tab:hover:not(.active) {
    color: var(--text-color);
}

.stats-content {
    display: none;
}

.stats-content.active {
    display: block;
}

/* 新增：统计卡片样式优化 */
.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
    margin-bottom: var(--gap-xl);
}

.stat-card-item {
    text-align: center;
    padding: var(--gap-lg);
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
}

.stat-card-item .number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.stat-card-item .label {
    font-size: 12px;
    color: var(--absent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .game-top-bar {
        flex-direction: row;
        padding: var(--gap-sm);
    }

    .mode-switcher {
        flex: 1;
    }

    .action-buttons {
        gap: 4px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .stat-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 确保覆盖层内容也与键盘同宽 */
.content-overlay .overlay-body {
    max-width: 500px;
    margin: 0 auto;
}

.word-length-selector {
    max-width: 500px;
}

.stats-content {
    max-width: 500px;
    margin: 0 auto;
}

/* ==================== 新增：方格动画效果 ==================== */

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* 确保方格有过渡效果 */
.tile {
    transition: all 0.3s ease;
}

.tile.filled {
    border-color: var(--text-color);
    transform: scale(1);
}

/* Index Page Specific Styles */

.hero {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #538d4e 100%);
    color: white;
}

.hero-content {
    text-align: center;
    margin-bottom: var(--gap-xl);
}

.hero-content h2 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: var(--gap-md);
}

.hero-content p {
    font-size: 20px;
    margin-bottom: var(--gap-xl);
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: var(--gap-md);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap-lg);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: var(--gap-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--gap-sm);
}

.stat-card p {
    font-size: 14px;
    opacity: 0.9;
}

/* Game Section */
.game-section {
    padding: var(--gap-xl) 0;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-lg);
}

.game-mode-indicator {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.timer {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    justify-content: center;
    margin-bottom: var(--gap-md);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

/* Features Preview */
.features-preview {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.features-preview h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--gap-xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap-lg);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.feature-card {
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: var(--gap-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: var(--gap-md);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--gap-sm);
}

.feature-card p {
    color: var(--absent-color);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 18px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .stat-card h3 {
        font-size: 28px;
    }

    .features-preview h2 {
        font-size: 28px;
    }
}

/*
====================================
添加到 CSS 文件中 - 分布图样式
====================================
*/

.distribution-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bar-label {
    min-width: 30px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.bar-container {
    flex: 1;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: width 0.5s ease;
    min-width: 24px;
}

.bar-fill:empty::after {
    content: '0';
    padding-right: 8px;
}

/* Settings Item 调整 */
.setting-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:first-child {
    padding-top: 0;
}

.setting-item:last-child {
    border-bottom: none;
}

/* Form Section */
.form-section {
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-hint {
    font-size: 13px;
    color: var(--absent-color);
    margin-bottom: 12px;
}

/* Word Input */
.word-input {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-align: center;
    letter-spacing: 2px;
}

.word-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.word-length-indicator {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: var(--absent-color);
}

/* Share Preview */
.share-preview code {
    display: block;
    background-color: rgba(106, 170, 100, 0.1);
    padding: 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    margin: 12px 0;
    border: 1px dashed var(--primary-color);
}

/* Button adjustments */
.btn-block {
    width: 100%;
    margin-bottom: 8px;
}

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 120px;
}

/* ============================================= */
/* SEO Feature Card Heading Size Adjustments */
/* ============================================= */

.seo-feature-card h3 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .seo-feature-card h3 {
        font-size: 1.2rem !important;
    }
}

@media (max-width: 768px) {
    .seo-feature-card h3 {
        font-size: 1.1rem !important;
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .seo-feature-card h3 {
        font-size: 1rem !important;
        flex-direction: column;
        text-align: center;
        gap: 0.2rem;
    }

    .seo-feature-card h3::before {
        margin-bottom: 0.3rem;
    }
}

/* 确保特征卡片布局正常 */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.seo-feature-card {
    background: var(--modal-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

* Share Overlay Styles */
.share-content {
    text-align: center;
}

.share-result-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    border-radius: 16px;
    padding: 32px 24px;
    margin-bottom: 24px;
    color: white;
}

.share-emoji {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.share-result-box h3 {
    font-size: 28px;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.share-result-text {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

.share-text-preview {
    background: var(--tile-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    max-height: 200px;
    overflow-y: auto;
}

.share-text-preview pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
}

.social-share-section h4 {
    font-size: 16px;
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-weight: 600;
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.social-btn:active {
    transform: translateY(0);
}

.facebook-btn {
    background: #1877F2;
}

.facebook-btn:hover {
    background: #0d65d9;
}

.twitter-btn {
    background: #000000;
}

.twitter-btn:hover {
    background: #333333;
}

.reddit-btn {
    background: #FF4500;
}

.reddit-btn:hover {
    background: #e03d00;
}

.whatsapp-btn {
    background: #25D366;
}

.whatsapp-btn:hover {
    background: #1faa52;
}

.telegram-btn {
    background: #0088cc;
}

.telegram-btn:hover {
    background: #006699;
}

.linkedin-btn {
    background: #0A66C2;
}

.linkedin-btn:hover {
    background: #004182;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .social-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .share-result-box {
        padding: 24px 16px;
    }

    .share-emoji {
        font-size: 48px;
    }

    .share-result-box h3 {
        font-size: 22px;
    }
}