/**
 * 家庭照护智能工具 v3.5 - 主样式文件
 * 从 index.html 拆分
 */

/* ===== 基础样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(255,255,255,0.95);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-btn-outline {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
}

.nav-btn:hover { transform: translateY(-2px); }

/* ===== 用户信息 ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ===== 用户个人中心 ===== */
.user-center {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 头像呼吸灯效果（有未读消息时） */
.user-avatar.has-notification {
    animation: avatar-breathe 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
}

@keyframes avatar-breathe {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
    }
}

.user-center-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-center-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.user-bean-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== 用户下拉菜单 ===== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 0;
    display: none;
    z-index: 1002;
    overflow: hidden;
    max-width: calc(100vw - 20px);
}

.user-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.user-dropdown-header {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-dropdown-header .user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-dropdown-header .user-level {
    font-size: 12px;
    opacity: 0.9;
}

.user-dropdown-bean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fffbeb;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-bean .bean-amount {
    font-size: 24px;
    font-weight: 700;
    color: #f59e0b;
}

.user-dropdown-bean .bean-label {
    font-size: 12px;
    color: #666;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.user-dropdown-item:hover {
    background: #f5f5f5;
}

.user-dropdown-item .item-icon {
    width: 20px;
    text-align: center;
}

.user-dropdown-item .item-badge {
    margin-left: auto;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    animation: breathe 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.6);
}

.user-dropdown-item.danger {
    color: #e74c3c;
}

.user-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

/* ===== 健康豆提示条 ===== */
.bean-tip-bar {
    background: #fffbeb;
    padding: 8px 20px;
    text-align: center;
    font-size: 13px;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
}

.bean-tip-bar .vip-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ===== 悬浮反馈按钮 ===== */
.feedback-float-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.feedback-popup {
    position: fixed;
    bottom: 160px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 8px 0;
    display: none;
    z-index: 1000;
    min-width: 160px;
}

.feedback-popup.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.feedback-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #333;
}

.feedback-popup-item:hover {
    background: #f5f5f5;
}

/* ===== 主容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== 标签页 ===== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn.active, .tab-btn:hover {
    background: white;
    color: #667eea;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 聊天区域 ===== */
.chat-grid {
    display: flex;
    gap: 20px;
}

.chat-card {
    flex: 3;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    overflow: hidden;
}

.chat-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
}

.chat-container {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

/* ===== 消息样式 ===== */
.message {
    margin-bottom: 15px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.message.user { 
    flex-direction: row-reverse;
}

.message.assistant > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    font-style: italic;
    font-weight: bold;
}

.message.user .avatar { background: #667eea; color: white; }
.message.assistant .avatar { background: #2ecc71; color: white; }

.message-content {
    max-width: 70%;
    min-width: 100px;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    align-self: flex-start;
}

.message-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-left: 0;
}

.message.assistant .message-actions {
    align-self: flex-start;
}

.action-btn {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

.action-btn:hover { background: #5a6fd6; }

/* ===== 输入区域 ===== */
.input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-upload-btns {
    display: flex;
    gap: 8px;
}

.input-icon-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #eee;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.input-icon-btn:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.input-icon-btn:active {
    transform: scale(0.95);
}

.input-container input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.input-container input:focus { border-color: #667eea; }

.input-container button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== 图片预览 ===== */
.image-preview-container {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: none;
}

.image-preview-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #e74c3c;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* ===== 快捷问题 ===== */
.quick-questions {
    padding: 15px;
    background: #f8f9fa;
}

.quick-btn {
    display: inline-block;
    padding: 8px 14px;
    margin: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===== 统计卡片 ===== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.stat-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up { color: #2ecc71; }
.stat-trend.down { color: #e74c3c; }

/* ===== 档案管理 ===== */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.archive-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.archive-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.archive-item:last-child { border-bottom: none; }
.archive-label { color: #666; }
.archive-value { color: #333; font-weight: 500; }

.edit-btn {
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

/* ===== 报告列表 ===== */
.report-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.report-title { font-size: 16px; font-weight: bold; color: #333; }

.report-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-approved { background: #d4edda; color: #155724; }

.report-content {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
}

.report-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

/* ===== 模态框 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title { font-size: 20px; font-weight: bold; }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #eee;
    color: #333;
}

.btn-outline {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state-icon { font-size: 48px; margin-bottom: 15px; }

/* ===== 加载动画 ===== */
.typing {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: white;
    border-radius: 16px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ===== 动画 ===== */
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Toast提示 ===== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #3498db; }
.toast.warning { background: #f39c12; }

/* ===== 管理后台导航栏 ===== */
.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1001;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.admin-navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.admin-navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    padding: 4px;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-tab-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

.admin-navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-msg-center {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    font-size: 18px;
}

.admin-msg-center:hover {
    background: rgba(255,255,255,0.2);
}

.admin-msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: breathe 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
}

/* 消息提醒呼吸灯动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 16px rgba(231, 76, 60, 0.9);
    }
}

.admin-user-dropdown {
    position: relative;
}

.admin-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.admin-user-btn:hover {
    background: rgba(255,255,255,0.2);
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.admin-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 8px 0;
    display: none;
    z-index: 1002;
}

.admin-dropdown-menu.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.admin-dropdown-item:hover {
    background: #f5f5f5;
}

.admin-dropdown-item.danger {
    color: #e74c3c;
}

.admin-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

/* ===== 管理后台主容器 ===== */
.admin-main {
    display: none;
    padding-top: 80px;
    min-height: 100vh;
    background: #f0f2f5;
}

.admin-main.active {
    display: block;
}

.admin-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
}

.admin-page-header {
    margin-bottom: 24px;
}

.admin-page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.admin-page-subtitle {
    font-size: 14px;
    color: #666;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.admin-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* ===== 全人报告状态栏 ===== */
.fr-chat-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    margin-bottom: 12px;
    color: white;
}

.fr-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fr-status-badge {
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.fr-status-type {
    font-size: 14px;
    font-weight: 500;
}

.fr-status-patient {
    font-size: 13px;
    opacity: 0.9;
}

.fr-status-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fr-status-progress-bar {
    width: 100px;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.fr-status-progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.fr-status-progress-text {
    font-size: 12px;
    opacity: 0.9;
}

.fr-status-actions {
    display: flex;
    gap: 8px;
}

.fr-status-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.fr-status-btn-exit {
    background: rgba(255,255,255,0.2);
    color: white;
}

.fr-status-btn-exit:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    * {
        max-width: 100vw;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .container {
        padding: 10px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .navbar {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .navbar-brand {
        font-size: 16px;
    }
    
    .navbar-nav {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .chat-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .pyramid-card {
        display: none !important;
    }
    
    .chat-main {
        width: 100% !important;
        max-width: 100% !important;
        order: 1;
        margin: 0 !important;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .chat-container {
        padding: 10px;
        height: calc(100vh - 280px);
        min-height: 300px;
        max-height: none;
    }
    
    .chat-header {
        padding: 10px;
    }
    
    .chat-header > div {
        flex-direction: row !important;
        gap: 8px !important;
        align-items: center !important;
        flex-wrap: wrap;
    }
    
    .chat-header select {
        flex: 1;
        min-width: 120px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .chat-header label {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .quick-questions {
        padding: 8px 15px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .quick-questions::-webkit-scrollbar {
        display: none;
    }
    
    .quick-btn {
        padding: 6px 12px;
        margin: 0 4px;
        white-space: nowrap;
    }
    
    .input-container {
        flex-direction: row !important;
        padding: 8px;
        gap: 6px;
        align-items: center;
    }
    
    .input-upload-btns {
        display: flex;
        flex-shrink: 0;
    }
    
    .input-upload-btns button:last-child {
        display: none;
    }
    
    .input-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
        flex-shrink: 0;
    }
    
    #userInput {
        font-size: 14px;
        min-height: auto;
        height: 36px;
        flex: 1;
        padding: 8px 12px;
    }
    
    #sendBtn {
        padding: 8px 16px;
        height: 36px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .input-options {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .message {
        font-size: 14px;
    }
    
    .message.user {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* 手机端下拉菜单：改为左对齐展开，防止超出屏幕 */
    .user-dropdown {
        right: auto;
        left: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    
    .admin-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .admin-navbar {
        justify-content: space-between;
        padding: 0 16px;
        height: 56px;
    }
    
    .admin-navbar-brand {
        font-size: 16px;
    }
    
    .admin-main {
        padding-top: 72px;
    }
    
    .admin-content {
        padding: 16px;
    }
    
    /* ===== 数据概览移动端适配 ===== */
    .overview-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .overview-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .overview-grid-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .overview-grid-5 > div:last-child {
        grid-column: span 2;
    }
    
    .overview-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .overview-grid-3 > div:last-child {
        grid-column: span 2;
    }
    
    .overview-card {
        padding: 12px !important;
    }
    
    .overview-card-value {
        font-size: 24px !important;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 14px;
    }
    
    .nav-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .container {
        padding: 8px;
    }
    
    .chat-container {
        height: calc(100vh - 260px);
        min-height: 250px;
    }
    
    .message {
        font-size: 13px;
    }
    
    .input-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    #userInput {
        height: 32px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    #sendBtn {
        padding: 6px 12px;
        height: 32px;
        font-size: 12px;
    }
}

/* ===== v3.5 系统开关样式 ===== */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.switch-toggle.small {
    width: 40px;
    height: 22px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-toggle.small .switch-slider::before {
    height: 16px;
    width: 16px;
}

.switch-toggle input:checked + .switch-slider {
    background-color: #27ae60;
}

.switch-toggle input:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-toggle.small input:checked + .switch-slider::before {
    transform: translateX(18px);
}

.switch-toggle input:focus + .switch-slider {
    box-shadow: 0 0 1px #27ae60;
}
