/* QQBindPlugin - Modern Style */

:root {
    /* 深蓝色主题 */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* 亮色模式 */
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #f8fafc;
    
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --input-bg: #1e293b;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* 自动跟随设备 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --bg: #0f172a;
        --card: #1e293b;
        --text: #f1f5f9;
        --text-muted: #94a3b8;
        --border: #334155;
        --input-bg: #1e293b;
        --primary: #3b82f6;
        --primary-dark: #2563eb;
        --primary-light: #60a5fa;
        --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.container {
    width: 100%;
    max-width: 420px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-lg);
}

.header-icon i {
    font-size: 32px;
    color: white;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Card */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    border: 1px solid var(--border);
    transition: background 0.3s, border-color 0.3s;
}

/* Form */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--card);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

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

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

.btn-secondary:hover {
    background: var(--border);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
}

/* 发送验证码按钮 */
.btn-code {
    padding: 14px 12px;
    font-size: 13px;
    white-space: nowrap;
}

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

/* Messages */
.error, .success {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 10px;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Links */
.footer-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-link a:hover {
    text-decoration: underline;
}

/* Dashboard specific */
.info-grid {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
}

.info-item .label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.info-item .label i {
    color: var(--primary);
    width: 18px;
}

.info-item .value {
    font-weight: 600;
    color: var(--text);
}

/* QQ头像 */
.qq-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.qq-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qq-info .qq-text {
    display: flex;
    flex-direction: column;
}

.qq-info .qq-label {
    font-size: 12px;
    color: var(--text-muted);
}

.qq-info .qq-number {
    font-weight: 600;
    color: var(--text);
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-group .btn {
    flex: 1;
}

/* Section */
.section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.section-title i {
    color: var(--primary);
}

/* QQ Avatar */
.user-avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.qq-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow);
}

.qq-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border);
}

.qq-avatar-placeholder i {
    font-size: 32px;
    color: var(--text-muted);
}

.qq-avatar-sm {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

/* QQ Info Box */
.qq-info-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.qq-info-box.error-state {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.qq-info-text {
    display: flex;
    flex-direction: column;
}

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

.qq-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* Steps */
.steps {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.step.active {
    color: var(--primary);
}

.step.active .step-num {
    background: var(--primary);
    color: white;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.step-text {
    font-size: 14px;
    font-weight: 500;
}

/* Confirm Box */
.confirm-box {
    background: rgba(30, 64, 175, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.confirm-box h4 {
    color: var(--warning);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.confirm-box p {
    margin-bottom: 8px;
}

/* Info Box */
.info-box {
    background: rgba(30, 64, 175, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.info-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box ul {
    list-style: none;
    font-size: 14px;
    color: var(--text-muted);
}

.info-box li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
}

.info-box code {
    background: var(--primary);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', monospace;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Captcha / Turnstile */
#turnstile-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.captcha-container {
    margin-bottom: 20px;
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
    display: none;
}

.password-strength.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s, background 0.3s;
    border-radius: 2px;
}

.strength-fill.weak { width: 33%; background: var(--error); }
.strength-fill.medium { width: 66%; background: var(--warning); }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-text {
    font-size: 12px;
    font-weight: 500;
    min-width: 40px;
}

.strength-text.weak { color: var(--error); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

.toast i {
    font-size: 18px;
}

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

.toast.error {
    background: var(--error);
    color: white;
}

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

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .card {
        padding: 24px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}