/* 
 * 苏大缘 (Suda Love) Premium Design System
 * Focuses on a "Slow Social" vibe with glassmorphism and modern aesthetics.
 */

:root {
    /* Color Palette */
    --suda-red: hsl(0, 100%, 27%);       /* #8B0000 Dark Red */
    --suda-red-light: hsl(0, 80%, 40%);
    --bg-dark: hsl(220, 20%, 10%);       /* Very dark blue, almost black */
    --bg-darker: hsl(220, 25%, 6%);
    --text-main: hsl(0, 0%, 95%);
    --text-muted: hsl(0, 0%, 70%);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Gradients */
    --accent-gradient: linear-gradient(135deg, var(--suda-red), var(--suda-red-light));
    
    /* Typography */
    --font-family: 'Noto Sans SC', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dynamic Background Effect */
#dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(139, 0, 0, 0.15), transparent 40%),
                radial-gradient(circle at 85% 30%, rgba(200, 30, 30, 0.1), transparent 40%);
    animation: pulseBg 15s infinite alternate ease-in-out;
}

@keyframes pulseBg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Base Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px 40px; /* Top padding accounts for fixed nav */
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 17, 26, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(139,0,0,0.5);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--suda-red-light);
}

/* Glassmorphism Refinement */
.glass-panel {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.glass-panel:hover {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Add a subtle top border glow */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    outline: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-save {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-save:hover {
    background: rgba(255, 255, 255, 0.1);
    border-style: solid;
    color: white;
}

.btn-danger {
    background: rgba(200, 50, 50, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(200, 50, 50, 0.5);
}

.btn-danger:hover {
    background: rgba(200, 50, 50, 0.4);
}

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

.full-width {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.checkbox-group label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.checkbox-group input[type="checkbox"], 
.checkbox-group input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--suda-red);
    border-radius: 50%; /* 圆形 */
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-group input[type="checkbox"]:checked,
.checkbox-group input[type="radio"]:checked {
    background: var(--suda-red);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.4);
}

.checkbox-group input[type="checkbox"]:checked::after,
.checkbox-group input[type="radio"]:checked::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s, background 0.3s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--suda-red-light);
    background: rgba(0, 0, 0, 0.4);
}

select option {
    background-color: var(--bg-darker);
    color: white;
}

/* Questionnaire & Progress */
.progress-bar-container { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 15px 0; overflow: hidden; }
.progress-bar { height: 100%; background: var(--suda-red); transition: width 0.3s ease; }
.q-section { animation: fadeIn 0.4s ease; }
.q-intro { font-size: 0.9rem; opacity: 0.8; margin-bottom: 20px; }

/* Tags & Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { padding: 6px 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.tag.active { background: var(--suda-red); border-color: var(--suda-red); color: white; }

/* Sliders */
.slider-item { margin-bottom: 25px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.9rem; }
.important-check { font-size: 0.75rem; display: flex; align-items: center; gap: 4px; color: gold; cursor: pointer; }
.q-slider { width: 100%; -webkit-appearance: none; background: rgba(255,255,255,0.1); height: 4px; border-radius: 2px; }
.q-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--suda-red); border-radius: 50%; cursor: pointer; box-shadow: 0 0 10px rgba(139,0,0,0.5); }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.75rem; opacity: 0.6; margin-top: 5px; }

/* Match Card & Report */
.match-card { position: relative; padding: 30px; }
.match-score-badge { position: absolute; top: 20px; right: 20px; text-align: center; }
.score-val { display: block; font-size: 2rem; font-weight: bold; color: var(--suda-red); line-height: 1; }
.score-label { font-size: 0.7rem; opacity: 0.7; }
.report-section { margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 12px; border-left: 3px solid var(--suda-red); }
.report-section h5 { color: var(--suda-red); margin-bottom: 8px; font-size: 0.95rem; }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { font-size: 0.85rem; padding: 4px 0; opacity: 0.9; }
.report-list li::before { content: "•"; margin-right: 8px; color: var(--suda-red); }

/* Dashboard Actions */
.match-actions { display: grid; gap: 10px; margin-top: 30px; }
.user-brief { display: flex; align-items: center; gap: 15px; }
.avatar-sm { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.1); }
.avatar-lg { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(45deg, var(--suda-red), #ff4d4d); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; border: 4px solid rgba(255,255,255,0.1); }
.avatar-lg img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Layout Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }

a {
    color: var(--suda-red-light);
    text-decoration: none;
    transition: opacity 0.3s;
}
a:hover { opacity: 0.8; }

/* Views styling */
.hero {
    text-align: center;
    padding: 60px 30px;
    margin-top: 40px;
}
.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.auth-box {
    max-width: 400px;
    margin: 50px auto 0;
}
.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 300;
}

/* Match & Profile Cards */
.match-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.match-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-darker), var(--suda-red));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(139,0,0,0.4);
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
}
.tag {
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.history-list {
    list-style: none;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
}
.history-item:last-child {
    border-bottom: none;
}

/* Chat Interface */
.chat-container {
    height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}
.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.message {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}
.message.me {
    align-self: flex-end;
    background: var(--accent-gradient);
    border-bottom-right-radius: 4px;
}
.message.other {
    align-self: flex-start;
    background: rgba(255,255,255,0.1);
    border-bottom-left-radius: 4px;
}
.message-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 5px;
    display: block;
    text-align: right;
}
.chat-input-area {
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--glass-border);
}
#form-chat {
    display: flex;
    gap: 10px;
}
#form-chat input {
    flex: 1;
    border-radius: 30px;
    background: rgba(255,255,255,0.05);
}
#form-chat button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Animations */
.fade-in { animation: fadeIn 0.6s ease forwards; opacity: 0; }
.slide-up { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; transform: translateY(30px); opacity: 0; }

@keyframes fadeIn {
    to { opacity: 1; }
}
@keyframes slideUp {
    to { transform: translateY(0); opacity: 1; }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 30px;
    color: white;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    opacity: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Sponsorship Page */
.qr-codes { margin-top: 30px; }
.qr-item p { margin-top: 10px; font-weight: bold; color: var(--text-main); }
.qr-placeholder { 
    border: 2px dashed var(--glass-border); 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    transition: all 0.3s; 
    background: rgba(255,255,255,0.02);
}
.qr-placeholder:hover { 
    border-color: var(--suda-red-light); 
    background: rgba(255,255,255,0.05);
}

/* Responsive */
@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; gap: 10px; }
    .hero h2 { font-size: 2rem; }
    .hero-actions { flex-direction: column; }
    .container { padding-top: 80px; }
}

/* Contact Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    max-width: 450px;
    width: 100%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-qr {
    width: 250px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: 10px auto;
    border: 5px solid rgba(255,255,255,0.05);
}

.border-top {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.opacity-70 { opacity: 0.7; }
.opacity-50 { opacity: 0.5; }

/* Countdown Clock Styles */
.countdown-clock {
    font-size: 2.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, #ff4c4c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 76, 76, 0.4);
    font-family: monospace;
}

/* Skeleton Screens */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px;
}

.skeleton-text { height: 1.2rem; margin-bottom: 10px; width: 80%; }
.skeleton-avatar { width: 50px; height: 50px; border-radius: 50%; }
.skeleton-rect { height: 150px; width: 100%; border-radius: 12px; }

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton Screen Shimmer Animation */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-text.short { width: 60%; }
.skeleton-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 15px; }
.skeleton-rect { height: 150px; width: 100%; border-radius: 12px; }

/* Dashboard UI Redesign Extra */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

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