/* ============================================================
   USDT 红包机器人 - 全局样式
   ============================================================ */

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255,255,255,0.04);
    --bg-input: rgba(255,255,255,0.06);
    --border-color: rgba(255,255,255,0.08);
    --border-active: rgba(255,107,107,0.4);
    --text-primary: #ffffff;
    --text-secondary: #8888bb;
    --text-muted: #555577;
    --accent: #e04040;
    --accent-glow: rgba(224,64,64,0.3);
    --accent-green: #4ade80;
    --accent-green-glow: rgba(74,222,128,0.2);
    --accent-yellow: #fbbf24;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 14px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 16px 16px 80px;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(224,64,64,0.06) 0%, transparent 60%);
}

/* ----- 容器 ----- */
.container {
    max-width: 480px;
    margin: 0 auto;
}

/* ----- 头部 ----- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 20px;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #e04040);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-balance {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.header-balance span {
    color: var(--accent-green);
    font-weight: 600;
}

/* ----- 卡片 ----- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

/* ----- 表单 ----- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238888bb' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-select option {
    background: #1a1a3a;
    color: var(--text-primary);
}

/* ----- 按钮 ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #e04040, #ff6b6b);
    color: #fff;
    box-shadow: 0 4px 20px rgba(224,64,64,0.3);
}

.btn-primary:active {
    box-shadow: 0 2px 10px rgba(224,64,64,0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #fff;
    box-shadow: 0 4px 20px rgba(74,222,128,0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:active {
    background: var(--bg-card);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    width: auto;
}

.btn-block {
    width: 100%;
}

/* ----- 列表 ----- */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.list-item:active {
    border-color: var(--border-active);
}

.list-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 15px;
    font-weight: 500;
}

.list-item-title .highlight {
    color: var(--accent-green);
}

.list-item-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.list-item-right {
    text-align: right;
    flex-shrink: 0;
    margin-left: 12px;
}

.list-item-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
}

.list-item-status {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 12px;
    display: inline-block;
}

.status-active {
    color: var(--accent-green);
    background: var(--accent-green-glow);
}

.status-expired {
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
}

.status-claimed {
    color: var(--accent-yellow);
    background: rgba(251,191,36,0.15);
}

.status-pending {
    color: var(--accent-yellow);
    background: rgba(251,191,36,0.15);
}

.status-completed {
    color: var(--accent-green);
    background: var(--accent-green-glow);
}

.status-rejected {
    color: #ef4444;
    background: rgba(239,68,68,0.15);
}

/* ----- Tab 切换 ----- */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:active {
    transform: scale(0.96);
}

.tab.active {
    background: var(--accent);
    color: #fff;
}

/* ----- 空状态 ----- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state .text {
    font-size: 14px;
}

/* ----- Toast 提示 ----- */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}

.toast {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: slideDown 0.3s ease;
    margin-bottom: 8px;
}

.toast-success {
    background: rgba(34,197,94,0.9);
    color: #fff;
}

.toast-error {
    background: rgba(239,68,68,0.9);
    color: #fff;
}

.toast-info {
    background: rgba(59,130,246,0.9);
    color: #fff;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ----- Modal 弹窗 ----- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    max-width: 400px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions .btn {
    flex: 1;
}

/* ----- 客服按钮 (右下角) ----- */
.support-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e04040, #ff6b6b);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(224,64,64,0.4);
    transition: transform 0.2s;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.support-btn:active {
    transform: scale(0.9);
}

/* ----- 底部导航 (仅 profile 等需要) ----- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 8px 0 env(safe-area-inset-bottom);
    z-index: 100;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s;
    touch-action: manipulation;
}

.bottom-nav-item .icon {
    font-size: 22px;
}

.bottom-nav-item.active {
    color: var(--accent);
}

/* ----- 其他工具类 ----- */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-green { color: var(--accent-green); }
.text-red { color: #ef4444; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* 复制链接弹窗 */
.link-display {
    background: var(--bg-input);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

/* 管理员标签 */
.admin-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(251,191,36,0.15);
    color: var(--accent-yellow);
    margin-left: 8px;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}