/* ========== 抽奖插件授权系统 - 管理后台样式 ========== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f0ff 0%, #fff0f5 25%, #f0f8ff 50%, #f5fff5 75%, #fef9f0 100%);
    background-size: 400% 400%;
    animation: shimmer 20s ease infinite;
    min-height: 100vh;
    color: #2d3436;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== 安装页 ========== */
.install-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.install-container { max-width: 600px; width: 90%; }
.install-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    animation: fadeInUp 0.6s ease-out;
}
.install-card h1 { font-size: 24px; text-align: center; color: #1a1a2e; margin-bottom: 4px; }
.install-card .subtitle { text-align: center; color: #8899a6; font-size: 14px; margin-bottom: 24px; }
.install-status { padding: 16px; border-radius: 12px; margin-bottom: 20px; font-size: 15px; font-weight: 600; }
.install-status.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.install-info { margin-bottom: 20px; }
.install-info h3 { font-size: 15px; margin-bottom: 10px; color: #2d3436; }
.install-info table { width: 100%; font-size: 13px; }
.install-info td { padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,0.04); }
.install-info td:first-child { color: #8899a6; width: 120px; }
.install-actions { text-align: center; margin-top: 20px; }
.install-api { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.06); }
.install-api h3 { font-size: 14px; margin-bottom: 8px; color: #2d3436; }
.install-api p { font-size: 13px; color: #636e72; margin-bottom: 8px; }
.install-api code {
    display: inline-block; padding: 8px 14px; background: rgba(0,0,0,0.05); border-radius: 8px;
    font-family: 'Courier New', monospace; font-size: 13px; color: #d4a853; user-select: all;
}

/* ========== 登录页 ========== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { max-width: 400px; width: 90%; }
.login-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    animation: fadeInUp 0.6s ease-out;
}
.login-card h1 { font-size: 22px; text-align: center; color: #1a1a2e; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; color: #8899a6; font-size: 13px; margin-bottom: 24px; }

/* ========== 后台布局 ========== */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255,255,255,0.5);
    padding: 20px 0;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.sidebar-header h2 { font-size: 18px; color: #1a1a2e; }
.sidebar-nav { list-style: none; padding: 12px 0; }
.sidebar-nav li { margin: 2px 0; }
.sidebar-nav a {
    display: block; padding: 10px 20px; color: #636e72; text-decoration: none;
    font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(212,168,83,0.06); color: #d4a853; border-left-color: #d4a853; }
.sidebar-nav a.active { background: rgba(212,168,83,0.08); color: #b8860b; font-weight: 600; border-left-color: #d4a853; }
.sidebar-nav a.logout { margin-top: 20px; color: #e74c3c; }
.sidebar-nav a.logout:hover { background: rgba(231,76,60,0.06); border-left-color: #e74c3c; }

.main-content { margin-left: 220px; flex: 1; min-height: 100vh; }
.topbar {
    padding: 16px 28px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    text-align: right; font-size: 14px; color: #636e72;
}
.content { padding: 24px 28px; animation: fadeInUp 0.4s ease-out; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title { font-size: 22px; font-weight: 600; color: #1a1a2e; margin-bottom: 20px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header .page-title { margin-bottom: 0; }

/* ========== 卡片 ========== */
.card {
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.card h3 { font-size: 16px; margin-bottom: 16px; color: #2d3436; }

/* ========== 统计卡片 ========== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-value { font-size: 36px; font-weight: 700; color: #d4a853; line-height: 1.2; }
.stat-card .stat-label { font-size: 14px; color: #8899a6; margin-top: 4px; }

/* ========== 表格 ========== */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
    padding: 10px 8px; text-align: left; font-weight: 600; color: #636e72;
    border-bottom: 2px solid rgba(0,0,0,0.06); font-size: 12px;
}
.table tbody td { padding: 10px 8px; border-bottom: 1px solid rgba(0,0,0,0.04); color: #2d3436; }
.table tbody tr:hover { background: rgba(212,168,83,0.03); }

.action-cell { white-space: nowrap; }

/* ========== 徽章 ========== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #ffebee; color: #c62828; }
.badge-expired { background: #fff3e0; color: #e65100; }

/* ========== 按钮 ========== */
.btn {
    display: inline-block; padding: 8px 20px; border-radius: 10px; font-size: 13px; font-weight: 600;
    text-decoration: none; cursor: pointer; border: none; transition: all 0.2s;
    background: rgba(0,0,0,0.04); color: #636e72;
}
.btn:hover { background: rgba(0,0,0,0.08); }
.btn-primary {
    background: linear-gradient(135deg, #d4a853, #f5d78e); color: #5a3e1b;
    box-shadow: 0 4px 12px rgba(212,168,83,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(212,168,83,0.4); transform: translateY(-1px); }
.btn-danger { background: #ffebee; color: #c62828; }
.btn-danger:hover { background: #ffcdd2; }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 8px; }
.btn-block { display: block; width: 100%; padding: 12px; }
.btn-secondary { background: rgba(0,0,0,0.04); color: #636e72; }

/* ========== 表单 ========== */
.form { max-width: 500px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #2d3436; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.1);
    font-size: 14px; background: rgba(255,255,255,0.7); color: #2d3436; transition: all 0.2s;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #d4a853; box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
}
.form-group small { display: block; font-size: 12px; color: #8899a6; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ========== 提示 ========== */
.alert {
    padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border-color: #ffcdd2; }

/* ========== 快速操作 ========== */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== 分页 ========== */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.04); }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; font-size: 13px;
    text-decoration: none; color: #636e72; background: rgba(255,255,255,0.3); transition: all 0.2s;
}
.page-link:hover { background: rgba(212,168,83,0.1); color: #d4a853; }
.page-link.active { background: #d4a853; color: #fff; }

/* ========== 辅助 ========== */
.mt-2 { margin-top: 16px; }
.text-muted { color: #8899a6; font-size: 13px; }
code {
    padding: 2px 8px; background: rgba(0,0,0,0.04); border-radius: 4px;
    font-family: 'Courier New', monospace; font-size: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar { width: 180px; }
    .main-content { margin-left: 180px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 16px; }
}
@media (max-width: 576px) {
    .sidebar { width: 0; overflow: hidden; }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
}
