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

:root {
    --p1: #0ea5e9;      /* 天蓝 sky-500 */
    --p2: #06b6d4;      /* 青色 cyan-500 */
    --p3: #10b981;      /* 青绿 emerald-500 */
    --primary: var(--p1);
    --primary-dark: #0284c7;
    --grad: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #10b981 100%);
    --grad-soft: linear-gradient(135deg, #e0f7ff 0%, #e0fdf4 100%);
    --bg: #f0fbff;
    --card-bg: #fff;
    --text: #0f2235;
    --muted: #5d7a8a;
    --border: #bae6fd;
    --radius: 12px;
}

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

a { color: var(--p1); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 布局 ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
    background: #fff;
    border-bottom: 2px solid transparent;
    border-image: var(--grad) 1;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 12px rgba(6,182,212,.10);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 62px;
}
.site-logo {
    font-size: 21px; font-weight: 800; color: var(--text);
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.site-logo span { /* already covered by gradient */ }
.site-logo:hover { text-decoration: none; opacity: .85; }
.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav a { color: var(--text); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--p1); text-decoration: none; }

/* ===== Buttons ===== */
.btn-primary {
    background: var(--grad);
    color: #fff; border: none;
    padding: 10px 26px; border-radius: 50px;
    cursor: pointer; font-size: 15px; font-weight: 700;
    transition: opacity .18s, transform .18s;
    display: inline-block; letter-spacing: .02em;
    box-shadow: 0 3px 12px rgba(6,182,212,.30);
}
.btn-primary:hover { opacity: .88; text-decoration: none; color: #fff; transform: translateY(-1px); }

.btn-primary-sm {
    background: var(--grad); color: #fff;
    padding: 6px 18px; border-radius: 50px;
    font-size: 13px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(6,182,212,.25);
}
.btn-primary-sm:hover { opacity: .88; text-decoration: none; color: #fff; }

.btn-outline {
    border: 1.5px solid var(--p2); color: var(--p2);
    padding: 6px 16px; border-radius: 50px; font-size: 13px; font-weight: 600;
    transition: background .15s, color .15s;
}
.btn-outline:hover { background: var(--p2); color: #fff; text-decoration: none; }

.btn-secondary {
    background: var(--grad-soft); color: var(--p1);
    padding: 10px 26px; border-radius: 50px;
    font-size: 15px; font-weight: 700;
    border: 1.5px solid var(--border); cursor: pointer;
    transition: border-color .15s;
}
.btn-secondary:hover { border-color: var(--p2); text-decoration: none; }

.btn-sm {
    background: var(--grad-soft); color: var(--p1);
    padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 600;
    border: 1px solid var(--border); cursor: pointer;
    transition: background .15s;
}
.btn-sm:hover { background: #bae6fd; }

/* ===== Hero ===== */
.hero {
    background: var(--grad);
    color: #fff;
    padding: 86px 0 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='28' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E") center / 60px;
    pointer-events: none;
}
.hero h1 {
    font-size: clamp(30px, 5.5vw, 56px);
    font-weight: 900; line-height: 1.15; margin-bottom: 16px;
    text-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.hero h1 span { color: #fde68a; }
.hero p { font-size: 18px; opacity: .88; margin-bottom: 36px; }

.search-form {
    display: flex; max-width: 460px; margin: 0 auto; gap: 0;
    background: #fff; border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    overflow: hidden;
    padding: 4px 4px 4px 20px;
}
.search-form input {
    flex: 1; padding: 10px 0; border: none;
    font-size: 15px; outline: none; background: transparent; color: var(--text);
}
.search-form button {
    background: var(--grad); color: #fff;
    padding: 10px 24px; border-radius: 50px;
    border: none; cursor: pointer;
    font-weight: 700; font-size: 15px;
    transition: opacity .18s;
    white-space: nowrap;
}
.search-form button:hover { opacity: .88; }

/* ===== Cards ===== */
.section { padding: 52px 0; }
.section h2 {
    font-size: 22px; font-weight: 800; margin-bottom: 24px;
    background: var(--grad);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; display: inline-block;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.user-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 26px 16px; text-align: center;
    border: 1.5px solid var(--border);
    transition: box-shadow .2s, transform .2s;
    display: block; color: var(--text);
}
.user-card:hover {
    box-shadow: 0 8px 24px rgba(6,182,212,.18);
    transform: translateY(-3px); text-decoration: none;
    border-color: var(--p2);
}
.user-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--grad);
    color: #fff; font-size: 22px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 3px 10px rgba(6,182,212,.30);
}
.user-name { font-weight: 700; font-size: 15px; }
.user-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.empty-tip { color: var(--muted); font-size: 15px; }
.empty-tip a { color: var(--p1); font-weight: 600; }

/* ===== Footer ===== */
.site-footer {
    background: #fff;
    border-top: 2px solid transparent;
    border-image: var(--grad) 1;
    padding: 26px 0; text-align: center; color: var(--muted); font-size: 14px;
    margin-top: 48px;
}

/* ===== Auth ===== */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 32px 16px;
    background: var(--grad-soft);
}
.auth-card {
    background: #fff; border-radius: 18px; padding: 42px 38px;
    width: 100%; max-width: 430px;
    box-shadow: 0 10px 40px rgba(6,182,212,.13);
    border: 1.5px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo a {
    font-size: 24px; font-weight: 900;
    background: var(--grad);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-card h2 { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.auth-link { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
.auth-link a { color: var(--p1); font-weight: 600; }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-group input {
    width: 100%; padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 15px; outline: none;
    transition: border-color .18s, box-shadow .18s;
    background: #f7feff;
}
.form-group input:focus {
    border-color: var(--p1);
    box-shadow: 0 0 0 3px rgba(14,165,233,.15);
    background: #fff;
}
.btn-primary[type=submit], button.btn-primary { width: 100%; margin-top: 8px; }

/* ===== Alert ===== */
.alert {
    padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #059669; border: 1px solid #6ee7b7; }

/* ===== Slider ===== */
.slider-wrap { position: relative; }
.slider-track {
    position: relative; height: 48px;
    background: linear-gradient(90deg, #e0f7ff 0%, #e0fdf4 100%);
    border-radius: 24px; border: 1.5px solid var(--border);
    overflow: hidden; cursor: pointer;
    user-select: none;
}
.slider-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--grad);
    opacity: .22; width: 0;
    pointer-events: none;
    transition: width .04s;
}
.slider-puzzle {
    position: absolute; top: 4px; width: 40px; height: 40px;
    cursor: grab; z-index: 2;
    filter: drop-shadow(0 2px 6px rgba(6,182,212,.35));
}
.slider-puzzle:active { cursor: grabbing; }
.slider-hint {
    position: absolute; width: 100%; text-align: center;
    top: 50%; transform: translateY(-50%);
    font-size: 13px; color: var(--muted); pointer-events: none;
    z-index: 1; font-weight: 500;
}

/* slider SVG 颜色跟随主题 */
.slider-puzzle rect { fill: url(#sliderGrad); }

/* ===== User greeting ===== */
.user-greeting { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ===== Donate Button ===== */
.btn-donate {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}
.btn-donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
    text-decoration: none !important;
    color: #fff !important;
}
.btn-donate svg {
    fill: none;
}

/* ===== Donate Modal ===== */
.donate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.donate-modal.active {
    opacity: 1;
    visibility: visible;
}
.donate-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}
.donate-modal.active .donate-modal-content {
    transform: scale(1);
}
.donate-modal-header {
    background: var(--grad);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.donate-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.donate-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.donate-close:hover {
    background: rgba(255, 255, 255, 0.3);
}
.donate-modal-body {
    padding: 24px;
}
.donate-desc {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
}
.donate-qrcodes {
    display: flex;
    justify-content: center;
    gap: 24px;
}
.donate-qrcode-item {
    text-align: center;
}
.donate-qrcode-item img {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    border: 2px solid var(--border);
    display: block;
    margin-bottom: 10px;
    background: #f5f5f5;
}
.donate-qrcode-item span {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

/* ===== Fixed Donate Button ===== */
.btn-donate-fixed {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999;
}
