    /* ============================================
   抽奖系统 - 前后端共用样式
   文件作用：定义管理员端与玩家端共用的视觉样式
   ============================================ */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 32px 16px;
    color: #333;
}

/* 页面容器 */
.container {
    max-width: 720px;
    margin: 0 auto;
}

/* 页面标题 */
.page-header {
    text-align: center;
    color: #fff;
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}
.page-header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 登录页容器（更窄，居中显示登录卡片） */
.login-container {
    max-width: 400px;
}

/* 退出登录按钮 */
.logout-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* 用户信息栏 */
.user-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* 顶部导航 */
.page-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.btn-nav {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn-nav:hover {
    background: #f0f3ff;
}
.btn-nav.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.card h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    padding-left: 10px;
    border-left: 4px solid #667eea;
    line-height: 1.2;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* 按钮 */
.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 24px;
    font-weight: 500;
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-secondary {
    background: #f0f0f5;
    color: #555;
    padding: 12px 20px;
}
.btn-secondary:hover {
    background: #e4e4ee;
}

/* 活动信息 */
.activity-info {
    font-size: 14px;
    color: #555;
    margin-bottom: 16px;
}
.activity-info span {
    font-weight: 600;
    color: #667eea;
}

/* 密钥表格 */
.token-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}
.token-table th,
.token-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.token-table thead th {
    background: #f7f8fc;
    color: #555;
    font-weight: 600;
}
.token-table tbody tr:hover {
    background: #fafbff;
}
.token-cell {
    font-family: "Consolas", "Menlo", monospace;
    letter-spacing: 1px;
    color: #764ba2;
}
.empty-tip {
    text-align: center;
    color: #999;
    padding: 24px;
}

/* 状态徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.badge-joined {
    background: #e8f8ef;
    color: #27ae60;
}
.badge-not-joined {
    background: #fef3e2;
    color: #e67e22;
}
.badge-guaranteed {
    background: #fde8e8;
    color: #e74c3c;
    font-weight: 600;
}
.badge-normal {
    background: #f0f0f5;
    color: #888;
}

/* 必中操作按钮 */
.btn-guarantee-toggle {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 12px;
    transition: all 0.2s;
}
.btn-set-guarantee {
    background: #fef3e2;
    color: #e67e22;
}
.btn-set-guarantee:hover {
    background: #fdebd0;
}
.btn-cancel-guarantee {
    background: #fde8e8;
    color: #e74c3c;
}
.btn-cancel-guarantee:hover {
    background: #fbd0d0;
}

/* 删除活动按钮 */
.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-danger:hover {
    background: #c0392b;
}
.btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 单个密钥复制按钮 */
.btn-copy-single {
    background: #e8f0fe;
    color: #4285f4;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-copy-single:hover {
    background: #d2e3fc;
}

/* 按钮行 */
.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 开奖 / 结果展示 */
.result-success,
.result-error {
    border-radius: 8px;
    padding: 16px 20px;
}
.result-success {
    background: #e8f8ef;
}
.result-error {
    background: #fdecea;
}
.result-message {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
}
.result-success .result-message {
    color: #27ae60;
}
.result-error .result-message {
    color: #e74c3c;
}
.winner-list,
.unjoin-list {
    list-style: none;
    padding-left: 0;
}
.winner-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 6px;
}
.winner-name {
    font-weight: 600;
    color: #27ae60;
}
.winner-token {
    font-family: "Consolas", "Menlo", monospace;
    color: #999;
    font-size: 13px;
}
.unjoin-list li {
    padding: 4px 0;
    color: #c0392b;
}

/* 卡片内联结果区（玩家端参与/查询结果） */
.inline-result {
    margin-top: 16px;
}
.query-nickname {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}
.join-activity-name {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #eef2ff;
    border-radius: 6px;
}

/* 活动状态标签 */
.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin: 6px 0;
}
.status-win {
    background: #d4edda;
    color: #155724;
}
.status-lose {
    background: #f8d7da;
    color: #721c24;
}
.status-joined {
    background: #fff3cd;
    color: #856404;
}

/* 活动列表 */
.activity-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fafbfc;
}
.activity-item:last-child {
    margin-bottom: 0;
}
.activity-item p {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.6;
}
.activity-item .activity-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}
.activity-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}
/* 活动内联详情区（密钥表 / 开奖结果） */
.activity-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

/* 活动状态徽章 */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: normal;
}
.status-0 {
    background: #e8f0fe;
    color: #667eea;
}
.status-2 {
    background: #e8f8ef;
    color: #27ae60;
}
.status-3 {
    background: #f0f0f5;
    color: #999;
}

/* 顶部提示条 */
#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 999;
    max-width: 80vw;
}
#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 统计面板 */
.stats-panel {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stats-item {
    flex: 1;
    min-width: 100px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.stats-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}
.stats-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}
.stats-active .stats-value {
    color: #667eea;
}
.stats-drawn .stats-value {
    color: #27ae60;
}
.stats-closed .stats-value {
    color: #999;
}
.stats-join .stats-value {
    color: #764ba2;
}

/* 隐藏工具类 */
.hidden {
    display: none;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .card {
        padding: 16px;
    }
    .page-header h1 {
        font-size: 22px;
    }
    .page-nav {
        gap: 8px;
    }
    .btn-nav {
        min-width: 100%;
        padding: 14px 16px;
    }
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    .stats-panel {
        gap: 8px;
    }
    .stats-item {
        min-width: calc(50% - 8px);
        padding: 12px 8px;
    }
    .stats-value {
        font-size: 22px;
    }
}