/* ==============================
   扫码进群系统 - 公共样式
   主题：薄荷绿 + 深色模式支持
   ============================== */

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

:root {
    --primary: #2DD4BF;
    --primary-light: #5EEAD4;
    --primary-dark: #0D9488;
    --bg: #ffffff;
    --bg-secondary: #F0FDFA;
    --card: #ffffff;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --success: #10B981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(45, 212, 191, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0e17;
        --bg-secondary: #111827;
        --card: #111827;
        --text: #F3F4F6;
        --text-secondary: #9CA3AF;
        --text-light: #6B7280;
        --border: #374151;
        --border-light: #1F2937;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 10px 25px -3px rgba(45, 212, 191, 0.2);
    }
}

[data-theme="dark"] {
    --bg: #0a0e17;
    --bg-secondary: #111827;
    --card: #111827;
    --text: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-light: #6B7280;
    --border: #374151;
    --border-light: #1F2937;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ========== 容器 ========== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
}

.page-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}
.page-center > .card:first-child { margin: auto 0; }
.page-center > .site-footer { margin-top: auto; width: 100%; }

/* ========== 手机横屏 + 电脑横屏 特殊适配 ========== */
@media (orientation: landscape) and (max-height: 600px) {
    .page-center { padding: 10px 20px; }
    .page-center > .card:first-child { margin: 10px auto; }
    .status-page { padding: 18px 20px; }
    .status-icon { width: 50px !important; height: 50px !important; }
    .status-title { font-size: 18px !important; margin: 12px 0 6px !important; }
    .form-group { margin-bottom: 12px; }
    .divider { margin: 14px 0 !important;}
}
@media (orientation: landscape) and (max-height: 460px) {
    .page-center { min-height: auto; padding: 8px 20px;}
    .status-icon { width: 42px !important; height: 42px !important; }
    .status-icon svg { width: 20px !important; height: 20px !important;}
    .region-tags { margin: 12px 0 !important; }
}

/* ========== 卡片 ========== */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

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

/* ========== 标题 ========== */
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 18px;
}

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

.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-select:focus {
    border-color: var(--primary);
    background-color: var(--bg);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

.form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-select option {
    background: var(--card);
    color: var(--text);
    padding: 8px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(45, 212, 191, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.4);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(45, 212, 191, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #F87171 0%, #DC2626 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

/* ========== 二维码容器 ========== */
.qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.qr-box {
    width: 220px;
    height: 220px;
    padding: 16px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    border: 2px solid var(--primary-light);
    position: relative;
}

.qr-box::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
    border-radius: calc(var(--radius-lg) + 3px);
    z-index: -1;
    opacity: 0.5;
    filter: blur(8px);
}

.qr-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.qr-hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
}

/* ========== 状态/提示组件 ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400E;
}

[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: #991B1B;
}

[data-theme="dark"] .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065F46;
}

[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* ========== 倒计时 ========== */
.countdown-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.countdown-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.12);
    flex-shrink: 0;
}

.countdown-text {
    flex: 1;
}

.countdown-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.countdown-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* ========== 图标状态页 ========== */
.status-page {
    text-align: center;
    padding: 20px 0;
}

.status-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
}

[data-theme="dark"] .icon-danger {
    background: rgba(239, 68, 68, 0.15);
}

.icon-warning {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

[data-theme="dark"] .icon-warning {
    background: rgba(245, 158, 11, 0.15);
}

.icon-success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

[data-theme="dark"] .icon-success {
    background: rgba(16, 185, 129, 0.15);
}

.status-icon svg {
    width: 56px;
    height: 56px;
}

.status-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.status-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.8;
}

.status-info {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* ========== 地区标签 ========== */
.region-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    justify-content: center;
}

.region-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.25);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-dark);
}

[data-theme="dark"] .region-tag {
    color: var(--primary-light);
}

.region-tag-arrow {
    margin: 0 4px;
    opacity: 0.5;
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-secondary) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius);
}

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

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    padding: 12px 20px;
    background: var(--text);
    color: var(--bg);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

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

.toast-error {
    background: var(--danger);
    color: #fff;
}

/* ========== 分割线 ========== */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 20px 0;
}

/* ========== 管理页特殊样式 ========== */
.admin-header {
    padding: 20px 0 28px;
    text-align: center;
}

.admin-logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.qr-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.qr-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

/* ========== 响应式 ========== */
@media (max-width: 380px) {
    .container {
        padding: 20px 16px;
    }
    .card {
        padding: 24px 18px;
    }
    .qr-box {
        width: 200px;
        height: 200px;
    }
    .page-title {
        font-size: 20px;
    }
}
