
:root {

    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-gradient: linear-gradient(135deg, var(--site-primary, #6366f1) 0%, var(--site-primary-alt, #a855f7) 100%);
    --accent-gradient: linear-gradient(135deg, var(--site-primary, #6366f1) 0%, var(--site-primary-alt, #a855f7) 100%);
    --success-gradient: linear-gradient(135deg, var(--site-success, #10b981) 0%, var(--site-success-alt, #34d399) 100%);
    --warning-gradient: linear-gradient(135deg, var(--site-success, #10b981) 0%, var(--site-success-alt, #34d399) 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    --bg: #f8fafc;
    --bg-pattern: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
                  radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.06) 0px, transparent 50%),
                  radial-gradient(at 100% 100%, rgba(34, 211, 238, 0.06) 0px, transparent 50%),
                  radial-gradient(at 0% 100%, rgba(168, 85, 247, 0.06) 0px, transparent 50%);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.5);
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: rgba(226, 232, 240, 0.8);
    --divider: rgba(226, 232, 240, 0.6);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

body.dark {
    --bg: #0f172a;
    --bg-pattern: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                  radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.1) 0px, transparent 50%),
                  radial-gradient(at 100% 100%, rgba(34, 211, 238, 0.1) 0px, transparent 50%),
                  radial-gradient(at 0% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(148, 163, 184, 0.1);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: rgba(148, 163, 184, 0.15);
    --divider: rgba(148, 163, 184, 0.1);
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-pattern);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
}
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}
.page-wrapper > .container { width: 100%; }

a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-dark); }

.container { max-width: 1600px; margin: 0 auto; padding: 0 24px; width: 100%; }

.card,
.sponsors-section,
.goals-section,
.qrcode-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-bottom: 40px !important;
    width: 100%;
    display: block;
}
.card:last-child,
.sponsors-section:last-child,
.goals-section:last-child,
.qrcode-section:last-child {
    margin-bottom: 0 !important;
}

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

.card-body { padding: 24px; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--divider);
}
.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    -webkit-text-fill-color: var(--text);
}
.card-header h3 i { color: var(--primary); }
body.dark .card-header h3 { color: #f1f5f9; -webkit-text-fill-color: #f1f5f9; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    user-select: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    color: white;
}
.btn-primary:active { transform: translateY(0); }

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    filter: grayscale(50%);
    transform: none !important;
    box-shadow: none !important;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
.btn:disabled i,
.btn-primary:disabled i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.btn-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.45);
    color: white;
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

.btn-sm { padding: 6px 12px; font-size: 0.825rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-group label i { color: var(--primary); font-size: 0.8rem; }

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text);
    transition: var(--transition);
}

body.dark .form-group input,
body.dark .form-group textarea,
body.dark .form-group select {
    background: rgba(15, 23, 42, 0.5);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

body.dark .form-group input:focus,
body.dark .form-group textarea:focus,
body.dark .form-group select:focus {
    background: rgba(15, 23, 42, 0.7);
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid;
}
.alert-success {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.12), rgba(56, 249, 215, 0.08));
    color: #047857;
    border-color: rgba(67, 233, 123, 0.3);
}
.alert-error {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(225, 29, 72, 0.08));
    color: #be123c;
    border-color: rgba(244, 63, 94, 0.3);
}
.alert-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.12), rgba(0, 242, 254, 0.08));
    color: #075985;
    border-color: rgba(79, 172, 254, 0.3);
}

body.dark .alert-success { color: #6ee7b7; }
body.dark .alert-error { color: #fda4af; }
body.dark .alert-info { color: #7dd3fc; }

.sponsors-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.sponsors-table thead th {
    background: rgba(99, 102, 241, 0.06);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.sponsors-table thead th:first-child { border-top-left-radius: var(--radius); }
.sponsors-table thead th:last-child { border-top-right-radius: var(--radius); }

.sponsors-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--divider);
    color: var(--text);
}
.sponsors-table tbody tr { transition: var(--transition-fast); }
.sponsors-table tbody tr:hover { background: rgba(99, 102, 241, 0.04); }
.sponsors-table tbody tr:last-child td { border-bottom: 0; }
.sponsors-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.sponsors-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }

.amount { color: var(--primary); font-weight: 600; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
}
.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}
.pagination .current {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.admin-header {
    background: var(--primary-gradient);
    color: white;
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}
.admin-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 65px;
    z-index: 99;
}
body.dark .admin-nav { background: rgba(15, 23, 42, 0.7); }

.admin-nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}
.admin-nav a i { font-size: 0.8rem; }
.admin-nav a:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}
.admin-nav a.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.admin-content { padding: 32px 0; }

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 40px;
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s ease;
}
.login-back {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.2s ease;
    z-index: 2;
}
.login-back:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(-2px);
}
.login-back i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}
.login-back:hover i {
    transform: translateX(-2px);
}
body.dark .login-back {
    color: #94a3b8;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}
body.dark .login-back:hover {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.25);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-container h2 {
    text-align: center;
    margin-bottom: 28px;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.login-container h2 i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-container .form-group input {
    padding: 13px 16px;
    font-size: 0.95rem;
}

.login-container .btn-primary {
    padding: 13px;
    font-size: 0.95rem;
    margin-top: 8px;
}

.lock-message {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 10px 30px rgba(244, 63, 94, 0.3);
}
.lock-message i { font-size: 2rem; margin-bottom: 10px; }
.lock-timer {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

.password-wrapper { position: relative; }
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    transition: var(--transition-fast);
}
.password-toggle:hover { color: var(--primary); }

.captcha-container {
    position: relative;
    width: 300px;
    height: 150px;
    margin: 0 auto 12px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.captcha-bg, .captcha-block { display: block; }
.captcha-block { position: absolute; top: 0; left: 0; pointer-events: none; }

.captcha-slider {
    width: 300px;
    height: 44px;
    margin: 0 auto;
    position: relative;
    background: rgba(241, 245, 249, 0.8);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1.5px solid var(--border);
}
body.dark .captcha-slider { background: rgba(30, 41, 59, 0.6); }

.captcha-slider-track { width: 100%; height: 100%; position: relative; }
.captcha-slider-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    user-select: none;
    transition: transform 0.05s linear;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.captcha-slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    font-weight: 500;
}
.captcha-refresh {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    backdrop-filter: blur(10px);
}
.captcha-refresh:hover { background: white; color: var(--primary); transform: rotate(180deg); }

.captcha-mini, .captcha-success {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.captcha-mini:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
.captcha-mini i, .captcha-success i { font-size: 1.1rem; margin-right: 12px; color: var(--text-muted); }
.captcha-mini span { flex: 1; font-size: 0.9rem; color: var(--text-muted); }

.captcha-success { border-color: rgba(67, 233, 123, 0.4); background: rgba(67, 233, 123, 0.06); }
.captcha-success i.fa-check-circle { color: #10b981; }
.captcha-success span { color: #047857; font-weight: 500; }
body.dark .captcha-success span { color: #6ee7b7; }
.captcha-success a {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
}
.captcha-success a:hover { color: var(--primary); text-decoration: underline; }

.captcha-error {
    text-align: center;
    color: #f43f5e;
    font-size: 0.8rem;
    margin-top: 8px;
    display: none;
}

.captcha-wrapper { margin: 12px auto; width: 300px; }
.captcha-expanded { display: block; }

.gt-captcha-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
}
.gt-captcha-trigger::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(168, 85, 247, 0.04));
    opacity: 0;
    transition: opacity 0.3s;
}
.gt-captcha-trigger:hover::before { opacity: 1; }
.gt-captcha-trigger:hover { border-color: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.gt-trigger-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.gt-trigger-text {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.gt-trigger-arrow {
    color: var(--text-light);
    font-size: 0.8rem;
    transition: transform 0.3s;
    position: relative;
    z-index: 1;
}
.gt-captcha-trigger:hover .gt-trigger-arrow { transform: translateX(2px); color: var(--primary); }

.gt-trigger-verified {
    border-color: rgba(67, 233, 123, 0.5);
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.08), rgba(56, 249, 215, 0.04));
}
.gt-trigger-verified .gt-trigger-icon {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    box-shadow: 0 4px 10px rgba(67, 233, 123, 0.4);
}
.gt-trigger-verified .gt-trigger-text { color: #047857; font-weight: 600; }
body.dark .gt-trigger-verified .gt-trigger-text { color: #6ee7b7; }

.gt-trigger-verified .gt-trigger-icon::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}
.gt-trigger-verified .gt-trigger-icon i { display: none; }

@keyframes gtMaskIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes gtMaskOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes gtModalIn {
    0%   { opacity: 0; transform: scale(0.7) translateY(30px) rotate(-2deg); }
    60%  { opacity: 1; transform: scale(1.04) translateY(-4px) rotate(0.5deg); }
    100% { opacity: 1; transform: scale(1) translateY(0) rotate(0); }
}
@keyframes gtModalOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.85) translateY(20px); }
}

.gt-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.gt-modal-mask[style*="display: flex"] {
    display: flex !important;
}
.gt-modal-mask.show {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    animation: gtMaskIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.gt-modal-mask.hide {
    display: flex !important;
    opacity: 0 !important;
    pointer-events: none !important;
    animation: gtMaskOut 0.25s ease-in forwards;
}

.gt-modal {
    position: relative;
    width: min(360px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform-origin: center center;
    opacity: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    animation: none;
}
.gt-modal-mask.show .gt-modal {
    animation: gtModalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.gt-modal-mask.hide .gt-modal,
.gt-modal-mask:not(.show):not([style*="display: block"]) .gt-modal {
    animation: gtModalOut 0.25s ease-in forwards;
}

.gt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.4);
}
body.dark .gt-header { background: rgba(15, 23, 42, 0.4); }

.gt-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.gt-title i {
    color: var(--primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gt-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.gt-close:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    transform: rotate(90deg);
}

.gt-body { padding: 16px 20px 20px; flex: 1; overflow-y: auto; }

.gt-puzzle-area {
    position: relative;
    width: 100%;
    aspect-ratio: 320 / 200;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #1a1a2e;
    user-select: none;
}
.gt-puzzle-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.gt-puzzle-bg svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.gt-puzzle-piece {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    pointer-events: none;
    z-index: 3;
    transition: filter 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}
.gt-puzzle-piece.matched {
    filter: drop-shadow(0 4px 14px rgba(67, 233, 123, 0.7));
    z-index: 4;
}
.gt-piece-inner {
    width: 100%;
    height: 100%;
}
.gt-piece-inner svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.gt-puzzle-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    border: 1.5px dashed rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 2;
    animation: targetPulse 2s ease-in-out infinite;
}
@keyframes targetPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1); }
}

.gt-slider-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.gt-slider {
    flex: 1;
    height: 50px;
    position: relative;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.gt-slider-track {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    user-select: none;
    pointer-events: none;
}
.gt-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(67, 233, 123, 0.25), rgba(56, 249, 215, 0.15));
    width: 0;
    transition: width 0.05s linear;
}
.gt-slider-fill.success { background: linear-gradient(90deg, rgba(67, 233, 123, 0.5), rgba(56, 249, 215, 0.4)); }
.gt-slider-fill.fail { background: linear-gradient(90deg, rgba(244, 63, 94, 0.4), rgba(239, 68, 68, 0.3)); }

.gt-thumb-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
    transition: transform 0.05s linear;
    z-index: 2;
}
.gt-thumb-btn:active { cursor: grabbing; }
.gt-thumb-btn.success { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.gt-thumb-btn.fail { background: linear-gradient(135deg, #f43f5e, #e11d48); animation: shake 0.4s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.gt-refresh {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.gt-refresh:hover { color: var(--primary); border-color: var(--primary); transform: rotate(180deg); }

.gt-status {
    text-align: center;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 18px;
    transition: var(--transition);
}
.gt-status.success { color: #10b981; font-weight: 500; }
.gt-status.fail { color: #f43f5e; font-weight: 500; }
body.dark .gt-status.success { color: #6ee7b7; }
body.dark .gt-status.fail { color: #fda4af; }

.gt-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--divider);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
body.dark .gt-footer { background: rgba(255, 255, 255, 0.02); }
.gt-footer i { color: var(--primary); }

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .admin-nav ul { gap: 2px; }
    .admin-nav a { padding: 6px 10px; font-size: 0.78rem; }
    .admin-nav a span { display: none; }
    .sponsors-table { font-size: 0.8rem; }
    .sponsors-table th, .sponsors-table td { padding: 10px 8px; }
    .login-container { padding: 28px 24px; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

.navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
body.dark .navbar { background: rgba(15, 23, 42, 0.75); }

.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.navbar-brand i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 4px;
}
.navbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}
.navbar-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    transform: translateY(-1px);
}
.navbar-link i { font-size: 0.85rem; }

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}
.navbar-toggle:hover { background: rgba(99, 102, 241, 0.1); }

@media (max-width: 768px) {
    .navbar-toggle { display: block; }
    .navbar-menu {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 12px;
        display: none;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .navbar-menu.active { display: flex; }
    .navbar-link { padding: 12px 16px; }
}

.header {
    text-align: center;
    padding: 60px 30px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-2xl);
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
}
.header h1 {
    color: var(--text);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.header h1 i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    position: relative;
}

.qrcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    padding: 8px 4px 16px;
}
.qrcode-item {
    text-align: center;
    padding: 18px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--divider);
    transition: var(--transition);
}
body.dark .qrcode-item { background: rgba(15, 23, 42, 0.4); }
.qrcode-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.qrcode-item img {
    max-width: 160px;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.qrcode-item p {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.goal-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.goal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.goal-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}
.goal-info h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.goal-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.progress-bar {
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-full);
    height: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}
.goal-stats {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.goal-stats strong {
    color: var(--text);
    font-weight: 600;
    margin-left: 4px;
}

.stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.stats strong {
    color: var(--primary);
    font-weight: 600;
}

.sponsor-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px;
}
.sponsor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    transition: var(--transition);
}
body.dark .sponsor-item { background: rgba(15, 23, 42, 0.4); }
.sponsor-item:hover {
    transform: translateX(4px);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}
.sponsor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-light);
    text-align: center;
}
.sponsor-empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
    color: var(--primary);
}
.sponsor-empty p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.7;
}
.sponsor-info { flex: 1; min-width: 0; }
.sponsor-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.sponsor-meta {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    line-height: 1.5;
    margin-top: 2px;
}
.sponsor-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: var(--text);
    font-weight: 500;
}
.sponsor-meta span:empty { display: none; }
.sponsor-meta i {
    font-size: 0.75rem;
    color: var(--primary);
    opacity: 0.9;
    flex-shrink: 0;
}
body.dark .sponsor-meta span {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
    color: #e2e8f0;
}
.sponsor-amount {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    margin-left: 16px;
}

.footer {
    padding: 24px 0;
    border-top: 1px solid var(--divider);
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: transparent;
    flex-shrink: 0;
    width: 100%;
    text-align: center !important;
}
.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px;
    flex-wrap: wrap;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.footer-text {
    margin: 0 !important;
    color: var(--text-muted);
    text-align: center !important;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: var(--transition);
    flex-shrink: 0;
}
.theme-switch:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.theme-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.theme-switch-track {
    position: relative;
    width: 44px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 12px;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.theme-switch input:checked + .theme-switch-track {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}
.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 0.7rem;
}
.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
    transform: translateX(20px);
    color: #818cf8;
}
.theme-switch-thumb i {
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}
.theme-icon-light { opacity: 1; transform: rotate(0); }
.theme-icon-dark { opacity: 0; transform: rotate(-180deg); }
.theme-switch input:checked + .theme-switch-track .theme-icon-light { opacity: 0; transform: rotate(180deg); }
.theme-switch input:checked + .theme-switch-track .theme-icon-dark { opacity: 1; transform: rotate(0); }

.theme-switch-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    position: relative;
    min-width: 4.5em;
    display: inline-block;
    text-align: left;
}
.theme-switch-label::before {
    content: '浅色模式';
}
body.dark .theme-switch-label::before {
    content: '深色模式';
}

.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}
.theme-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
}

html.preload-dark body { background: #0f172a !important; }

@media (prefers-color-scheme: dark) {
    html:not(.user-light) body:not(.user-dark) {
        background: #0f172a;
        color: #e2e8f0;
    }
    html:not(.user-light) body:not(.user-dark) .header,
    html:not(.user-light) body:not(.user-dark) .card,
    html:not(.user-light) body:not(.user-dark) .sponsors-section,
    html:not(.user-light) body:not(.user-dark) .goals-section,
    html:not(.user-light) body:not(.user-dark) .qrcode-section {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(148, 163, 184, 0.1);
    }
    html:not(.user-light) body:not(.user-dark) .navbar {
        background: rgba(15, 23, 42, 0.75);
    }
    html:not(.user-light) body:not(.user-dark) .sponsor-item,
    html:not(.user-light) body:not(.user-dark) .qrcode-item {
        background: rgba(15, 23, 42, 0.4);
    }
    html:not(.user-light) body:not(.user-dark) .footer {
        color: #94a3b8;
    }
    html:not(.user-light) body:not(.user-dark) .goal-card {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.05));
    }
    html:not(.user-light) body:not(.user-dark) .progress-bar {
        background: rgba(99, 102, 241, 0.15);
    }
}

body.dark {
    --bg: #0f172a;
    --bg-pattern: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                  radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.1) 0px, transparent 50%),
                  radial-gradient(at 100% 100%, rgba(34, 211, 238, 0.1) 0px, transparent 50%),
                  radial-gradient(at 0% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(148, 163, 184, 0.1);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: rgba(148, 163, 184, 0.15);
    --divider: rgba(148, 163, 184, 0.1);
    background: #0f172a;
    color: #e2e8f0;
}

body.dark .navbar {
    background: rgba(15, 23, 42, 0.75) !important;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}
body.dark .navbar-brand {
    color: #e2e8f0;
}
body.dark .navbar-link {
    color: #94a3b8;
}
body.dark .navbar-link:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
}

body.dark .header,
body.dark .card,
body.dark .sponsors-section,
body.dark .goals-section,
body.dark .qrcode-section {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
body.dark .header h1 {
    color: #e2e8f0;
}
body.dark .header p {
    color: #94a3b8;
}

body.dark .sponsor-item,
body.dark .qrcode-item {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark .sponsor-item:hover,
body.dark .qrcode-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}
body.dark .sponsor-name {
    color: #e2e8f0;
}
body.dark .sponsor-meta {
    color: #94a3b8;
}

body.dark .goal-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.06));
    border-color: rgba(99, 102, 241, 0.2);
}
body.dark .goal-icon {
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
body.dark .goal-info h4 {
    color: #e2e8f0;
}
body.dark .goal-info p {
    color: #94a3b8;
}
body.dark .progress-bar {
    background: rgba(99, 102, 241, 0.15);
}
body.dark .goal-stats {
    color: #94a3b8;
}
body.dark .goal-stats strong {
    color: #c7d2fe;
}

body.dark .footer {
    color: #94a3b8;
    border-top-color: rgba(148, 163, 184, 0.1);
}
body.dark .footer-text {
    color: #94a3b8;
}

body.dark .card-header {
    border-bottom-color: rgba(148, 163, 184, 0.1);
}
body.dark .card-header h3 {
    color: #e2e8f0;
}

body.dark .stats {
    color: #94a3b8;
}

body.dark .sponsors-table thead th {
    background: rgba(99, 102, 241, 0.08);
    color: #94a3b8;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}
body.dark .sponsors-table tbody td {
    color: #e2e8f0;
    border-bottom-color: rgba(148, 163, 184, 0.08);
}
body.dark .sponsors-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

body.dark .pagination a,
body.dark .pagination span {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}
body.dark .pagination a:hover {
    background: var(--primary);
    color: white;
}

body.dark .btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark .btn-secondary:hover {
    background: rgba(148, 163, 184, 0.18);
    color: #f1f5f9;
}

body.dark .form-group label {
    color: #e2e8f0;
}
body.dark .form-group input,
body.dark .form-group textarea,
body.dark .form-group select {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}
body.dark .form-group input:focus,
body.dark .form-group textarea:focus,
body.dark .form-group select:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary);
}

body.dark .alert-success { color: #6ee7b7; background: rgba(67, 233, 123, 0.08); border-color: rgba(67, 233, 123, 0.3); }
body.dark .alert-error { color: #fda4af; background: rgba(244, 63, 94, 0.08); border-color: rgba(244, 63, 94, 0.3); }
body.dark .alert-info { color: #7dd3fc; background: rgba(79, 172, 254, 0.08); border-color: rgba(79, 172, 254, 0.3); }

body.dark .qrcode-item p { color: #e2e8f0; }

body.dark .theme-switch {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark .theme-switch-label {
    color: #e2e8f0;
}

body.dark ::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #e2e8f0;
}

.icon-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}
.icon-selector input[type="radio"] { display: none; }
.icon-selector label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--card-bg);
    margin: 0;
    gap: 6px;
}
.icon-selector label i {
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: var(--transition);
    margin: 0;
}
.icon-selector input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.icon-selector input[type="radio"]:checked + label i { color: var(--primary); }
.icon-selector label:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.layout-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}
.editor-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.editor-panel h3 {
    margin: 0 0 20px 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.editor-panel h3 i { color: var(--primary); }

.module-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: move;
    transition: var(--transition);
}
body.dark .module-item { background: rgba(15, 23, 42, 0.4); }
.module-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.module-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}
.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.module-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.module-title i { color: var(--primary); }
.module-controls { display: flex; align-items: center; gap: 12px; }
.order-input {
    width: 60px;
    padding: 6px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.85rem;
}
.order-input:focus { outline: none; border-color: var(--primary); }

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .toggle-slider {
    background: var(--primary-gradient);
}
input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.color-picker-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.color-picker-item { display: flex; flex-direction: column; gap: 6px; }
.color-picker-item label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin: 0; }
.color-input-wrapper { display: flex; align-items: center; gap: 8px; }
.color-input-wrapper input[type="color"] {
    width: 40px; height: 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
    background: var(--card-bg);
}
.color-input-wrapper input[type="text"] {
    flex: 1; padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--card-bg);
    color: var(--text);
}

.range-input { width: 100%; margin: 8px 0; accent-color: var(--primary); }
.range-value {
    display: inline-block;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.dark-mode-selector { display: flex; gap: 10px; margin-top: 10px; }
.dark-mode-option {
    flex: 1;
    padding: 14px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.dark-mode-option i { font-size: 1.3rem; margin-bottom: 6px; display: block; }
.dark-mode-option:hover { border-color: var(--primary-light); }
.dark-mode-option.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.dark-mode-option.active i { color: var(--primary); }

.preview-panel {
    background: rgba(241, 245, 249, 0.5);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 400px;
    border: 1px solid var(--border);
}
body.dark .preview-panel { background: rgba(15, 23, 42, 0.4); }

.preview-frame {
    border-radius: var(--radius);
    padding: 20px;
    min-height: 360px;
    transition: all 0.3s;
}
.preview-module {
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}
.preview-module h4 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.preview-module p { margin: 0; font-size: 0.8rem; opacity: 0.7; }

.save-button {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

@media (max-width: 1200px) {
    .layout-editor { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sponsor-empty {
        padding: 24px 14px !important;
    }
    .sponsor-empty i {
        font-size: 2rem !important;
        margin-bottom: 6px !important;
    }
    .sponsor-item {
        padding: 10px 12px !important;
    }
    .sponsor-meta { gap: 5px !important; font-size: 0.75rem !important; }
    .sponsor-meta span { padding: 2px 7px !important; }
}

@media (max-width: 640px) {
    .header { padding: 40px 20px; }
    .header h1 { font-size: 1.5rem; }
    .qrcode-grid { grid-template-columns: 1fr 1fr; }
    .color-picker-group { grid-template-columns: 1fr; }
    .icon-selector { grid-template-columns: repeat(2, 1fr); }
    .dark-mode-selector { flex-direction: column; }
    .sponsor-empty {
        padding: 20px 12px !important;
        gap: 6px;
    }
    .sponsor-empty i {
        font-size: 1.8rem !important;
        margin-bottom: 4px !important;
    }
    .sponsor-empty p {
        font-size: 0.8rem !important;
        margin: 0;
    }
    .sponsor-item {
        padding: 10px 12px !important;
        flex-wrap: wrap;
    }
    .sponsor-info { width: 100%; margin-bottom: 4px; }
    .sponsor-amount {
        font-size: 0.95rem !important;
        margin-left: auto;
    }
    .sponsor-meta {
        gap: 4px !important;
        font-size: 0.7rem !important;
    }
    .sponsor-meta span {
        padding: 2px 6px !important;
        gap: 3px;
        font-size: 0.7rem;
    }
    .sponsor-meta i { font-size: 0.65rem; }
}

@media (max-width: 640px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .footer-text { order: 2; }
    .theme-switch { order: 1; }
    .theme-switch-label { display: none; }
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
}
.lightbox.show {
    display: flex;
    animation: lbFadeIn 0.3s ease forwards;
}
.lightbox.hide {
    animation: lbFadeOut 0.25s ease forwards;
}
@keyframes lbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes lbFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    animation: lbBlurIn 0.4s ease;
}
body.dark .lightbox-backdrop {
    background: rgba(0, 0, 0, 0.9);
}
@keyframes lbBlurIn {
    from { backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); background: rgba(15, 23, 42, 0); }
    to { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); background: rgba(15, 23, 42, 0.85); }
}
.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: scale(0.6) translateY(40px) rotate(-3deg);
    animation: lbContentIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}
@keyframes lbContentIn {
    0% {
        opacity: 0;
        transform: scale(0.6) translateY(40px) rotate(-3deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.05) translateY(-4px) rotate(1deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
}
.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #fff;
    padding: 8px;
    animation: lbImageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}
@keyframes lbImageIn {
    from {
        opacity: 0;
        transform: scale(0.85);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}
body.dark .lightbox-image {
    background: #1e293b;
}
.lightbox-caption {
    color: #f8fafc;
    font-size: 0.95rem;
    margin: 0;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 999px;
    opacity: 0;
    animation: lbCaptionIn 0.4s ease 0.4s forwards;
}
@keyframes lbCaptionIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #1e293b;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
    opacity: 0;
    animation: lbCloseIn 0.4s ease 0.3s forwards;
}
@keyframes lbCloseIn {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}
.lightbox-close:hover {
    transform: scale(1.15) rotate(90deg);
    background: #fee2e2;
    color: #dc2626;
}
body.dark .lightbox-close {
    background: #334155;
    color: #f8fafc;
}
body.dark .lightbox-close:hover {
    background: #ef4444;
    color: #fff;
}
.qrcode-item img {
    cursor: zoom-in !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.qrcode-item img:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

@media (max-width: 640px) {
    .lightbox { padding: 12px; }
    .lightbox-content { max-width: 95vw; }
    .lightbox-image { max-width: 95vw; max-height: 75vh; padding: 4px; }
    .lightbox-close { top: -10px; right: -10px; width: 36px; height: 36px; }
}
