/*
 * ============================================================
 * tablet.css  —  平板电脑端专属样式
 * 使用 html[data-device="tablet"] 高特异性前缀，
 * 可以在不依赖 !important 的情况下稳定覆盖 common.css。
 * data-device="tablet" 由 index.html 内联JS在渲染前同步设置。
 *
 * 平板特点：
 * - 屏幕尺寸介于手机(≤768px)和桌面(>1024px)之间
 * - 保留侧边栏但缩窄以节省空间
 * - 使用2-3列网格布局
 * - 中等字体大小和间距
 * - 支持横竖屏切换
 * ============================================================
 */

/* ============================================================
   SECTION 0 — 全局基础
   ============================================================ */
html[data-device="tablet"] {
    -webkit-text-size-adjust: 100%;
}

html[data-device="tablet"] body {
    overflow-x: hidden;
    width: 100%;
}

/* 触摸优化 */
html[data-device="tablet"] input,
html[data-device="tablet"] select,
html[data-device="tablet"] textarea,
html[data-device="tablet"] button {
    touch-action: manipulation;
}

/* 防止iOS输入框字号<16px时自动缩放视口 */
html[data-device="tablet"] input[type="text"],
html[data-device="tablet"] input[type="email"],
html[data-device="tablet"] input[type="password"],
html[data-device="tablet"] input[type="number"],
html[data-device="tablet"] input[type="tel"],
html[data-device="tablet"] input[type="search"],
html[data-device="tablet"] textarea,
html[data-device="tablet"] select {
    font-size: 16px;
}

/* ============================================================
   SECTION 1 — 加载动画
   ============================================================ */
html[data-device="tablet"] #global-loading h2 {
    font-size: 20px;
}
html[data-device="tablet"] #loading-progress {
    width: 320px;
}

/* ============================================================
   SECTION 2 — 登录页
   ============================================================ */
html[data-device="tablet"] #login-page {
    align-items: center;
    justify-content: center;
    padding: 30px 24px env(safe-area-inset-bottom, 24px);
    box-sizing: border-box;
}

html[data-device="tablet"] .login-container {
    width: 100%;
    max-width: 680px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
}

/* 平板端保留左侧介绍区但缩窄 */
html[data-device="tablet"] .login-left {
    padding: 32px 24px;
    min-width: 280px;
}

html[data-device="tablet"] .login-right {
    padding: 32px 28px 24px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

html[data-device="tablet"] .login-right h2    { font-size: 24px; margin-bottom: 6px; }
html[data-device="tablet"] .login-right > p   { font-size: 14px; margin-bottom: 18px; }

html[data-device="tablet"] .login-tabs        { margin-bottom: 18px; }
html[data-device="tablet"] .login-tab         { padding: 11px 18px; font-size: 15px; }

html[data-device="tablet"] .form-group        { margin-bottom: 14px; gap: 8px; }
html[data-device="tablet"] .login-actions     { margin-bottom: 16px; }
html[data-device="tablet"] .btn-login         { min-height: 50px; font-size: 16px; }
html[data-device="tablet"] .wechat-login-btn  { min-height: 50px; }
html[data-device="tablet"] .divider           { margin: 16px 0; }
html[data-device="tablet"] .register-link     { margin-top: 14px; font-size: 14px; }

/* 注册模态框 */
html[data-device="tablet"] .register-modal-overlay {
    padding: 20px;
    align-items: center;
}
html[data-device="tablet"] .register-modal {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 18px;
    overflow-y: auto;
}
html[data-device="tablet"] .register-modal-header  { padding: 24px 24px 16px; }
html[data-device="tablet"] .register-modal-header h2 { font-size: 20px; }
html[data-device="tablet"] .register-modal-body    { padding: 18px 24px 36px; }

/* 成功/确认弹窗 */
html[data-device="tablet"] .success-modal-dialog {
    min-width: 420px;
    width: auto;
    max-width: 90%;
    padding: 32px 24px;
}

/* ============================================================
   SECTION 3 — 主应用骨架（保留侧边栏但缩窄）
   ============================================================ */

html[data-device="tablet"] #main-app {
    display: flex;
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ======== 侧边栏缩窄版 ======== */
html[data-device="tablet"] .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 180px;
    min-width: 180px;
    height: 100%;
    flex-direction: column;
    border-right: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    z-index: 800;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

/* 折叠状态 */
html[data-device="tablet"] .sidebar.collapsed {
    width: 70px;
    min-width: 70px;
}

/* Logo区域 */
html[data-device="tablet"] .sidebar .logo {
    padding: 16px 12px;
    font-size: 16px;
}

html[data-device="tablet"] .sidebar.collapsed .logo span {
    display: none;
}

/* 导航菜单 */
html[data-device="tablet"] .nav-menu {
    display: flex;
    flex-direction: column;
    padding: 8px 8px;
    gap: 4px;
}

html[data-device="tablet"] .nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    gap: 10px;
    min-height: 42px;
}

html[data-device="tablet"] .nav-item .nav-icon {
    width: 20px;
    height: 20px;
    font-size: 18px;
    margin: 0;
    flex-shrink: 0;
}

html[data-device="tablet"] .nav-item span:not(.nav-icon) {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 折叠状态隐藏文字 */
html[data-device="tablet"] .sidebar.collapsed .nav-item span:not(.nav-icon) {
    display: none;
}

html[data-device="tablet"] .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

/* 用户信息区域 */
html[data-device="tablet"] .sidebar .user-info {
    padding: 12px 12px;
    font-size: 13px;
}

html[data-device="tablet"] .sidebar.collapsed .user-info .user-name,
html[data-device="tablet"] .sidebar.collapsed .user-info .user-email {
    display: none;
}

/* 侧边栏切换按钮 - 未折叠时在侧边栏内右侧，折叠后在外左侧 */
html[data-device="tablet"] .sidebar-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    font-size: 18px !important;
    position: absolute !important;
    left:  auto !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1001 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
}

html[data-device="tablet"] .sidebar.collapsed .sidebar-toggle {
    left: 0 !important;
    right: auto !important;
}

/* ======== 主内容区 ======== */
html[data-device="tablet"] .main-content {
    flex: 1;
    margin-left: 180px;
    width: calc(100% - 180px);
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    min-height: 0;

    /* 平板缩放比例设为 0.92，比手机(0.85)更接近桌面 */
    zoom: 0.92;
}

html[data-device="tablet"] .sidebar.collapsed ~ .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* ============================================================
   SECTION 4 — 仪表盘 Dashboard
   ============================================================ */
html[data-device="tablet"] .dashboard-container {
    padding: 16px;
}

html[data-device="tablet"] .dashboard-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

html[data-device="tablet"] .dashboard-header .header-left {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

html[data-device="tablet"] .dashboard-header h1 {
    font-size: 24px;
    margin: 0;
}

html[data-device="tablet"] .date-info {
    display: block;
    font-size: 14px;
}

html[data-device="tablet"] .time-range-selector {
    display: flex;
    gap: 6px;
}

html[data-device="tablet"] .time-range-btn {
    padding: 9px 16px;
    font-size: 14px;
}

/* 统计卡片：3列网格 */
html[data-device="tablet"] .stats-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .stat-card {
    padding: 14px;
    gap: 10px;
    border-radius: 10px;
}

html[data-device="tablet"] .stat-icon  { font-size: 32px; }
html[data-device="tablet"] .stat-value { font-size: 24px; margin-bottom: 4px; }
html[data-device="tablet"] .stat-label { font-size: 13px; }

/* 主内容：2列布局 */
html[data-device="tablet"] .dashboard-main {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .dashboard-section {
    padding: 16px;
    border-radius: 12px;
}

html[data-device="tablet"] .section-header h2  { font-size: 17px; }
html[data-device="tablet"] .today-tasks-list   { max-height: 300px; }
html[data-device="tablet"] .task-item          { padding: 12px; gap: 10px; }
html[data-device="tablet"] .task-title         { font-size: 15px; margin-bottom: 5px; }
html[data-device="tablet"] .task-meta          { font-size: 13px; gap: 10px; }

/* 图表：2列 */
html[data-device="tablet"] .dashboard-stats-charts {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .dashboard-stats-charts .chart-card    { padding: 14px; border-radius: 10px; }
html[data-device="tablet"] .dashboard-stats-charts .chart-card h3 { font-size: 15px; margin-bottom: 10px; }
html[data-device="tablet"] .dashboard-stats-charts .chart-wrapper  { height: 220px; }

/* 快速操作：保持4列 */
html[data-device="tablet"] .quick-actions { padding: 16px; border-radius: 12px; }
html[data-device="tablet"] .quick-actions h3 { font-size: 17px; margin-bottom: 12px; }
html[data-device="tablet"] .quick-action-buttons {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
html[data-device="tablet"] .quick-btn { padding: 12px 6px; gap: 6px; }
html[data-device="tablet"] .quick-btn span:first-child { font-size: 26px; }
html[data-device="tablet"] .quick-btn span:last-child  { font-size: 12px; }
html[data-device="tablet"] .quick-btn img.quick-btn-icon { width: 30px; height: 30px; }

/* ============================================================
   SECTION 5 — 计划管理 Tasks
   ============================================================ */
html[data-device="tablet"] .tasks-container {
    padding: 14px;
}

html[data-device="tablet"] .tasks-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .tasks-header h1 { font-size: 22px; }

html[data-device="tablet"] .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

html[data-device="tablet"] .header-actions .btn-primary,
html[data-device="tablet"] .btn-add-task {
    padding: 8px 16px;
    font-size: 14px;
    height: 38px;
    border-radius: 18px;
}

/* 平板端工具栏：多行布局 */
html[data-device="tablet"] .tasks-toolbar,
html[data-device="tablet"] .task-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 0;
    align-items: center;
}

/* 第一行：筛选按钮（左侧）+ 视图切换（右侧） */
html[data-device="tablet"] .filter-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    grid-column: 1;
    grid-row: 1;
}

html[data-device="tablet"] .view-switcher {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    gap: 6px;
}

/* 第二行：排序、搜索、时间控制器（占满整行） */
html[data-device="tablet"] .toolbar-right {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* 搜索框和排序的显示由 JavaScript 根据视图类型控制 */
html[data-device="tablet"] .sort-dropdown {
    font-size: 14px;
}

html[data-device="tablet"] .search-box {
    font-size: 14px;
}

html[data-device="tablet"] .search-box input {
    min-width: 180px;
}

/* 时间选择器 */
html[data-device="tablet"] .gantt-time-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

html[data-device="tablet"] .gantt-control-label {
    font-size: 13px;
    white-space: nowrap;
}

html[data-device="tablet"] .gantt-time-range,
html[data-device="tablet"] .gantt-time-unit {
    font-size: 13px;
    height: 32px;
    padding: 4px 24px 4px 8px;
}

html[data-device="tablet"] .view-switch-btn {
    padding: 6px 12px;
    font-size: 14px;
    min-height: 34px;
    height: 34px;
}

html[data-device="tablet"] .filter-btn {
    padding: 6px 14px;
    font-size: 13px;
    min-height: 34px;
    height: 34px;
    white-space: nowrap;
}

/* 四象限：2列布局 */
html[data-device="tablet"] .quadrant-container,
html[data-device="tablet"] .tasks-quadrant,
html[data-device="tablet"] .quadrant-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* 任务卡片 */
html[data-device="tablet"] .task-card,
html[data-device="tablet"] .tasks-card {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
}

html[data-device="tablet"] .task-card-header,
html[data-device="tablet"] .tasks-card-header {
    margin-bottom: 6px;
    padding-bottom: 6px;
}

html[data-device="tablet"] .task-title { font-size: 15px; margin-bottom: 4px; line-height: 1.4; }
html[data-device="tablet"] .task-desc,
html[data-device="tablet"] .task-meta { font-size: 12px; }
html[data-device="tablet"] .task-status-badge { padding: 3px 6px; font-size: 11px; }

/* 甘特图适配 */
html[data-device="tablet"] .tasks-gantt,
html[data-device="tablet"] .gantt-container {
    width: 100%;
    margin-top: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

html[data-device="tablet"] .gantt-left-header,
html[data-device="tablet"] .gantt-body-left {
    width: 320px;
    flex: 0 0 320px;
}

html[data-device="tablet"] .gantt-header-main,
html[data-device="tablet"] .gantt-cell-main-area {
    width: 220px;
}

html[data-device="tablet"] .gantt-header-main {
    border-bottom: 1px solid var(--border-color, #e5e7eb) !important;
}

html[data-device="tablet"] .gantt-header-completion,
html[data-device="tablet"] .gantt-cell-completion-area {
    width: 90px;
}

html[data-device="tablet"] .gantt-header-completion {
    border-bottom: 1px solid var(--border-color, #e5e7eb) !important;
}

html[data-device="tablet"] .gantt-header-diagonal {
    width: 220px;
    border-bottom: 1px solid var(--border-color, #e5e7eb) !important;
}

html[data-device="tablet"] .gantt-header-diagonal::before {
    margin-left: 220px;
}

html[data-device="tablet"] .task-name-text {
    font-size: 13px;
    display: flex;
    align-items: center;
}

html[data-device="tablet"] .gantt-cell-completion-area span {
    font-size: 12px;
}

html[data-device="tablet"] .diagonal-text-top,
html[data-device="tablet"] .diagonal-text-bottom {
    font-size: 12px;
}

html[data-device="tablet"] .gantt-left-cell {
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

html[data-device="tablet"] .gantt-bar-progress {
    height: 6px;
}

html[data-device="tablet"] .gantt-timeline-row {
    min-height: 36px;
}

html[data-device="tablet"] .gantt-tree-toggle {
    width: 18px;
    height: 18px;
    font-size: 12px;
    margin-right: 6px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 弹出抽屉/模态框 */
html[data-device="tablet"] .task-drawer {
    width: 90%;
    max-width: 600px;
}

html[data-device="tablet"] .share-modal-dialog {
    width: 85%;
    max-width: 520px;
    border-radius: 14px;
}

html[data-device="tablet"] .task-modal-dialog,
html[data-device="tablet"] .task-modal-container {
    width: 90vw;
    height: 90vh;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 14px;
    margin: auto;
}

/* ============================================================
   SECTION 6 — AI 助手
   ============================================================ */
html[data-device="tablet"] .ai-page {
    flex-direction: row;
    height: 100%;
    gap: 0;
}

html[data-device="tablet"] .ai-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* 保留历史记录侧栏但缩窄 */
html[data-device="tablet"] .ai-sidebar,
html[data-device="tablet"] .ai-history-sidebar,
html[data-device="tablet"] .chat-history-sidebar {
    display: flex;
    width: 220px;
    min-width: 220px;
    border-right: 1px solid var(--border-color, #e5e7eb);
}

html[data-device="tablet"] .chat-card {
    border-radius: 12px;
    flex: 1;
}

html[data-device="tablet"] .ai-header {
    padding: 12px 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 8px;
}

html[data-device="tablet"] .ai-header-title h1 { font-size: 20px; }
html[data-device="tablet"] .ai-header-title p   { font-size: 13px; }
html[data-device="tablet"] .ai-header-actions   { flex-wrap: wrap; gap: 6px; }
html[data-device="tablet"] .ai-header-btn       { padding: 6px 12px; font-size: 13px; }

html[data-device="tablet"] .chat-messages,
html[data-device="tablet"] .messages-container  { padding: 16px; font-size: 14px; }

html[data-device="tablet"] .message-bubble,
html[data-device="tablet"] .chat-message-content {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
    line-height: 1.5;
}

html[data-device="tablet"] .chat-input-area,
html[data-device="tablet"] .ai-input-container,
html[data-device="tablet"] .input-area {
    padding: 12px 16px;
    min-height: auto;
}

html[data-device="tablet"] .chat-input-area textarea,
html[data-device="tablet"] .ai-input-container textarea,
html[data-device="tablet"] .input-area textarea {
    font-size: 15px;
    min-height: 42px;
    padding: 8px 12px;
}

html[data-device="tablet"] .btn-send {
    padding: 8px 14px;
    font-size: 14px;
    min-height: 42px;
}

/* ============================================================
   SECTION 7 — 番茄钟 Pomodoro
   ============================================================ */
html[data-device="tablet"] .pomodoro-container,
html[data-device="tablet"] .pomodoro-view {
    padding: 16px;
}

html[data-device="tablet"] .pomodoro-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .pomodoro-header h1 { font-size: 22px; }

/* 番茄钟适度缩放 */
html[data-device="tablet"] .pomodoro-timer {
    scale: 0.9;
    transform-origin: top center;
    margin-bottom: 10px;
}

/* ============================================================
   SECTION 8 — 工作组 Workgroup
   ============================================================ */
html[data-device="tablet"] .workgroup-container,
html[data-device="tablet"] .workgroup-layout {
    flex-direction: row;
    padding: 16px;
    gap: 16px;
}

html[data-device="tablet"] .workgroup-sidebar {
    width: 280px;
    min-width: 280px;
    height: 100%;
    border-right: 1px solid var(--border-color, #e5e7eb);
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    flex-shrink: 0;
}

html[data-device="tablet"] .workgroup-friend-item,
html[data-device="tablet"] .friend-request-item {
    padding: 10px;
    gap: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
}

html[data-device="tablet"] .workgroup-friend-avatar,
html[data-device="tablet"] .friend-request-avatar {
    width: 42px;
    height: 42px;
}

html[data-device="tablet"] .workgroup-friend-name { font-size: 15px; }
html[data-device="tablet"] .workgroup-friend-details { font-size: 13px; }

html[data-device="tablet"] .workgroup-main-content {
    flex: 1;
    padding: 12px;
}

/* ============================================================
   SECTION 9 — 个人设置 & 系统设置
   ============================================================ */
html[data-device="tablet"] .personal-settings-container,
html[data-device="tablet"] .settings-view,
html[data-device="tablet"] .system-settings-container {
    padding: 16px;
}

html[data-device="tablet"] .settings-header,
html[data-device="tablet"] .personal-settings-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .settings-header h1,
html[data-device="tablet"] .personal-settings-header h1 {
    font-size: 22px;
}

html[data-device="tablet"] .settings-layout,
html[data-device="tablet"] .personal-settings-layout {
    flex-direction: row;
    gap: 16px;
}

/* 设置侧边导航保持垂直 */
html[data-device="tablet"] .settings-nav {
    display: flex;
    flex-direction: column;
    width: 200px;
    min-width: 200px;
    border-right: 1px solid var(--border-color, #e5e7eb);
    padding: 12px 8px;
    gap: 4px;
}

html[data-device="tablet"] .settings-nav-item {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 8px;
    white-space: nowrap;
}

html[data-device="tablet"] .settings-content,
html[data-device="tablet"] .settings-panel {
    flex: 1;
    padding: 12px;
}

html[data-device="tablet"] .setting-item {
    padding: 14px 0;
}
html[data-device="tablet"] .setting-label { font-size: 15px; margin-bottom: 6px; }
html[data-device="tablet"] .setting-desc { font-size: 13px; }

/* ============================================================
   SECTION 10 — 回收站 & 其他页面
   ============================================================ */
html[data-device="tablet"] .trash-container {
    padding: 16px;
}

html[data-device="tablet"] .trash-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

html[data-device="tablet"] .trash-header h1 {
    font-size: 22px;
}

html[data-device="tablet"] .trash-header h1 .emoji-icon {
    font-size: 22px;
    margin-right: 8px;
}

html[data-device="tablet"] .trash-header h1 .gradient-text {
    font-size: 22px;
}

html[data-device="tablet"] .trash-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

html[data-device="tablet"] .trash-info #trash-count {
    font-size: 14px;
}

html[data-device="tablet"] #clear-all-btn,
html[data-device="tablet"] #clear-all-btn.btn-danger.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 38px;
    white-space: nowrap;
}

html[data-device="tablet"] .trash-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
}

html[data-device="tablet"] .trash-item-title { font-size: 15px; }
html[data-device="tablet"] .trash-item-meta { font-size: 13px; }

html[data-device="tablet"] .trash-tips {
    margin-top: 16px;
}

/* ============================================================
   SECTION 11 — 悬浮按钮位置
   ============================================================ */
/* 平板保留悬浮按钮,位置稍微调整 */
html[data-device="tablet"] .reminder-widget {
    bottom: 24px;
    right: 24px;
    transform: scale(1);
}

html[data-device="tablet"] .workgroup-friend-button {
    bottom: 90px;
    right: 24px;
    transform: scale(1);
}

html[data-device="tablet"] .ai-shortcut-button {
    bottom: 156px;
    right: 24px;
    transform: scale(1);
}

/* ============================================================
   SECTION 12 — 通用 Card & 弹窗
   ============================================================ */
html[data-device="tablet"] .card {
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 14px;
}

html[data-device="tablet"] .custom-confirm-dialog {
    min-width: 420px;
    width: auto;
    max-width: 520px;
    padding: 28px;
}

html[data-device="tablet"] .empty-state  { padding: 60px 20px; }
html[data-device="tablet"] .empty-icon   { font-size: 64px; }
html[data-device="tablet"] .empty-state p { font-size: 15px; }

/* 表格水平滚动 */
html[data-device="tablet"] .admin-table-container,
html[data-device="tablet"] .task-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   SECTION 13 — 竖屏平板（iPad竖屏等）
   ============================================================ */
@media screen and (max-width: 900px) and (orientation: portrait) {
    /* 竖屏时侧边栏可选择自动折叠 */
    html[data-device="tablet"] .sidebar {
        width: 70px;
        min-width: 70px;
    }

    html[data-device="tablet"] .sidebar .logo span,
    html[data-device="tablet"] .sidebar .nav-item span:not(.nav-icon),
    html[data-device="tablet"] .sidebar .user-info .user-name,
    html[data-device="tablet"] .sidebar .user-info .user-email {
        display: none;
    }

    html[data-device="tablet"] .sidebar .nav-item {
        justify-content: center;
        padding: 10px;
    }

    html[data-device="tablet"] .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
    }

    /* 统计卡片改为2列 */
    html[data-device="tablet"] .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 主面板改为单列 */
    html[data-device="tablet"] .dashboard-main {
        grid-template-columns: 1fr;
    }

    /* 图表改为单列 */
    html[data-device="tablet"] .dashboard-stats-charts {
        grid-template-columns: 1fr;
    }

    /* 四象限改为单列 */
    html[data-device="tablet"] .quadrant-container,
    html[data-device="tablet"] .tasks-quadrant,
    html[data-device="tablet"] .quadrant-grid {
        grid-template-columns: 1fr;
    }

    /* AI侧边栏隐藏 */
    html[data-device="tablet"] .ai-sidebar,
    html[data-device="tablet"] .ai-history-sidebar,
    html[data-device="tablet"] .chat-history-sidebar {
        display: none;
    }
}

/* ============================================================
   工作组好友弹窗适配
   ============================================================ */
html[data-device="tablet"] .workgroup-friend-overlay > div,
html[data-device="tablet"] #workgroup-friend-modal > div:first-child {
    zoom: 0.85;
    transform-origin: center center;
    max-width: 90vw;
    width: 600px;
}

html[data-device="tablet"] .workgroup-friend-overlay {
    align-items: center;
    padding: 20px;
}

html[data-device="tablet"] .workgroup-friend-title {
    font-size: 18px;
    padding: 14px 18px;
}

html[data-device="tablet"] .workgroup-friend-tabs {
    gap: 6px;
    padding: 0 14px;
}

html[data-device="tablet"] .workgroup-friend-tab {
    padding: 8px 16px;
    font-size: 14px;
}

html[data-device="tablet"] .workgroup-friend-list-item {
    padding: 10px 16px;
    gap: 12px;
}

html[data-device="tablet"] .workgroup-friend-avatar-img {
    width: 44px;
    height: 44px;
}

html[data-device="tablet"] .workgroup-friend-name {
    font-size: 15px;
}

html[data-device="tablet"] .workgroup-friend-info {
    font-size: 13px;
}
