/* 白墨渊QQ群管理机器人 - 深色液态玻璃主题 */

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

body {
    background: #0a0a0a;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #ffffff;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-icon {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: 2px;
}

.brand-sub {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
}

/* Webkit 浏览器滚动条样式 */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: #999;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-label {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-info {
    margin-bottom: 14px;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: #ccc;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 主内容区 */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 40px;
    background: #0a0a0a;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 32px;
}

/* 液态玻璃卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 14px 28px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.25);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

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

table.data-table th,
table.data-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

table.data-table th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: #aaa;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.data-table td {
    color: #ddd;
}

table.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.form-input:focus,
.form-select:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.form-input::placeholder {
    color: #666;
}

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

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

/* 复选框样式 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-label {
    font-size: 14px;
    color: #ccc;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-tag.success {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.status-tag.error {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.status-tag.warning {
    background: rgba(255, 204, 0, 0.15);
    color: #ffcc00;
}

/* 提示信息 */
.tip {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    line-height: 1.7;
}

/* 警告和成功消息 */
.alert {
    padding: 18px 22px;
    border-radius: 14px;
    margin-bottom: 28px;
    font-size: 14px;
    font-weight: 500;
}

.alert-ok {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.alert-err {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* 登录包装器 */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* 登录卡片 */
.login-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 48px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 36px;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar-brand,
    .brand-sub,
    .nav-label,
    .user-info {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 16px;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .nav-item {
        padding: 12px;
    }
    
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .login-card {
        padding: 32px;
    }
}

/* ============================================================
   自适应文本容器机制（v22.0.0）
   字体超过长方形容器时，容器根据字数自动扩宽，始终比内容大一点，
   把整段文字完整包住（尤其功能界面 / 状态胶囊 / 标签按钮）。
   ============================================================ */
.auto-fit-text,
.status-tag,
.badge,
.btn,
.chip,
.nav-label,
.label-pill,
.card-title {
    width: fit-content;
    width: -moz-fit-content;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 默认长文本防溢出兜底：任何容器内文字超宽时自动换行而非溢出 */
.glass-card,
.panel,
.table-container,
.form-group,
.tip,
.alert,
.stat-card {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 表格单元格长文本（如授权码、指纹、URL）自动换行，避免撑破长方形表格 */
table.data-table td,
table td {
    max-width: 320px;
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* 字体超过长方形容器时，容器随文字长度自适应扩宽 */
.text-fit {
    display: inline-block;
    width: fit-content;
    width: -moz-fit-content;
    min-width: max-content;
    padding: 6px 14px;
    border-radius: 12px;
    white-space: nowrap;
}
