:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 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-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.4);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.5);
    --primary-bg: #1e1b4b;
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.navbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(15,23,42,0.9);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand i {
    font-size: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.mobile-toggle:hover {
    background: var(--bg-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    border: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34,197,94,0.3);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239,68,68,0.3);
}

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

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245,158,11,0.3);
}

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

.hero {
    padding: 140px 0 80px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 56px;
    font-weight: 900;
    line-height: 1.08;
    margin-bottom: 24px;
}

.hero h1 .highlight {
    color: var(--primary);
    position: relative;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    opacity: 0.3;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 48px;
}

.hero-illustration {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card {
    position: absolute;
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    font-size: 20px;
    color: var(--primary);
}

.card-1 {
    top: 5%;
    left: 5%;
    animation-delay: 0s;
}

.card-2 {
    top: 35%;
    right: 0%;
    animation-delay: 0.6s;
}

.card-3 {
    bottom: 15%;
    left: 10%;
    animation-delay: 1.2s;
}

.card-4 {
    bottom: 25%;
    right: 10%;
    animation-delay: 1.8s;
}

.orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: var(--primary);
}

.orb-1 {
    width: 350px;
    height: 350px;
    top: -50px;
    right: -50px;
}

.orb-2 {
    width: 200px;
    height: 200px;
    bottom: 0;
    left: 0;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-16px);
    }
}

.features {
    padding: 80px 0;
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 18px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 22px;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.support {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.support-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.support-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.support-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 12px;
}

.support-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.support-card a {
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
}

.support-card a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.connect {
    padding: 80px 0;
    background: var(--bg-primary);
}

.connect-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 50px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.connect-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.connect-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.connect-content h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
}

.connect-content > p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.connect-steps {
    margin-bottom: 30px;
}

.connect-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.connect-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-title {
    font-weight: 600;
    display: block;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.connect-form .input-group {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    padding: 0 14px;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.input-wrapper i {
    color: var(--text-muted);
    font-size: 16px;
}

.input-wrapper input {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    outline: none;
}

.connect-form input::placeholder {
    text-transform: none;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--text-muted);
}

.connect-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect-illustration {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect-illustration i {
    font-size: 80px;
    color: var(--primary);
    opacity: 0.2;
    z-index: 1;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.05;
    }
}

.activation-code {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px dashed var(--primary);
}

.code-reveal {
    text-align: center;
}

.code-reveal p {
    margin-bottom: 12px;
}

.code-box {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 10px;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: monospace;
}

.code-box .btn {
    letter-spacing: normal;
}

.code-timer {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.code-timer span {
    font-weight: 700;
    color: var(--primary);
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.dashboard,
.chat-page,
.gallery-page,
.api-page,
.vip-page,
.settings-page,
.admin-page {
    padding-top: 80px;
    padding-bottom: 40px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 16px;
}

.chat-header-left h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.balance-display i {
    color: var(--warning);
}

.vip-badge {
    background: var(--warning);
    color: white;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.model-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 0 14px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.model-select-wrapper i {
    color: var(--text-muted);
}

.model-select {
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    min-width: 160px;
    cursor: pointer;
}

.model-select option {
    background: var(--bg-card);
}

.chat-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-messages {
    height: 520px;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
}

.message.user {
    flex-direction: row-reverse;
}

.message.error .message-content {
    border: 1px solid var(--danger);
    background: #fee2e2;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.message-avatar i {
    font-size: 18px;
}

.message-content {
    max-width: 75%;
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 12px;
}

.message-sender {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}

.message.user .message-sender {
    color: rgba(255,255,255,0.8);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message.user .message-time {
    color: rgba(255,255,255,0.6);
}

.message-content p {
    margin: 0;
    word-wrap: break-word;
    line-height: 1.7;
}

.message-footer {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.message-model {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 50px;
}

.message.user .message-model {
    display: none;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    transition: var(--transition);
}

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

.chat-input-wrapper .btn {
    padding: 12px 20px;
    border-radius: var(--radius);
    height: 48px;
}

.chat-input-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.chat-input-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s ease;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-grid h4 {
    margin-bottom: 16px;
    font-size: 16px;
}

.footer-grid p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-grid a {
    display: block;
    color: var(--text-secondary);
    padding: 4px 0;
    transition: var(--transition);
    font-size: 14px;
}

.footer-grid a:hover {
    color: var(--primary);
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.footer-social a:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 800;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.vip {
    border-color: var(--warning);
    background: var(--primary-bg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 22px;
    color: white;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.card-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

.dashboard-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.daily-bonus,
.stats-global {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.daily-bonus h3,
.stats-global h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.daily-bonus p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: var(--text-secondary);
}

.stat-row span:last-child {
    font-weight: 600;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 16px;
}

.gallery-header h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.gallery-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-prompt {
    color: white;
    font-size: 13px;
    margin: 0;
}

.gallery-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.gallery-date {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    max-width: 500px;
    margin: 60px auto;
    padding: 32px;
    border-radius: var(--radius-lg);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.api-header {
    padding: 20px 0;
}

.api-header h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-header p {
    color: var(--text-secondary);
}

.api-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin: 20px 0;
}

.api-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 16px;
    margin-bottom: 12px;
}

.key-display span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.key-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.key-status.active {
    background: #dcfce7;
    color: #166534;
}

.key-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.key-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.stat-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.stat-value {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-top: 2px;
}

.api-docs h4 {
    margin: 16px 0 8px;
    font-size: 16px;
}

.api-docs code {
    display: block;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    font-size: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.api-docs ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.api-docs ul li {
    padding: 4px 0;
    font-size: 14px;
}

.api-docs ul li code {
    display: inline;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 13px;
}

.api-docs pre {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.api-docs pre code {
    display: block;
    background: transparent;
    padding: 0;
    border: none;
    white-space: pre;
}

.vip-header {
    padding: 20px 0;
}

.vip-header h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vip-header p {
    color: var(--text-secondary);
}

.vip-status {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.vip-status.active {
    border-color: var(--warning);
    background: var(--primary-bg);
}

.vip-status.inactive {
    border-color: var(--border-color);
}

.vip-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--primary-bg);
    color: var(--warning);
}

.vip-status.inactive .vip-icon {
    color: var(--text-muted);
}

.vip-info h2 {
    font-size: 20px;
    font-weight: 700;
}

.vip-info p {
    color: var(--text-secondary);
}

.vip-progress {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--warning);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.vip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.vip-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.vip-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vip-card > p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.vip-prices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-option {
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.price-option:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.price-days {
    font-weight: 600;
}

.price-stars {
    color: var(--text-secondary);
}

.price-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--warning);
    color: white;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.redeem-form .input-group {
    display: flex;
    gap: 10px;
}

.redeem-form .input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

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

.vip-benefits {
    margin-top: 30px;
}

.vip-benefits h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.benefit-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.benefit-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.benefit-item i {
    font-size: 24px;
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}

.benefit-item span {
    font-size: 14px;
    font-weight: 500;
}

.settings-header {
    padding: 20px 0;
}

.settings-header h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-header p {
    color: var(--text-secondary);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 20px 0;
}

.settings-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.settings-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

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

.setting-value {
    font-weight: 500;
    font-size: 14px;
}

.setting-value.vip {
    color: var(--warning);
}

.admin-header {
    padding: 20px 0;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header p {
    color: var(--text-secondary);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.admin-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.admin-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card.full-width {
    grid-column: 1 / -1;
}

.admin-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.admin-stats .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.admin-stats .stat-item:last-child {
    border-bottom: none;
}

.admin-stats .stat-item span:last-child {
    font-weight: 600;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background: var(--bg-secondary);
}

.admin-table .btn {
    padding: 4px 12px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 16px 0;
        gap: 12px;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .hero-grid,
    .connect-card,
    .dashboard-footer,
    .vip-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .floating-card {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-messages {
        height: 380px;
    }
    
    .chat-controls {
        width: 100%;
    }
    
    .model-select-wrapper {
        flex: 1;
    }
    
    .model-select {
        min-width: 120px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .connect-card {
        padding: 24px;
    }
    
    .code-box {
        font-size: 24px;
        letter-spacing: 6px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 24px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .key-stats {
        grid-template-columns: 1fr;
    }
}