/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ========== 导航栏 ========== */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-row-top {
    display: contents;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 180px;
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-tab.active {
    color: white;
    background: rgba(255,255,255,0.2);
}

.nav-date,
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    min-width: 180px;
    justify-content: flex-end;
}

.nav-date input[type="date"],
.nav-date select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.nav-date select option {
    background: #1a1a2e;
    color: white;
}

.nav-date input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* 用户信息 & 退出 */
.nav-user-info {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-left: 12px;
    white-space: nowrap;
}

.nav-logout {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    margin-left: 8px;
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-logout:hover {
    color: white;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
}

/* ========== 容器 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== 汇总卡片 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.card-value.up {
    color: #52c41a;
}

.card-value.down {
    color: #ff4d4f;
}

.card-trend {
    font-size: 12px;
    color: #999;
}

.card-sub {
    font-size: 12px;
    color: #bbb;
}

/* ========== 图表区域 ========== */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-box.full-width {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.chart-toolbar {
    margin-bottom: 8px;
}

.btn-sm {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.btn-sm.active {
    background: #e6f7ff;
    border-color: #5B8FF9;
    color: #5B8FF9;
}

.chart {
    width: 100%;
    height: 350px;
}

/* ========== 表格 ========== */
.table-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

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

.search-input {
    padding: 8px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    width: 220px;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #5B8FF9;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #eee;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

th:hover {
    background: #f0f0f0;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

tr:hover {
    background: #f9fbff;
}

.num-col {
    text-align: right;
}

.author-name {
    font-weight: 500;
    color: #1a1a2e;
}

/* ========== 聊天页面 - Gemini 风格 ========== */
.chat-page {
    background: #ffffff;
}

.chat-page .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.chat-container {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    height: calc(100vh - 56px);
    margin-top: 56px;
    overflow: hidden;
}

/* 快捷问题 */
.quick-questions {
    padding: 20px 40px;
    background: white;
    border-bottom: none;
}

.quick-title {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 12px;
}

.quick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    padding: 8px 18px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #3c4043;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #e8f0fe;
}

/* 聊天消息区 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: #ffffff;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 100%;
    animation: fadeIn 0.3s ease;
}

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

/* 用户消息 */
.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 75%;
}

.user-message .message-content {
    background: #e8eef9;
    color: #1a1a1a;
    border-radius: 20px 20px 4px 20px;
    padding: 12px 20px;
    box-shadow: none;
}

/* 头像 */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.user-message .message-avatar {
    background: #5B8FF9;
}

/* AI 回复 - 无气泡，平铺 */
.bot-message {
    max-width: 100%;
}

.bot-message .message-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
    overflow: visible;
}

.message-content {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    max-width: 100%;
    overflow: hidden;
}

/* ===== AI 回复文字排版（核心） ===== */
.message-text {
    font-size: 15px;
    line-height: 1.8;
    color: #1f1f1f;
    word-wrap: break-word;
    letter-spacing: 0.01em;
}

.message-text p {
    margin-bottom: 12px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

/* 标题 */
.message-text h1,
.message-text h2,
.message-text h3 {
    color: #1a1a1a;
    margin-top: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.message-text h1 { font-size: 22px; font-weight: 700; }
.message-text h2 { font-size: 18px; font-weight: 700; }
.message-text h3 { font-size: 16px; font-weight: 600; }

.message-text strong {
    font-weight: 600;
    color: #111;
}

.message-text em {
    font-style: italic;
    color: #3c4043;
}

/* 列表 */
.message-text ul,
.message-text ol {
    padding-left: 24px;
    margin: 10px 0;
}

.message-text li {
    margin-bottom: 6px;
    line-height: 1.7;
    padding-left: 4px;
}

.message-text li::marker {
    color: #5f6368;
}

/* 行内代码 */
.message-text code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: #d93025;
}

/* 代码块 */
.message-text pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 12px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.6;
}

.message-text pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* 分隔线 */
.message-text hr {
    border: none;
    border-top: 1px solid #e8eaed;
    margin: 16px 0;
}

/* 聊天中的表格 - Gemini 风格 */
.data-table-wrapper {
    overflow-x: auto;
    margin: 12px 0;
    -webkit-overflow-scrolling: touch;
}

.chat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
}

.chat-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #5f6368;
    border-bottom: 2px solid #e8eaed;
    text-align: left;
}

.chat-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
    color: #3c4043;
}

.chat-table tr:hover {
    background: #f8f9fa;
}

/* SQL 详情折叠 */
.sql-details {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #5f6368;
}

.sql-details summary {
    cursor: pointer;
    color: #5f6368;
    font-weight: 500;
}

.sql-details code {
    display: block;
    margin-top: 8px;
    padding: 12px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    word-break: break-all;
    white-space: pre-wrap;
}

/* 加载动画 */
.loading-dots {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a8c7fa;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 输入区域 - Gemini 胶囊风格 */
.chat-input-area {
    padding: 16px 40px 24px;
    background: #ffffff;
    border-top: none;
}

.chat-input-box {
    display: flex;
    align-items: flex-end;
    gap: 0;
    max-width: 100%;
    background: #f0f4f9;
    border-radius: 26px;
    padding: 6px 6px 6px 20px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.chat-input-box:focus-within {
    background: #ffffff;
    border-color: #c2d7f4;
    box-shadow: 0 2px 12px rgba(66,133,244,0.1);
}

.chat-input-box textarea {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    background: transparent;
    color: #1f1f1f;
}

.chat-input-box textarea::placeholder {
    color: #80868b;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1a73e8;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #1557b0;
}

.send-btn:disabled {
    background: #c4c7c5;
    cursor: not-allowed;
}

/* ========== 上传页面 ========== */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.upload-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
    line-height: 1.6;
}

.upload-form {
    max-width: 600px;
}

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

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.required {
    color: #ff4d4f;
}

.form-group input[type="date"],
.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}

.form-group input[type="date"]:focus,
.form-group input[type="datetime-local"]:focus {
    border-color: #5B8FF9;
}

/* 文件拖拽区域 */
.file-drop-area {
    border: 2px dashed #d9d9d9;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-drop-area:hover {
    border-color: #5B8FF9;
    background: #f0f7ff;
}

.file-drop-area.drag-over {
    border-color: #5B8FF9;
    background: #e6f0ff;
}

.file-drop-icon {
    font-size: 40px;
}

.file-drop-text {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.file-drop-hint {
    font-size: 12px;
    color: #bbb;
}

.selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0f7ff;
    border: 1px solid #5B8FF9;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: #333;
}

.btn-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.btn-remove:hover {
    color: #ff4d4f;
}

/* 主按钮 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: linear-gradient(135deg, #5B8FF9 0%, #4a7de8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4a7de8 0%, #3a6dd7 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91,143,249,0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
}

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

/* 上传结果 */
.upload-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.upload-result.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.upload-result.error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* 类型标签 */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-manual {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.tag-auto {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.file-name-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remark-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
    font-size: 13px;
}

/* ========== 账号管理页面 ========== */
.authors-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.author-count {
    font-size: 14px;
    color: #999;
    margin-left: 4px;
}

.section-desc {
    font-size: 13px;
    color: #999;
    margin-left: 4px;
}

.section-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.add-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    animation: fadeIn 0.2s ease;
}

.add-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.add-form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.form-input {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    min-width: 160px;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #5B8FF9;
}

.form-input-sm {
    min-width: 120px;
}

.btn-sm-pad {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

.action-result {
    margin-bottom: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.action-result.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.action-result.error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tag-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-chip {
    padding: 4px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.tag-chip:hover {
    border-color: #5B8FF9;
    color: #5B8FF9;
}

.tag-chip.active {
    background: #e6f7ff;
    border-color: #5B8FF9;
    color: #5B8FF9;
    font-weight: 500;
}

.tag-group {
    background: #f0f5ff;
    color: #2f54eb;
    border: 1px solid #adc6ff;
    cursor: pointer;
}

.tag-group:hover {
    background: #d6e4ff;
}

.tag-empty {
    font-size: 12px;
    color: #bbb;
    cursor: pointer;
    padding: 2px 8px;
    border: 1px dashed #ddd;
    border-radius: 12px;
    transition: all 0.2s;
}

.tag-empty:hover {
    color: #5B8FF9;
    border-color: #5B8FF9;
}

.douyin-id-cell {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #555;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-danger-sm {
    padding: 3px 10px;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    background: #fff2f0;
    color: #ff4d4f;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-danger-sm:hover {
    background: #ff4d4f;
    color: white;
}

.btn-add-sm {
    padding: 3px 10px;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    background: #f6ffed;
    color: #52c41a;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-sm:hover {
    background: #52c41a;
    color: white;
}

/* ========== 昵称合并展示 ========== */
.merge-content {
    padding: 0 4px;
}

.merge-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    padding: 8px 0;
}

.merge-group-card {
    background: #f0f7ff;
    border: 1px solid #d6e4f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.8;
}

.merge-group-card .merge-label {
    color: #888;
    font-size: 12px;
}

.merge-canonical strong {
    color: #1890ff;
    font-size: 14px;
}

.merge-alias-list {
    color: #e8740e;
    font-weight: 500;
}

.merge-product-id {
    color: #999;
    font-family: monospace;
    font-size: 12px;
}

.alias-names {
    color: #e8740e;
    font-size: 12px;
    word-break: break-all;
}

/* ========== 手机端适配 ========== */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0;
    }

    .nav-row-top {
        display: flex;
        align-items: center;
        width: 100%;
        height: 48px;
        padding: 0 12px;
    }

    .nav-brand {
        font-size: 15px;
        min-width: auto;
        margin-right: auto;
    }

    .nav-tabs {
        gap: 2px;
    }

    .nav-tab {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* 导航栏第二行：日期栏 / 用户栏 */
    .nav-date,
    .nav-right {
        width: 100%;
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 6px 14px;
        background: rgba(255,255,255,0.06);
        border-top: 1px solid rgba(255,255,255,0.08);
        font-size: 13px;
        min-width: 0;
        justify-content: flex-start;
    }

    .nav-date label {
        color: rgba(255,255,255,0.5);
        font-size: 12px;
        flex-shrink: 0;
    }

    .nav-date input[type="date"] {
        flex: 0 1 auto;
        max-width: 150px;
        padding: 4px 8px;
        font-size: 13px;
        border-radius: 6px;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.08);
        color: white;
    }

    .nav-date input[type="date"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
    }

    /* 手机端隐藏用户名，只显示退出按钮 */
    .nav-username {
        display: none;
    }

    .nav-user-info {
        margin-left: auto;
    }

    .nav-logout {
        font-size: 12px;
        padding: 3px 10px;
        border: 1px solid rgba(255,255,255,0.25);
        border-radius: 4px;
        color: rgba(255,255,255,0.6);
        margin-left: 0;
    }

    .container {
        padding: 12px;
    }

    /* 卡片2列 */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .summary-card {
        padding: 14px;
    }

    .card-value {
        font-size: 22px;
    }

    .card-label {
        font-size: 12px;
    }

    /* 图表单列 */
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .chart {
        height: 280px;
    }

    /* 排行榜横向柱状图需要更高的空间 */
    #rankingChart {
        height: 420px;
    }

    .chart-box {
        padding: 14px;
    }

    /* 表格 */
    .table-box {
        padding: 12px;
    }

    .search-input {
        width: 100%;
    }

    th, td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* 上传页面 */
    .upload-section {
        padding: 16px;
    }

    .upload-form {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .file-drop-area {
        padding: 24px 16px;
    }

    .file-drop-icon {
        font-size: 30px;
    }

    .file-name-cell {
        max-width: 120px;
    }

    /* 账号管理页面 */
    .authors-section {
        padding: 14px;
    }

    .add-form-row {
        flex-direction: column;
    }

    .form-input {
        min-width: 100%;
    }

    .section-actions {
        width: 100%;
    }

    .section-actions .btn-sm {
        flex: 1;
    }

    /* 聊天页面（导航两行约78px） */
    .chat-container {
        height: calc(100vh - 78px);
        margin-top: 78px;
    }

    .chat-messages {
        padding: 16px;
        gap: 20px;
    }

    .message {
        max-width: 100%;
    }

    .user-message {
        max-width: 85%;
    }

    .message-text {
        font-size: 14px;
        line-height: 1.7;
    }

    .quick-questions {
        padding: 12px 16px;
    }

    .quick-list {
        gap: 6px;
    }

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

    .chat-input-area {
        padding: 12px 16px 20px;
    }

    .chat-input-box {
        padding: 4px 4px 4px 16px;
        border-radius: 22px;
    }

    .chat-input-box textarea {
        font-size: 14px;
    }
}

/* 超小屏幕（如iPhone SE） */
@media (max-width: 375px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .card-value {
        font-size: 18px;
    }

    .chart {
        height: 240px;
    }
}

/* iPad / 平板 */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .chart-grid {
        grid-template-columns: 1fr 1fr;
    }
}
