/* ============================================
   邱邱水浒 - 古风雅致主题（按钮精简版）
   Version: 1.2
   字体保持原大小，只缩小按钮尺寸
============================================= */

/* ========== 全局链接样式保持不变 ========== */
/* 基础链接样式 - 保持原字体大小 */
a {
    color: #d16d6d !important;          /* 暗朱砂色 */
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    font-weight: 500;
    /* 字体大小保持默认 */
}

/* 鼠标悬停样式 */
a:hover {
    color: #c44 !important;             /* 胭脂色 */
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

/* 点击时样式 */
a:active {
    color: #a83c3c !important;          /* 赤红色 */
    transform: translateY(1px);
}

/* 已访问链接样式 */
a:visited {
    color: #5a8a8a !important;          /* 石青色 */
}

/* ========== 精简按钮系统 ========== */
/* 基础按钮样式 - 减小尺寸，字体保持 */
.btn {
    display: inline-block;
    padding: 4px 10px !important;      /* 大幅减小内边距 */
    font-family: "Microsoft YaHei", "SimSun", sans-serif;
    font-size: inherit !important;      /* 继承父元素字体大小 */
    font-weight: 500;
    text-align: center;
    text-decoration: none !important;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    line-height: 1.4;
    margin: 0 1px 2px 0;                /* 减小间距 */
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    min-height: auto;                   /* 去掉最小高度限制 */
}

/* 按钮尺寸（只调整内边距） */
.btn-xs {
    padding: 2px 6px !important;        /* 超小按钮 */
    font-size: inherit !important;      /* 字体大小不变 */
}

.btn-sm {
    padding: 3px 8px !important;        /* 小按钮 */
    font-size: inherit !important;
}

.btn-md {
    padding: 4px 10px !important;       /* 默认尺寸 */
    font-size: inherit !important;
}

.btn-lg {
    padding: 4px 12px !important;       /* 大按钮 */
    font-size: inherit !important;
}

/* 极简按钮（用于内联小操作） */
.btn-mini {
    padding: 1px 4px !important;        /* 极小按钮 */
    font-size: inherit !important;
    border-radius: 2px;
    margin: 0 1px;
}

/* ========== 按钮颜色主题（保持原样，但尺寸变小） ========== */

/* 主按钮 - 赭红色 */
.btn-primary,
.contest-link {
    background: linear-gradient(to bottom, #e8a8a8, #d88);
    color: #fff !important;
    border-color: #c66;
}

.btn-primary:hover,
.contest-link:hover {
    background: linear-gradient(to bottom, #d88, #e8a8a8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(204, 102, 102, 0.2);
    border-color: #d16d6d;
}

.btn-primary:active,
.contest-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(204, 102, 102, 0.1);
}

/* 成功按钮 - 竹青色 */
.btn-success,
.action-btn {
    background: linear-gradient(to bottom, #8bc34a, #689f38);
    color: #fff !important;
    border-color: #558b2f;
}

.btn-success:hover,
.action-btn:hover {
    background: linear-gradient(to bottom, #689f38, #8bc34a);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(104, 159, 56, 0.2);
    border-color: #7cb342;
}

/* 警告按钮 - 金盏黄 */
.btn-warning,
.rank-link {
    background: linear-gradient(to bottom, #ffb74d, #ff9800);
    color: #5d4037 !important;
    border-color: #f57c00;
}

.btn-warning:hover,
.rank-link:hover {
    background: linear-gradient(to bottom, #ff9800, #ffb74d);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.2);
    border-color: #ffa726;
}

/* 信息按钮 - 青花蓝 */
.btn-info,
.detail-link {
    background: linear-gradient(to bottom, #64b5f6, #2196f3);
    color: #fff !important;
    border-color: #1976d2;
}

.btn-info:hover,
.detail-link:hover {
    background: linear-gradient(to bottom, #2196f3, #64b5f6);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
    border-color: #42a5f5;
}

/* 次要按钮 - 青灰色 */
.btn-secondary,
.back-link {
    background: linear-gradient(to bottom, #f5f5f5, #eee);
    color: #616161 !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover,
.back-link:hover {
    background: linear-gradient(to bottom, #eee, #f5f5f5);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #bbb !important;
    color: #424242 !important;
}

/* 危险按钮 - 紫檀色 */
.btn-danger {
    background: linear-gradient(to bottom, #ba68c8, #9c27b0);
    color: #fff !important;
    border-color: #7b1fa2;
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #9c27b0, #ba68c8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(156, 39, 176, 0.2);
    border-color: #ab47bc;
}

/* ========== 特殊按钮样式 ========== */
/* 领奖按钮 */
.reward-btn {
    background: linear-gradient(to bottom, #ffd54f, #ffb300);
    color: #5d4037 !important;
    border-color: #ffa000;
    font-weight: 600;
}

.reward-btn:hover {
    background: linear-gradient(to bottom, #ffb300, #ffd54f);
}

/* 线框按钮变体 */
.btn-outline-primary {
    background: transparent !important;
    color: #d88 !important;
    border: 1px solid #d88;
    box-shadow: none;
    padding: 3px 9px !important;  /* 线框按钮稍大一点 */
}

.btn-outline-primary:hover {
    background: rgba(221, 136, 136, 0.1) !important;
    color: #c66 !important;
    border-color: #c66;
}

/* ========== 按钮状态 ========== */
/* 禁用状态 */
.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

/* 激活状态 */
.btn.active {
    border-width: 2px !important;
    font-weight: 600;
}

/* ========== 按钮组样式 ========== */
.btn-group {
    display: inline-flex;
    gap: 2px;                          /* 减小间距 */
    margin: 1px 0;
}

.btn-group .btn {
    margin: 0;
    border-radius: 2px;
}

/* ========== 表单按钮（也变小） ========== */
input[type="submit"],
input[type="button"],
input[type="reset"],
button[type="submit"],
button[type="button"],
button {
    display: inline-block;
    padding: 4px 10px !important;      /* 同步变小 */
    background: linear-gradient(to bottom, #e8a8a8, #d88);
    color: #fff !important;
    border: 1px solid #c66;
    border-radius: 3px;
    font-size: inherit !important;      /* 字体大小不变 */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(204, 102, 102, 0.1);
    line-height: 1.4;
    margin: 0 1px 2px 0;
}

input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
button[type="submit"]:hover,
button[type="button"]:hover,
button:hover {
    background: linear-gradient(to bottom, #d88, #e8a8a8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(204, 102, 102, 0.2);
    border-color: #d16d6d;
}

/* ========== 针对梁山大会页面的优化 ========== */
/* 比赛相关链接特别处理 */
.contest-link {
    padding: 3px 8px !important;        /* 比赛链接更小 */
    margin: 0 1px;
}

/* 返回链接 */
.back-link {
    padding: 5px 12px !important;        /* 返回按钮稍大一点 */
    margin-top: 5px;
    display: inline-block;
}

/* 内联操作按钮 */
.inline-btn {
    padding: 2px 6px !important;
    margin: 0 1px;
    vertical-align: middle;
}

/* 分隔符附近按钮的间距调整 */
br + .btn,
span + .btn {
    margin-left: 1px;
}

/* 确保文字和按钮对齐 */
.btn span {
    vertical-align: middle;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
    .btn {
        padding: 3px 8px !important;
    }

    .btn-xs {
        padding: 1px 4px !important;
    }
    /* ===== 新增：手机适配核心样式 ===== */
    body {
        padding: 15px !important;
        margin: 0 !important;
        font-size: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* 所有容器不超出屏幕 */
    div, section, article, main, footer {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* 所有按钮/链接统一成紧凑间距 */
    a, button, .btn, input[type="submit"], input[type="button"] {
        padding: 1px 1px !important;   /* 统一左右8px */
        display: inline-block !important;
        box-sizing: border-box !important;
        min-height: auto !important;
    }

    /* 极小按钮更紧凑 */
    .btn-xs, .btn-mini {
        padding: 1px 1px !important;   /* 左右5px更紧凑 */
    }
    /* 内联链接保持紧凑 */
    span a, div a, p a, .btn-xs, .btn-mini {
        /*  min-height: 36px !important;*/
        padding: 1px 1px !important;
    }

    /* 表格响应式 */
    table {
        display: block !important;
        overflow-x: auto !important;
        width: 100% !important;
    }

    /* 图片响应式 */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 页脚优化 */
    footer {
        padding: 15px 10px !important;
        text-align: center !important;
    }
}
