/* ═══════════════════════════════════════════
   Gemini 会员自助订阅平台 - 样式
   简洁大方 / 浅色背景 / 蓝紫渐变点缀
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f8f9fb;
    --surface: #ffffff;
    --surface-hover: #f5f6f8;
    --border: #e5e7eb;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Header ── */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Container ── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ── Announcement ── */
.announcement {
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 10px;
}

.announcement::before {
    content: '📢';
    font-size: 16px;
}

/* ── Notice Card ── */
.notice-card {
    background: linear-gradient(135deg, #fefce8, #fff7ed);
    border: 1px solid #fde68a;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice-list li {
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding-left: 16px;
    position: relative;
}

.notice-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--warning);
    font-weight: bold;
}

.notice-list li:last-child {
    border-bottom: none;
}

.notice-links {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Login/Activate ── */
.activate-section {
    max-width: 480px;
    margin: 80px auto;
    text-align: center;
}

.activate-section .card {
    padding: 40px 32px;
}

.activate-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.activate-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
}

/* ── Form ── */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: var(--success-bg); color: #059669; }
.badge-warning { background: var(--warning-bg); color: #d97706; }
.badge-danger  { background: var(--danger-bg);  color: #dc2626; }
.badge-info    { background: var(--info-bg);     color: #2563eb; }
.badge-gray    { background: #f3f4f6;            color: #6b7280; }

/* ── Balance Display ── */
.balance-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-light);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.balance-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.balance-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

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

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

.tab-content {
    display: none;
}

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

/* ── Task Table ── */
.task-list {
    width: 100%;
    overflow-x: auto;
}

.task-item {
    display: grid;
    grid-template-columns: 1fr 100px 140px 100px;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    font-size: 13px;
    transition: background 0.15s;
}

.task-item:hover {
    background: var(--surface-hover);
}

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

.task-header {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-email {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
}

.task-actions {
    text-align: right;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ── Admin ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── Admin Table ── */
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

table.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.admin-table tr:hover td {
    background: var(--surface-hover);
}

.mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* ── Admin Login ── */
.admin-login {
    max-width: 400px;
    margin: 100px auto;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .container { padding: 16px 12px; }
    .card { padding: 16px; }
    .task-item {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .balance-bar { flex-direction: column; gap: 8px; text-align: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .header { padding: 0 12px; }
}
