/* 响应式工具类 - 多端适配 */

/* 响应式容器 */
.responsive-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 触摸设备优化 - 使用hover: none检测 */
@media (hover: none) {
    /* 按钮触摸友好 */
    .a-btn {
        min-height: 44px;
        padding-left: 15px;
        padding-right: 15px;
        width: auto;
        margin: 15px 0;
    }

    .a-btn:hover {
        padding-right: 15px;
    }

    .a-btn:active {
        background: #5d81ab;
        transform: scale(0.98);
    }

    .a-btn-text {
        font-size: 16px;
        color: #fff;
        text-shadow: none;
        font-weight: 500;
    }

    .a-btn-slide-text {
        display: none;
    }

    .a-btn-icon-right {
        display: none;
    }
}

/* 移动端媒体查询 */
@media screen and (max-width: 768px) {
    .content {
        width: 100%;
        max-width: 680px;
        padding: 0 20px;
    }

    .button-wrapper {
        width: 100%;
        max-width: 320px;
        padding: 15px 0;
    }

    h1 {
        font-size: 24px;
        padding: 15px;
    }

    h1 span {
        font-size: 12px;
    }

    /* 移动端按钮文字白色 - 强制覆盖 */
    .button-wrapper .a-btn .a-btn-text {
        color: #fff !important;
        text-shadow: 0px 1px 2px rgba(0,0,0,0.2) !important;
    }

    /* 表格响应式 */
    table {
        width: 100%;
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .a-btn {
        padding-left: 12px;
        padding-right: 50px;
        height: 44px;
    }

    .button-wrapper .a-btn .a-btn-text {
        font-size: 14px;
        color: #fff !important;
        text-shadow: 0px 1px 2px rgba(0,0,0,0.2) !important;
    }

    .a-btn-icon-right {
        width: 40px;
    }

    .a-btn-icon-right span {
        width: 30px;
        height: 30px;
        margin: -16px 0 0 -16px;
    }

    h1 {
        font-size: 20px;
    }

    h1 span {
        font-size: 11px;
    }

    .f2 {
        font-size: 12px;
    }
}

/* 隐藏/显示工具类 */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }
}

/* 触摸设备滚动优化 */
@media (hover: none) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 背景预设样式 */
.bg-default {
    background: #f9f9f9;
    color: #333;
}

.bg-default .a-btn-text {
    color: #446388;
}

.bg-default .a-btn:hover .a-btn-text {
    color: #fff;
}

.bg-dark {
    background: #2f3238;
    color: #fff;
}

.bg-dark .a-btn-text {
    color: #fff;
}

.bg-dark .a-btn {
    background: #4a5568;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(#4a5568, 0), color-stop(#2d3748, 1));
    background: -webkit-linear-gradient(top, #4a5568 0%, #2d3748 100%);
    background: linear-gradient(to bottom, #4a5568 0%, #2d3748 100%);
    border-color: #1a202c;
    box-shadow: 0px 1px 1px rgba(255,255,255,0.3) inset, 1px 1px 3px rgba(0,0,0,0.3), 0px 0px 0px 4px rgba(74,85,104,0.3);
}

.bg-dark .a-btn:hover {
    background: #5a6778;
    background: linear-gradient(to bottom, #5a6778 0%, #3d4758 100%);
}

.bg-dark .a-btn:hover .a-btn-text {
    text-shadow: 0px 1px 1px #1a202c;
}

.bg-dark .a-btn-slide-text {
    background: #1a202c;
}

.bg-dark h1 {
    color: #fff;
    text-shadow: 1px 1px 1px #000;
}

.bg-dark h1 span {
    color: #aaa;
}

.bg-dark .f2 {
    color: #aaa;
}

.bg-dark .f2 a {
    color: #ddd;
}

.bg-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.bg-blue .a-btn-text {
    color: #fff;
}

.bg-blue .a-btn {
    background: #5a67d8;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(#5a67d8, 0), color-stop(#4c51bf, 1));
    background: -webkit-linear-gradient(top, #5a67d8 0%, #4c51bf 100%);
    background: linear-gradient(to bottom, #5a67d8 0%, #4c51bf 100%);
    border-color: #3c366b;
    box-shadow: 0px 1px 1px rgba(255,255,255,0.3) inset, 1px 1px 3px rgba(0,0,0,0.3), 0px 0px 0px 4px rgba(90,103,216,0.3);
}

.bg-blue .a-btn:hover {
    background: linear-gradient(to bottom, #6b7ae8 0%, #5c61cf 100%);
}

.bg-blue .a-btn:hover .a-btn-text {
    text-shadow: 0px 1px 1px #3c366b;
}

.bg-blue .a-btn-slide-text {
    background: #3c366b;
}

.bg-blue h1 {
    color: #fff;
    text-shadow: 1px 1px 1px #333;
}

.bg-blue h1 span {
    color: #ddd;
}

.bg-blue .f2 {
    color: #ddd;
}

.bg-warm {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.bg-warm .a-btn-text {
    color: #fff;
}

.bg-warm .a-btn {
    background: #ed8936;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(#ed8936, 0), color-stop(#dd6b20, 1));
    background: -webkit-linear-gradient(top, #ed8936 0%, #dd6b20 100%);
    background: linear-gradient(to bottom, #ed8936 0%, #dd6b20 100%);
    border-color: #c05621;
    box-shadow: 0px 1px 1px rgba(255,255,255,0.3) inset, 1px 1px 3px rgba(0,0,0,0.2), 0px 0px 0px 4px rgba(237,137,54,0.3);
}

.bg-warm .a-btn:hover {
    background: linear-gradient(to bottom, #f59a47 0%, #e87c31 100%);
}

.bg-warm .a-btn:hover .a-btn-text {
    text-shadow: 0px 1px 1px #c05621;
}

.bg-warm .a-btn-slide-text {
    background: #c05621;
}

.bg-warm h1 {
    color: #333;
    text-shadow: 1px 1px 1px #fff;
}

.bg-warm h1 span {
    color: #666;
}

.bg-warm .f2 {
    color: #666;
}

.bg-warm .f2 a {
    color: #333;
}

.bg-warm .bg-switcher-btn {
    background: #ed8936;
}

.bg-green {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.bg-green .a-btn-text {
    color: #fff;
}

.bg-green .a-btn {
    background: #48bb78;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(#48bb78, 0), color-stop(#38a169, 1));
    background: -webkit-linear-gradient(top, #48bb78 0%, #38a169 100%);
    background: linear-gradient(to bottom, #48bb78 0%, #38a169 100%);
    border-color: #276749;
    box-shadow: 0px 1px 1px rgba(255,255,255,0.3) inset, 1px 1px 3px rgba(0,0,0,0.2), 0px 0px 0px 4px rgba(72,187,120,0.3);
}

.bg-green .a-btn:hover {
    background: linear-gradient(to bottom, #58cb88 0%, #48b179 100%);
}

.bg-green .a-btn:hover .a-btn-text {
    text-shadow: 0px 1px 1px #276749;
}

.bg-green .a-btn-slide-text {
    background: #276749;
}

.bg-green h1 {
    color: #333;
    text-shadow: 1px 1px 1px #fff;
}

.bg-green h1 span {
    color: #666;
}

.bg-green .f2 {
    color: #666;
}

.bg-green .f2 a {
    color: #333;
}

.bg-green .bg-switcher-btn {
    background: #48bb78;
}

/* 背景切换按钮样式 */
.bg-switcher {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 1000;
}

.bg-switcher-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.bg-switcher-btn:hover {
    transform: scale(1.1);
}

.bg-switcher-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.bg-switcher-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-width: 150px;
}

.bg-switcher-panel.show {
    display: block;
}

.bg-switcher-panel h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.bg-option {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.bg-option:hover {
    background: #f0f0f0;
}

.bg-option.active {
    background: #e3f2fd;
}

.bg-option-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

.bg-option-name {
    font-size: 13px;
    color: #333;
}

/* 移动端背景切换按钮适配 */
@media screen and (max-width: 768px) {
    .bg-switcher {
        right: 10px;
        top: 10px;
    }

    .bg-switcher-btn {
        width: 36px;
        height: 36px;
    }

    .bg-switcher-panel {
        right: -10px;
        min-width: 140px;
    }
}

/* Game页面统一header样式 */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-header .back-link {
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.game-header .back-link:hover {
    color: #2d3748;
}

.game-header .back-link::before {
    content: '←';
}

/* Game页面有header时的body调整 */
body.has-game-header {
    padding-top: 50px;
}

@media screen and (max-width: 768px) {
    .game-header {
        padding: 8px 15px;
    }

    .game-header .back-link {
        font-size: 13px;
    }
}