/* 时间管理网站 - 公共样式 - 现代化设计 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #90EE90;
    --background-color: #F4F6F9;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.12);
    --accent-purple: #E0BBE4;
    --accent-blue: #95D5E1;
    --accent-green: #BEE7B8;
    --tm-datetime-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563eb'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 16H5V10h14v10ZM7 11h2v2H7v-2Zm4 0h2v2h-2v-2Zm4 0h2v2h-2v-2ZM7 15h2v2H7v-2Zm4 0h2v2h-2v-2Z'/%3E%3C/svg%3E");
    --tm-datetime-bg: var(--card-background);
    /* 窄屏底部辅助栏 Tab 高度（含安全区），供主内容与悬浮控件避让 */
    --tm-mobile-bar-height: 56px;
    --tm-mobile-bar-offset: calc(var(--tm-mobile-bar-height) + env(safe-area-inset-bottom, 0px));
    /* 滚动条：随主题变量切换（classic / rpg / dark） */
    --tm-scrollbar-size: 6px;
    --tm-scrollbar-thumb: rgba(102, 126, 234, 0.4);
    --tm-scrollbar-thumb-hover: rgba(102, 126, 234, 0.62);
    --tm-scrollbar-track: rgba(0, 0, 0, 0.04);
}

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

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: var(--background-color);
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Serif SC', 'Source Han Serif SC', serif, 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background: var(--background-color);
    line-height: 1.4;
}

/* 全站使用思源宋体，但图标保持 Font Awesome 不变 */
i[class*="fa-"],
.fa, .fas, .far, .fab, .fal, .fad {
    font-family: "Font Awesome 6 Free" !important;
}

/* 悬浮 AI 助手入口 - 右侧固定，每页可见 */
.float-ai-assistant {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}
.float-ai-assistant .tm-ai-elf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
}
.float-ai-assistant .tm-ai-elf-icon .tm-ai-elf-img {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    box-sizing: border-box;
    background: transparent;
    border: none;
}
.float-ai-assistant:hover {
    color: white;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* 悬浮 AI 助手对话框 */
.ai-assistant-float {
    position: fixed;
    right: 80px;
    bottom: 20px;
    width: 380px;
    height: 500px;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
}

.ai-assistant-float.minimized {
    width: 200px;
    height: 50px;
    bottom: 20px;
    cursor: pointer;
}

.ai-assistant-float.minimized .ai-assistant-header {
    cursor: pointer;
}

.ai-assistant-float.minimized:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.ai-assistant-float.maximized {
    width: 85vw;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    right: 50%;
    transform: translateX(50%);
    bottom: 20px;
}

.ai-assistant-float.maximized .ai-assistant-header {
    cursor: default;
}

.ai-assistant-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    flex-shrink: 0;
}

.ai-assistant-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.ai-assistant-title .tm-ai-elf-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.ai-assistant-title .tm-ai-elf-icon .tm-ai-elf-img {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    box-sizing: border-box;
    background: transparent;
    border: none;
}

.ai-assistant-controls {
    display: flex;
    gap: 6px;
}

.ai-control-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ai-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-assistant-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    overflow: hidden;
}

.ai-assistant-body .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    margin-bottom: 0;
}

.ai-assistant-body .message {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ai-assistant-body .message.user {
    flex-direction: row-reverse;
}

.ai-assistant-body .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.ai-assistant-body .message-avatar.has-img {
    padding: 0;
    background: transparent;
}

.ai-assistant-body .message-avatar.has-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.ai-assistant-body .message.user .message-avatar:not(.has-img) {
    background: var(--primary-color);
    color: white;
}

.ai-assistant-body .message.assistant .message-avatar:not(.has-img) {
    background: var(--secondary-color);
    color: white;
}

.ai-assistant-body .message-content-wrap {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    min-width: 0;
}

.ai-assistant-body .message.user .message-content-wrap {
    align-items: flex-end;
}

.ai-assistant-body .message.assistant .message-content-wrap {
    align-items: flex-start;
}

.ai-assistant-body .message-time {
    font-size: 10px;
    color: var(--text-light);
    margin-bottom: 3px;
}

.ai-assistant-body .message-content {
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.55;
    background: var(--background-color);
    word-wrap: break-word;
}
.ai-assistant-body .message-content.tm-ai-msg-rich .tm-ai-msg-p {
    margin: 0 0 0.55em;
}
.ai-assistant-body .message-content.tm-ai-msg-rich .tm-ai-msg-p:last-child {
    margin-bottom: 0;
}
.ai-assistant-body .message-content.tm-ai-msg-rich .tm-ai-msg-heading {
    font-weight: 700;
    margin: 0.55em 0 0.3em;
    font-size: 13px;
}
.ai-assistant-body .message-content.tm-ai-msg-rich .tm-ai-msg-heading:first-child {
    margin-top: 0;
}
.ai-assistant-body .message-content.tm-ai-msg-rich .tm-ai-msg-list {
    margin: 0.2em 0 0.55em;
    padding-left: 1.2em;
}
.ai-assistant-body .message-content.tm-ai-msg-rich .tm-ai-msg-list li {
    margin: 0.2em 0;
}

.ai-assistant-body .message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.ai-assistant-body .message-ai-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-light);
}

.ai-assistant-body .message-float-retry {
    margin-top: 8px;
}

.ai-assistant-body .chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.ai-assistant-body .chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    background: var(--card-background);
}

.ai-assistant-body .chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.ai-assistant-body .voice-btn {
    padding: 8px 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.ai-assistant-body .voice-btn:hover {
    background: #ff5252;
}

.ai-assistant-body .voice-btn.recording {
    background: #c0392b;
    animation: pulse 1s infinite;
}

.ai-assistant-body .voice-btn.recognizing {
    background: #e67e22;
    animation: pulse 1s infinite;
}

.ai-assistant-body .stop-broadcast-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #f5576c, #f093fb);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-body .stop-broadcast-btn:hover {
    background: linear-gradient(135deg, #e04658, #e07de8);
    transform: scale(1.05);
}

.ai-assistant-body .stop-broadcast-btn i {
    animation: pulse-stop 1.5s infinite;
}

@keyframes pulse-stop {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 响应式 - 手机/平板：默认大半屏，放大为真全屏（含安全区） */
@media (max-width: 768px) {
    .ai-assistant-float {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: min(72vh, calc(100dvh - env(safe-area-inset-top, 0px) - 72px));
        max-height: none;
        transform: none;
        border-radius: 16px 16px 0 0;
    }

    .ai-assistant-float.minimized {
        left: auto;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        width: min(220px, calc(100vw - 20px));
        height: 50px;
        border-radius: 12px;
    }

    .ai-assistant-float.maximized {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-width: none;
        max-height: none;
        transform: none;
        border-radius: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }

    .ai-assistant-controls {
        gap: 8px;
    }

    .ai-control-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 14px;
    }

    .float-ai-assistant {
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        top: auto;
        transform: none;
    }
}

body.tm-ai-float-fullscreen {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* 主容器 - 白色卡片样式，紧凑一屏 */
.main-wrapper {
    background: var(--shell-background, var(--card-background));
    border-radius: 16px;
    height: calc(100vh - 16px);
    min-height: 500px;
    margin: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    overflow: hidden;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* 主内容区 - 确保可点击 */
.main-content {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* 左侧导航栏 - 紧凑；中间菜单区可滚动，避免项多时挤出底部用户区 */
.sidebar {
    width: 220px;
    background: var(--card-background);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    flex-shrink: 0;
    pointer-events: auto;
    z-index: 2;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    flex-shrink: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(46, 134, 171, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.tm-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #667eea 0%, #2e86ab 55%, #43e97b 120%);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.28);
}

.tm-brand-mark i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.sidebar-logo i {
    color: var(--primary-color);
    font-size: 28px;
}

.sidebar-logo .tm-camp-logo-img,
.mobile-logo .tm-camp-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-nav {
    flex: 1;
    list-style: none;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* classic 主题 / 自定义主色：滚动条跟随 primary */
html[data-tm-ui="classic"] {
    color-scheme: light;
    --tm-scrollbar-thumb: rgba(102, 126, 234, 0.4);
    --tm-scrollbar-thumb-hover: rgba(102, 126, 234, 0.62);
    --tm-scrollbar-track: rgba(0, 0, 0, 0.05);
}

html[data-tm-custom-colors="1"] {
    --tm-scrollbar-thumb: color-mix(in srgb, var(--primary-color) 42%, transparent);
    --tm-scrollbar-thumb-hover: color-mix(in srgb, var(--primary-color) 65%, transparent);
    --tm-scrollbar-track: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

/* 全站滚动条：6px 细条，颜色跟主题变量走（勿用 *::-webkit，Chromium 不可靠） */
html {
    color-scheme: light;
    scrollbar-width: thin;
    scrollbar-color: var(--tm-scrollbar-thumb) var(--tm-scrollbar-track);
}

html,
body,
.main-content,
.sidebar-nav,
.tm-rs-body,
.tm-rs-chat-messages,
.ai-assistant-body .chat-messages,
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--tm-scrollbar-thumb) var(--tm-scrollbar-track);
}

::-webkit-scrollbar {
    width: var(--tm-scrollbar-size) !important;
    height: var(--tm-scrollbar-size) !important;
}

::-webkit-scrollbar-track {
    background: var(--tm-scrollbar-track) !important;
}

::-webkit-scrollbar-thumb {
    background: var(--tm-scrollbar-thumb) !important;
    border-radius: 999px !important;
    border: 2px solid transparent !important;
    background-clip: padding-box !important;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tm-scrollbar-thumb-hover) !important;
    background-clip: padding-box !important;
}

::-webkit-scrollbar-corner {
    background: transparent !important;
}

.sidebar-nav-item {
    margin-bottom: 4px;
}

.sidebar-nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
}

.sidebar-nav-item a i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-nav-item a:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary-color);
}

/* 确保导航链接可点击且使用默认跳转 */
.sidebar-nav-item a[href] {
    pointer-events: auto !important;
}

.sidebar-nav-item.active a {
    background: var(--success-color);
    color: white;
    font-weight: 600;
}

.sidebar-nav-item.active a i {
    color: white;
}

/* 游戏化页标题：主标题 + 小字原名 */
.tm-heading-gaming {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.25;
}
.tm-heading-gaming .tm-heading-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tm-heading-gaming .tm-heading-main {
    font-size: inherit;
    font-weight: inherit;
}
.tm-heading-gaming .tm-heading-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
    opacity: 0.88;
}
/* 侧栏导航：主文案 + 原名小字 */
.sidebar-nav-item a .sidebar-nav-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    min-width: 0;
    font-weight: 500;
}
.sidebar-nav-item a .sidebar-nav-sub {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.78;
    margin-top: 1px;
}
.sidebar-nav-item.active a .sidebar-nav-sub {
    opacity: 0.9;
}
/* KPI 等双行标签 */
.tm-kpi-sub {
    display: block;
    font-size: 10px;
    font-weight: 400;
    opacity: 0.75;
    margin-top: 2px;
}

.sidebar-nav-item.active a:hover {
    background: var(--success-color);
    color: white;
}

.float-ai-assistant .float-ai-nav-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    text-align: center;
}
.float-ai-assistant .float-ai-sub {
    font-size: 9px;
    font-weight: 500;
    opacity: 0.92;
}
.sidebar-logo .sidebar-nav-text .sidebar-nav-main,
.mobile-logo .sidebar-nav-text .sidebar-nav-main {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    max-width: 200px;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #4a5fc1 0%, #2e86ab 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.sidebar-logo .sidebar-nav-text .sidebar-nav-sub,
.mobile-logo .sidebar-nav-text .sidebar-nav-sub {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 2px;
}
.mobile-logo .sidebar-nav-text {
    text-align: left;
    max-width: calc(100vw - 100px);
}
.mobile-logo .sidebar-nav-main {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-user--logout-only {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.sidebar-user--logout-only .sidebar-logout-btn {
    margin-top: 0;
}

.sidebar-user {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin: 0 auto 6px;
    font-size: 14px;
}

.user-info {
    text-align: center;
    margin-bottom: 8px;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-light);
}

.user-phone {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    word-break: break-all;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-logout-btn:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.06);
}

/* 加载中占位 */
.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.loading-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: loadingSpin 0.8s linear infinite;
}
.loading-text { font-size: 14px; margin: 0; }
@keyframes loadingSpin { to { transform: rotate(360deg); } }

/* 灵感时间轴 */
.timeline-wrap { position: relative; padding-left: 24px; }
.timeline-wrap::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--card-background);
}
.timeline-item .timeline-time { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.timeline-item .timeline-content { background: var(--card-background); padding: 12px; border-radius: 12px; box-shadow: var(--shadow); }

/* 主内容区 - 紧凑一屏 */
.main-content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    background: var(--background-color);
    pointer-events: auto;
}

/* 首页快捷按钮等链接 - 确保可点击 */
.action-btn,
a.action-btn {
    pointer-events: auto !important;
    cursor: pointer;
}

.content-header {
    margin-bottom: 12px;
}

.content-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.2;
}

.content-subtitle {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
}

/* 顶部操作栏 */
.content-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-background);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.action-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.action-icon i {
    color: var(--text-color);
    font-size: 16px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--success-color);
    color: white;
}

.btn-primary:hover {
    background: #7dd87d;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 经典效率 · 自定义配色：按钮/侧栏选中与主色次色一致，避免默认绿与自定义色冲突 */
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: #fff;
}
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    filter: brightness(1.06);
    box-shadow: var(--shadow-hover);
}
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .sidebar-nav-item.active a {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
}
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .settings-section h3,
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .content-title {
    color: var(--primary-color);
}
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .sidebar-logo {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 9%, #fff), color-mix(in srgb, var(--secondary-color) 11%, #fff));
    border-color: color-mix(in srgb, var(--primary-color) 18%, transparent);
}
html[data-tm-ui="classic"][data-tm-custom-colors="1"] .float-ai-assistant {
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary-color) 35%, transparent);
}

.btn-secondary {
    background: var(--accent-blue);
    color: white;
}

.btn-secondary:hover {
    background: #7bc4d1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* 卡片样式 - 紧凑 */
.card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
    border-color: rgba(102, 126, 234, 0.2);
}

/* KPI卡片 - 紧凑 */
.kpi-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.kpi-card.purple {
    background: var(--accent-purple);
}

.kpi-card.blue {
    background: var(--accent-blue);
}

.kpi-card.green {
    background: var(--accent-green);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin: 6px 0 4px 0;
    line-height: 1;
}

.kpi-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.kpi-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

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

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s;
    background: var(--card-background);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 网格布局 - 紧凑 */
.grid {
    display: grid;
    gap: 12px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 导航栏（旧版，保留兼容） */
.navbar {
    background: var(--card-background);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 0;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

/* 移动端菜单头部样式 */
.sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    margin-bottom: 0;
}

.sidebar-mobile-header .mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    padding: 6px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(46, 134, 171, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.mobile-logo .tm-brand-mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 10px;
}

.sidebar-mobile-header .mobile-logo i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 18px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.sidebar-mobile-header .mobile-logo .tm-camp-logo-img {
    width: 40px;
    height: 40px;
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border-radius: 12px;
}

.mobile-menu-btn i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mobile-menu-btn:active i {
    transform: scale(1.1);
}

/* 响应式 - 手机和平板自适应 */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
        margin: 8px;
        border-radius: 12px;
        height: auto;
        min-height: calc(100vh - 16px);
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 12px;
        flex-shrink: 0;
    }
    
    /* 移动端头部 */
    .sidebar-mobile-header {
        display: flex;
    }
    
    /* 隐藏桌面端Logo（由JS控制） */
    
    .sidebar-logo {
        font-size: 16px;
        margin-bottom: 0;
        text-align: left;
    }
    
    .sidebar-logo i {
        font-size: 20px;
    }

    .sidebar-logo .tm-camp-logo-img,
    .mobile-logo .tm-camp-logo-img {
        width: 36px;
        height: 36px;
    }
    
    /* 菜单网格布局 */
    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    .sidebar-user {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding-top: 10px;
        margin-top: 10px;
        flex-wrap: wrap;
        transition: all 0.3s ease;
        overflow: hidden;
        max-height: 200px;
    }
    
    .sidebar-nav.collapsed ~ .sidebar-user {
        max-height: 0;
        padding-top: 0;
        margin-top: 0;
        opacity: 0;
        pointer-events: none;
    }
    
    .sidebar-nav-item {
        margin-bottom: 0;
    }
    
    .sidebar-nav-item a {
        flex-direction: column;
        gap: 2px;
        padding: 8px 4px;
        font-size: 11px;
        text-align: center;
        border-radius: 8px;
    }
    
    .sidebar-nav-item a i {
        width: auto;
        font-size: 16px;
    }
    
    .sidebar-nav-item a span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .sidebar-nav-item a .sidebar-nav-text {
        white-space: normal;
        align-items: center;
        text-align: center;
        max-width: 100%;
    }
    .sidebar-nav-item a .sidebar-nav-text .sidebar-nav-main {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .sidebar-user .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .sidebar-user .user-info {
        flex: 1;
        min-width: 0;
    }
    
    .sidebar-user .user-name {
        font-size: 13px;
    }
    
    .sidebar-user .user-role {
        font-size: 11px;
    }
    
    .sidebar-user .user-phone {
        font-size: 10px;
    }
    
    .sidebar-logout-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .main-content {
        padding: 15px;
        flex: 1;
    }

    body.tm-rs-mobile-layout .main-content,
    body:has(#tmRightSidebar) .main-content {
        padding-bottom: calc(15px + var(--tm-mobile-bar-offset));
    }
    
    .content-header {
        margin-bottom: 15px;
    }
    
    .content-title {
        font-size: 18px;
    }
    
    .content-subtitle {
        font-size: 12px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* AI助手和提醒框移动端适配 */
    .float-ai-assistant {
        right: 8px;
        padding: 10px 8px;
        font-size: 10px;
    }
    
    .float-ai-assistant .tm-ai-elf-icon .tm-ai-elf-img {
        width: 44px;
        height: 44px;
    }
    
    .reminder-box {
        width: calc(100vw - 20px);
        min-width: auto;
        max-width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        bottom: calc(10px + var(--tm-mobile-bar-offset));
        /* 避免提醒层过高盖住副本「清剿」按钮 */
        max-height: min(38vh, 280px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 更小屏幕（小手机） */
@media (max-width: 480px) {
    .sidebar-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .sidebar-nav-item a {
        padding: 6px 2px;
        font-size: 10px;
    }
    
    .sidebar-nav-item a i {
        font-size: 14px;
    }
    
    .main-content {
        padding: 10px;
    }

    body.tm-rs-mobile-layout .main-content,
    body:has(#tmRightSidebar) .main-content {
        padding-bottom: calc(10px + var(--tm-mobile-bar-offset));
    }
}

/* 平板横屏 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 180px;
        padding: 12px 10px;
    }
    
    .sidebar-nav-item a {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* ========== 人生管理系统 · 游戏化（RPG · 明亮奇幻）========== */
html[data-tm-ui="rpg"] {
    /* 明亮奇幻：天穹、暖沙、符文金、精灵青 */
    color-scheme: light;
    --tm-fantasy-gold: #d4a84b;
    --tm-fantasy-gold-light: #f5e6bc;
    --tm-fantasy-sky: #5dade2;
    --tm-fantasy-sky-deep: #2e86ab;
    --tm-fantasy-mist: #eef6ff;
    --tm-fantasy-parchment: #fffbf5;
    --tm-fantasy-orchid: #c39bd3;
    --primary-color: #2e86ab;
    --secondary-color: #9b59b6;
    --background-color: transparent;
    --card-background: rgba(255, 252, 248, 0.96);
    --text-color: #2a3348;
    --text-light: #5a6578;
    --border-color: rgba(212, 168, 75, 0.28);
    --shadow: 0 4px 18px rgba(46, 134, 171, 0.1), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
    --shadow-hover: 0 10px 28px rgba(46, 134, 171, 0.16), 0 0 0 1px rgba(212, 168, 75, 0.35);
    --accent-purple: #e8d5f2;
    --accent-blue: #d4eaf7;
    --accent-green: #d5f4ef;
    --tm-datetime-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238b6914'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 16H5V10h14v10ZM7 11h2v2H7v-2Zm4 0h2v2h-2v-2Zm4 0h2v2h-2v-2ZM7 15h2v2H7v-2Zm4 0h2v2h-2v-2Z'/%3E%3C/svg%3E");
    --tm-datetime-bg: rgba(255, 252, 248, 0.96);
    --tm-scrollbar-thumb: rgba(46, 134, 171, 0.42);
    --tm-scrollbar-thumb-hover: rgba(212, 168, 75, 0.7);
    --tm-scrollbar-track: rgba(212, 168, 75, 0.12);
}

html[data-tm-ui="rpg"] body {
    background:
        radial-gradient(120% 80% at 10% -10%, rgba(255, 230, 180, 0.45) 0%, transparent 55%),
        radial-gradient(90% 70% at 100% 0%, rgba(195, 155, 211, 0.22) 0%, transparent 50%),
        linear-gradient(168deg, #d9eefc 0%, #fff9f2 42%, #f3ecff 100%);
    background-attachment: fixed;
}

html[data-tm-ui="rpg"] .main-wrapper {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 251, 245, 0.82) 50%, rgba(245, 248, 255, 0.78) 100%);
    border: 1px solid rgba(212, 168, 75, 0.35);
    box-shadow:
        0 8px 36px rgba(46, 134, 171, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.75) inset,
        0 1px 0 rgba(212, 168, 75, 0.2);
    border-radius: 20px;
}

html[data-tm-ui="rpg"] .main-content {
    background: transparent;
}

html[data-tm-ui="rpg"] .sidebar {
    background: linear-gradient(180deg, #fffefb 0%, #f5f9ff 55%, #faf5ff 100%);
    border-right: 2px solid rgba(212, 168, 75, 0.32);
    box-shadow:
        inset -8px 0 24px -12px rgba(46, 134, 171, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

html[data-tm-ui="rpg"] .sidebar-logo {
    color: var(--text-color);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 230, 180, 0.35) 0%, rgba(212, 236, 255, 0.45) 100%);
    border: 1px solid rgba(212, 168, 75, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

html[data-tm-ui="rpg"] .tm-brand-mark {
    background: linear-gradient(145deg, #2a9d8f 0%, #2e86ab 55%, #d4a84b 130%);
    box-shadow:
        0 4px 14px rgba(42, 157, 143, 0.35),
        0 0 0 1px rgba(255, 230, 160, 0.35) inset;
}

html[data-tm-ui="rpg"] .sidebar-logo i {
    color: var(--tm-fantasy-sky-deep);
    filter: drop-shadow(0 1px 2px rgba(212, 168, 75, 0.45));
}

html[data-tm-ui="rpg"] .sidebar-logo .sidebar-nav-main,
html[data-tm-ui="rpg"] .mobile-logo .sidebar-nav-main {
    background: linear-gradient(135deg, #1a6b8a 0%, #2a9d8f 55%, #c9922e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

html[data-tm-ui="rpg"] .sidebar-logo .sidebar-nav-sub,
html[data-tm-ui="rpg"] .mobile-logo .sidebar-nav-sub {
    color: #7a8fa8 !important;
}

html[data-tm-ui="rpg"] .sidebar-nav-item a {
    border: 1px solid transparent;
}

html[data-tm-ui="rpg"] .sidebar-nav-item a:hover {
    background: linear-gradient(135deg, rgba(255, 230, 180, 0.35) 0%, rgba(212, 236, 255, 0.45) 100%);
    color: var(--tm-fantasy-sky-deep);
    border-color: rgba(212, 168, 75, 0.22);
    box-shadow: 0 2px 10px rgba(46, 134, 171, 0.08);
}

html[data-tm-ui="rpg"] .sidebar-nav-item.active a {
    background: linear-gradient(135deg, #2a9d8f 0%, #2e86ab 48%, #5dade2 100%);
    color: #fff;
    border-color: rgba(255, 214, 120, 0.55);
    box-shadow:
        0 4px 16px rgba(42, 157, 143, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset,
        0 0 20px rgba(93, 173, 226, 0.25);
}

html[data-tm-ui="rpg"] .sidebar-nav-item.active a i {
    color: #fffbe6;
    filter: drop-shadow(0 0 4px rgba(255, 214, 120, 0.6));
}

html[data-tm-ui="rpg"] .sidebar-nav-item a .sidebar-nav-sub,
html[data-tm-ui="rpg"] .sidebar-nav-item.active a .sidebar-nav-sub {
    opacity: 0.92;
    color: inherit;
}

html[data-tm-ui="rpg"] .sidebar-nav-item.active a .sidebar-nav-sub {
    color: rgba(255, 251, 230, 0.9);
}

html[data-tm-ui="rpg"] .sidebar-user {
    border-top-color: rgba(212, 168, 75, 0.28);
}

html[data-tm-ui="rpg"] .sidebar-logout-btn {
    border-color: rgba(212, 168, 75, 0.35);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-light);
}

html[data-tm-ui="rpg"] .sidebar-logout-btn:hover {
    border-color: #e76f51;
    color: #c0392b;
    background: rgba(255, 235, 230, 0.75);
}

html[data-tm-ui="rpg"] .float-ai-assistant {
    background: linear-gradient(160deg, #2e86ab 0%, #9b59b6 55%, #d4a84b 130%);
    border: 1px solid rgba(255, 230, 160, 0.55);
    box-shadow:
        0 6px 22px rgba(46, 134, 171, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.25) inset,
        0 0 24px rgba(212, 168, 75, 0.35);
}

html[data-tm-ui="rpg"] .float-ai-assistant:hover {
    box-shadow:
        0 8px 28px rgba(155, 89, 182, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset,
        0 0 28px rgba(212, 168, 75, 0.45);
}

html[data-tm-ui="rpg"] .tm-heading-gaming .tm-heading-main {
    background: linear-gradient(90deg, #1a5276 0%, #2e86ab 40%, #b9770e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8));
}

html[data-tm-ui="rpg"] .tm-heading-gaming .tm-heading-sub {
    color: #7d6b4e;
    opacity: 1;
}

html[data-tm-ui="rpg"] .content-title:not(.tm-heading-gaming) {
    color: var(--text-color);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-tm-ui="rpg"] .content-title.tm-heading-gaming {
    letter-spacing: 0.02em;
}

html[data-tm-ui="rpg"] .content-subtitle {
    color: #5c6578;
}

html[data-tm-ui="rpg"] .kpi-card,
html[data-tm-ui="rpg"] .todo-card,
html[data-tm-ui="rpg"] .goal-card,
html[data-tm-ui="rpg"] .action-btn,
html[data-tm-ui="rpg"] .expense-form,
html[data-tm-ui="rpg"] .dashboard-section,
html[data-tm-ui="rpg"] .card {
    border: 1px solid rgba(212, 168, 75, 0.3) !important;
    box-shadow:
        0 4px 20px rgba(46, 134, 171, 0.09),
        0 0 0 1px rgba(255, 255, 255, 0.75) inset,
        0 1px 0 rgba(255, 230, 180, 0.5) inset !important;
    border-radius: 16px !important;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 252, 246, 0.96) 100%) !important;
    transition: box-shadow 0.28s ease, transform 0.28s ease;
}

html[data-tm-ui="rpg"] .tm-gamification-panel.card {
    border: 1px solid rgba(212, 168, 75, 0.38) !important;
    box-shadow:
        0 6px 26px rgba(46, 134, 171, 0.11),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset,
        0 1px 0 rgba(255, 230, 180, 0.55) inset !important;
    background: linear-gradient(168deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 252, 255, 0.97) 45%, rgba(255, 251, 245, 0.98) 100%) !important;
}

html[data-tm-ui="rpg"] .tm-gamification-panel .tm-xp-bar {
    background: linear-gradient(90deg, #2a9d8f, #5dade2, #f4c430) !important;
}

html[data-tm-ui="rpg"] .kpi-card:hover,
html[data-tm-ui="rpg"] .todo-card:hover,
html[data-tm-ui="rpg"] .goal-card:hover {
    box-shadow:
        0 10px 28px rgba(46, 134, 171, 0.14),
        0 0 0 1px rgba(212, 168, 75, 0.4) inset !important;
    transform: translateY(-2px);
}

/* 首页 KPI：RPG 通用白底规则会盖住彩条且保留白字 → 数字看不见；此处恢复可读对比 */
html[data-tm-ui="rpg"] .stats-grid .kpi-card.purple {
    background: linear-gradient(145deg, #e8ddf5 0%, #faf7ff 100%) !important;
}
html[data-tm-ui="rpg"] .stats-grid .kpi-card.blue {
    background: linear-gradient(145deg, #d4e9f5 0%, #f5fbff 100%) !important;
}
html[data-tm-ui="rpg"] .stats-grid .kpi-card.green {
    background: linear-gradient(145deg, #d5efe6 0%, #f6fffa 100%) !important;
}
html[data-tm-ui="rpg"] .stats-grid .kpi-card .kpi-value {
    color: #14324d !important;
}
html[data-tm-ui="rpg"] .stats-grid .kpi-card .kpi-label {
    color: #2d4a63 !important;
}
html[data-tm-ui="rpg"] .stats-grid .kpi-card .kpi-label .tm-kpi-sub {
    color: #5a6f82 !important;
}
html[data-tm-ui="rpg"] .stats-grid .kpi-card .kpi-icon {
    color: #1e6b96 !important;
    background: rgba(46, 134, 171, 0.14) !important;
}

html[data-tm-ui="rpg"] .btn-primary {
    background: linear-gradient(135deg, #2a9d8f 0%, #2e86ab 100%);
    color: #fff;
    border: 1px solid rgba(255, 230, 160, 0.35);
    box-shadow: 0 3px 12px rgba(42, 157, 143, 0.28);
}

html[data-tm-ui="rpg"] .btn-primary:hover {
    background: linear-gradient(135deg, #248a7e 0%, #2878a8 100%);
    filter: brightness(1.03);
}

html[data-tm-ui="rpg"] .sidebar-gamification-hud {
    background: linear-gradient(145deg, rgba(255, 252, 245, 0.98) 0%, rgba(232, 245, 255, 0.95) 100%);
    border: 1px solid rgba(212, 168, 75, 0.4);
    box-shadow:
        0 4px 18px rgba(46, 134, 171, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 0 22px rgba(212, 168, 75, 0.15);
}

html[data-tm-ui="rpg"] .tm-sidebar-ring {
    background: conic-gradient(
        #f4c430 0%,
        #ffd870 calc(var(--tm-ring-pct, 0) * 1%),
        #e2eaf5 0
    );
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.95),
        0 0 0 5px rgba(212, 168, 75, 0.35),
        0 6px 20px rgba(46, 134, 171, 0.25);
}

html[data-tm-ui="rpg"] .tm-sidebar-ring::after {
    background: linear-gradient(180deg, #fffefb 0%, #f4f9ff 100%);
}

html[data-tm-ui="rpg"] .tm-sidebar-lv {
    color: #1a5276;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-tm-ui="rpg"] .tm-camp-hud-avatar {
    color: #1a5276;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-tm-ui="rpg"] .tm-sidebar-xp-line {
    color: #5a6578;
    font-weight: 500;
}

html[data-tm-ui="rpg"] .tm-camp-profile {
    border-bottom-color: rgba(212, 168, 75, 0.3);
}

html[data-tm-ui="rpg"] .tm-camp-profile .tm-camp-avatar {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.95),
        0 4px 16px rgba(46, 134, 171, 0.22),
        0 0 0 4px rgba(212, 168, 75, 0.32);
}

html[data-tm-ui="rpg"] .tm-camp-profile .tm-camp-avatar:not(.has-img) {
    background: linear-gradient(145deg, #8e6bc8 0%, #2e86ab 55%, #2a9d8f 100%);
}

html[data-tm-ui="rpg"] .sidebar-mobile-header {
    border-bottom: 1px solid rgba(212, 168, 75, 0.22);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

html[data-tm-ui="rpg"] .mobile-menu-btn {
    border: 1px solid rgba(212, 168, 75, 0.35);
    background: rgba(255, 255, 255, 0.65);
    color: var(--tm-fantasy-sky-deep);
}

.sidebar-gamification-hud {
    margin: 10px 0 14px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    flex-shrink: 0;
}
.tm-sidebar-ring-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
}
.tm-sidebar-ring {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) calc(var(--tm-ring-pct, 0) * 1%), #e0e4f5 0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 4px 14px rgba(102, 126, 234, 0.25);
}
.tm-sidebar-ring::after {
    content: '';
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--card-background);
    z-index: 0;
}
.tm-sidebar-lv {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    z-index: 1;
    font-variant-numeric: tabular-nums;
}
.tm-sidebar-xp-line {
    text-align: center;
    font-size: 11px;
}
@media (prefers-reduced-motion: reduce) {
    html[data-tm-ui="rpg"] .todo-item,
    html[data-tm-ui="rpg"] .action-btn,
    html[data-tm-ui="rpg"] .goal-card,
    html[data-tm-ui="dark"] .todo-item,
    html[data-tm-ui="dark"] .action-btn,
    html[data-tm-ui="dark"] .goal-card {
        transition: none !important;
    }
    .todo-item.todo-xp-flash,
    html[data-tm-ui="rpg"] .todo-item.todo-xp-flash,
    html[data-tm-ui="dark"] .todo-item.todo-xp-flash {
        animation: none !important;
    }
}
.todo-item.todo-xp-flash {
    animation: tmXpFlash 0.45s ease-out 1;
}
@keyframes tmXpFlash {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.6); }
    100% { box-shadow: 0 0 0 12px rgba(102, 126, 234, 0); }
}

html[data-tm-ui="rpg"] .todo-item.todo-xp-flash {
    animation: tmXpFlashRpg 0.48s ease-out 1;
}

@keyframes tmXpFlashRpg {
    0% { box-shadow: 0 0 0 0 rgba(244, 196, 48, 0.55); }
    100% { box-shadow: 0 0 0 14px rgba(93, 173, 226, 0); }
}

/* ========== 人生管理系统 · 游戏化（暗黑营地）========== */
html[data-tm-ui="dark"] {
    color-scheme: dark;
    background-color: #0c0f14;
    --tm-fantasy-gold: #d4af37;
    --tm-fantasy-gold-light: #3d3528;
    --tm-fantasy-sky: #5dade2;
    --tm-fantasy-sky-deep: #7ebfe8;
    --tm-fantasy-mist: #1a2230;
    --tm-fantasy-parchment: #12161d;
    --tm-fantasy-orchid: #9b7bbd;
    --primary-color: #5dade2;
    --secondary-color: #a569bd;
    --background-color: transparent;
    --card-background: rgba(26, 32, 44, 0.94);
    --text-color: #e6edf5;
    --text-light: #9aa8bc;
    --border-color: rgba(212, 168, 75, 0.22);
    --shadow: 0 4px 22px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(93, 173, 226, 0.12) inset;
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 168, 75, 0.28) inset;
    --accent-purple: #3d2f52;
    --accent-blue: #243949;
    --accent-green: #1e3834;
    --tm-datetime-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a8e6ff'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 16H5V10h14v10ZM7 11h2v2H7v-2Zm4 0h2v2h-2v-2Zm4 0h2v2h-2v-2ZM7 15h2v2H7v-2Zm4 0h2v2h-2v-2Z'/%3E%3C/svg%3E");
    --tm-datetime-bg: rgba(16, 22, 32, 0.92);
    --tm-scrollbar-thumb: rgba(93, 173, 226, 0.38);
    --tm-scrollbar-thumb-hover: rgba(93, 173, 226, 0.58);
    --tm-scrollbar-track: rgba(12, 15, 20, 0.45);
}

html[data-tm-ui="dark"] body {
    background:
        radial-gradient(100% 80% at 15% 0%, rgba(93, 173, 226, 0.14) 0%, transparent 45%),
        radial-gradient(90% 60% at 95% 10%, rgba(165, 105, 189, 0.2) 0%, transparent 50%),
        linear-gradient(168deg, #0c0f14 0%, #151b26 38%, #0f1520 100%);
    background-attachment: fixed;
}

html[data-tm-ui="dark"] .main-wrapper {
    background: linear-gradient(145deg, rgba(22, 28, 38, 0.92) 0%, rgba(18, 24, 34, 0.94) 50%, rgba(20, 26, 36, 0.92) 100%);
    border: 1px solid rgba(212, 168, 75, 0.22);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(93, 173, 226, 0.1) inset,
        0 1px 0 rgba(212, 168, 75, 0.12);
    border-radius: 20px;
}

html[data-tm-ui="dark"] .main-content {
    background: transparent;
}

html[data-tm-ui="dark"] .sidebar {
    background: linear-gradient(180deg, #141a24 0%, #10151d 55%, #12182a 100%);
    border-right: 2px solid rgba(212, 168, 75, 0.18);
    box-shadow:
        inset -8px 0 24px -12px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(93, 173, 226, 0.06);
}

html[data-tm-ui="dark"] .sidebar-logo {
    color: var(--text-color);
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.08) 0%, rgba(36, 113, 163, 0.12) 100%);
    border-color: rgba(93, 173, 226, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

html[data-tm-ui="dark"] .tm-brand-mark {
    background: linear-gradient(145deg, #2471a3 0%, #1f6f65 50%, #5dade2 100%);
    box-shadow: 0 4px 16px rgba(36, 113, 163, 0.45);
}

html[data-tm-ui="dark"] .sidebar-logo i {
    color: var(--tm-fantasy-sky);
    filter: drop-shadow(0 0 6px rgba(93, 173, 226, 0.45));
}

html[data-tm-ui="dark"] .sidebar-nav-item a {
    border: 1px solid transparent;
}

html[data-tm-ui="dark"] .sidebar-nav-item a:hover {
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.12) 0%, rgba(165, 105, 189, 0.1) 100%);
    color: #b8d9f0;
    border-color: rgba(212, 168, 75, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

html[data-tm-ui="dark"] .sidebar-nav-item.active a {
    background: linear-gradient(135deg, #1f6f65 0%, #2471a3 48%, #5dade2 100%);
    color: #fff;
    border-color: rgba(212, 168, 75, 0.35);
    box-shadow:
        0 4px 18px rgba(36, 113, 163, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 18px rgba(93, 173, 226, 0.25);
}

html[data-tm-ui="dark"] .sidebar-nav-item.active a i {
    color: #fff8dc;
    filter: drop-shadow(0 0 4px rgba(212, 168, 75, 0.5));
}

html[data-tm-ui="dark"] .sidebar-nav-item a .sidebar-nav-sub,
html[data-tm-ui="dark"] .sidebar-nav-item.active a .sidebar-nav-sub {
    opacity: 0.9;
    color: inherit;
}

html[data-tm-ui="dark"] .sidebar-nav-item.active a .sidebar-nav-sub {
    color: rgba(255, 251, 230, 0.88);
}

html[data-tm-ui="dark"] .sidebar-user {
    border-top-color: rgba(212, 168, 75, 0.18);
}

html[data-tm-ui="dark"] .sidebar-logout-btn {
    border-color: rgba(212, 168, 75, 0.25);
    background: rgba(30, 38, 52, 0.75);
    color: var(--text-light);
}

html[data-tm-ui="dark"] .sidebar-logout-btn:hover {
    border-color: #e76f51;
    color: #ffb4a2;
    background: rgba(60, 28, 24, 0.65);
}

html[data-tm-ui="dark"] .float-ai-assistant {
    background: linear-gradient(160deg, #1a3d52 0%, #5b2c6f 55%, #6b4a12 130%);
    border: 1px solid rgba(212, 168, 75, 0.35);
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(93, 173, 226, 0.2) inset,
        0 0 20px rgba(165, 105, 189, 0.25);
}

html[data-tm-ui="dark"] .float-ai-assistant:hover {
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(212, 168, 75, 0.25) inset,
        0 0 26px rgba(93, 173, 226, 0.3);
}

html[data-tm-ui="dark"] .tm-heading-gaming .tm-heading-main {
    background: linear-gradient(90deg, #a8d8f0 0%, #5dade2 38%, #e8c547 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

html[data-tm-ui="dark"] .content-title:not(.tm-heading-gaming) {
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

html[data-tm-ui="dark"] .content-title.tm-heading-gaming {
    letter-spacing: 0.02em;
}

html[data-tm-ui="dark"] .kpi-card,
html[data-tm-ui="dark"] .todo-card,
html[data-tm-ui="dark"] .goal-card,
html[data-tm-ui="dark"] .action-btn,
html[data-tm-ui="dark"] .expense-form,
html[data-tm-ui="dark"] .dashboard-section,
html[data-tm-ui="dark"] .card {
    border: 1px solid rgba(212, 168, 75, 0.2) !important;
    box-shadow:
        0 4px 22px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(93, 173, 226, 0.08) inset,
        0 1px 0 rgba(212, 168, 75, 0.12) inset !important;
    border-radius: 16px !important;
    background: linear-gradient(165deg, rgba(30, 38, 52, 0.96) 0%, rgba(22, 28, 40, 0.98) 100%) !important;
    transition: box-shadow 0.28s ease, transform 0.28s ease;
}

html[data-tm-ui="dark"] .tm-gamification-panel.card {
    border: 1px solid rgba(212, 168, 75, 0.28) !important;
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(93, 173, 226, 0.1) inset,
        0 1px 0 rgba(212, 168, 75, 0.15) inset !important;
    background: linear-gradient(168deg, rgba(32, 40, 56, 0.98) 0%, rgba(24, 30, 44, 0.98) 45%, rgba(26, 32, 48, 0.98) 100%) !important;
}

html[data-tm-ui="dark"] .tm-gamification-panel .tm-xp-bar {
    background: linear-gradient(90deg, #1abc9c, #3498db, #f4c430) !important;
}

html[data-tm-ui="dark"] .kpi-card:hover,
html[data-tm-ui="dark"] .todo-card:hover,
html[data-tm-ui="dark"] .goal-card:hover {
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(212, 168, 75, 0.3) inset !important;
    transform: translateY(-2px);
}

html[data-tm-ui="dark"] .stats-grid .kpi-card.purple {
    background: linear-gradient(145deg, #2f2540 0%, #1c2230 100%) !important;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card.blue {
    background: linear-gradient(145deg, #1e3548 0%, #151d2a 100%) !important;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card.green {
    background: linear-gradient(145deg, #1a3832 0%, #141f24 100%) !important;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card .kpi-value {
    color: #e8ecf4 !important;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card .kpi-label {
    color: #b8c5d8 !important;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card .kpi-label .tm-kpi-sub {
    color: #8a9aad !important;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card .kpi-icon {
    color: #7ebfe8 !important;
    background: rgba(93, 173, 226, 0.12) !important;
}

html[data-tm-ui="dark"] .btn-primary {
    background: linear-gradient(135deg, #1a7a6f 0%, #2874a6 100%);
    color: #fff;
    border: 1px solid rgba(212, 168, 75, 0.28);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

html[data-tm-ui="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #159078 0%, #2e86ab 100%);
    filter: brightness(1.06);
}

html[data-tm-ui="dark"] .sidebar-gamification-hud {
    background: linear-gradient(145deg, rgba(28, 34, 48, 0.95) 0%, rgba(22, 30, 44, 0.95) 100%);
    border: 1px solid rgba(212, 168, 75, 0.25);
    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(93, 173, 226, 0.08) inset,
        0 0 18px rgba(212, 168, 75, 0.08);
}

html[data-tm-ui="dark"] .tm-sidebar-ring {
    background: conic-gradient(
        #f4c430 0%,
        #e8c547 calc(var(--tm-ring-pct, 0) * 1%),
        #2a3444 0
    );
    box-shadow:
        0 0 0 3px rgba(40, 48, 62, 0.95),
        0 0 0 5px rgba(212, 168, 75, 0.25),
        0 6px 20px rgba(0, 0, 0, 0.45);
}

html[data-tm-ui="dark"] .tm-sidebar-ring::after {
    background: linear-gradient(180deg, #1e2636 0%, #161d2a 100%);
}

html[data-tm-ui="dark"] .tm-sidebar-lv {
    color: #e8ecf4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

html[data-tm-ui="dark"] .tm-camp-hud-avatar {
    color: #e8ecf4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

html[data-tm-ui="dark"] .tm-camp-hud-lv-badge,
html[data-tm-ui="dark"] .tm-camp-lv-inline {
    color: #c8b8e8;
    background: rgba(102, 126, 234, 0.2);
}

html[data-tm-ui="dark"] .tm-door-medal {
    color: #dce2f0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.2));
    border-color: rgba(212, 168, 75, 0.35);
}

html[data-tm-ui="dark"] .tm-sidebar-xp-line {
    color: #9aa8bc;
    font-weight: 500;
}

html[data-tm-ui="dark"] .tm-camp-profile {
    border-bottom-color: rgba(212, 168, 75, 0.2);
}

html[data-tm-ui="dark"] .tm-camp-profile .tm-camp-avatar {
    box-shadow:
        0 0 0 3px rgba(40, 48, 62, 0.95),
        0 4px 16px rgba(0, 0, 0, 0.45),
        0 0 0 4px rgba(212, 168, 75, 0.22);
}

html[data-tm-ui="dark"] .tm-camp-profile .tm-camp-avatar:not(.has-img) {
    background: linear-gradient(145deg, #6b4c9a 0%, #2874a6 55%, #1a7a6f 100%);
}

html[data-tm-ui="dark"] .sidebar-mobile-header {
    border-bottom: 1px solid rgba(212, 168, 75, 0.15);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

html[data-tm-ui="dark"] .mobile-menu-btn {
    border: 1px solid rgba(212, 168, 75, 0.25);
    background: rgba(30, 38, 52, 0.85);
    color: var(--tm-fantasy-sky);
}

/* 暗黑营地：正文 / 侧栏 / Bootstrap 辅助色，避免深字贴深底 */
html[data-tm-ui="dark"] .main-content {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .sidebar-nav-item a {
    color: #c9d4e4;
}
html[data-tm-ui="dark"] .sidebar-nav-item a:hover {
    color: #dff0ff;
}
html[data-tm-ui="dark"] .sidebar-nav-item a i {
    color: #8ecae6;
}
html[data-tm-ui="dark"] .sidebar-nav-item a .sidebar-nav-sub {
    color: #b8c9de !important;
    opacity: 1;
}
html[data-tm-ui="dark"] .sidebar-logo .sidebar-nav-sub,
html[data-tm-ui="dark"] .mobile-logo .sidebar-nav-sub {
    color: #9aa8bc !important;
}
html[data-tm-ui="dark"] .text-muted {
    color: #a8b4c8 !important;
}
html[data-tm-ui="dark"] .text-secondary {
    color: #9aa8bc !important;
}
html[data-tm-ui="dark"] .text-body {
    color: var(--text-color) !important;
}
html[data-tm-ui="dark"] .text-dark {
    color: var(--text-color) !important;
}
html[data-tm-ui="dark"] .main-content a:not(.btn):not(.action-btn) {
    color: #6ec4eb;
}
html[data-tm-ui="dark"] .main-content a:not(.btn):not(.action-btn):hover {
    color: #a8e6ff;
}
html[data-tm-ui="dark"] .todo-card,
html[data-tm-ui="dark"] .goal-card,
html[data-tm-ui="dark"] .action-btn {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .action-btn i {
    color: var(--primary-color);
}
html[data-tm-ui="dark"] .action-btn .tm-kpi-sub {
    color: var(--text-light) !important;
}
html[data-tm-ui="dark"] .dashboard-section .section-title {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .dashboard-section .section-count,
html[data-tm-ui="dark"] .section-more-link {
    color: var(--text-light) !important;
}
html[data-tm-ui="dark"] .form-control {
    color: #e8ecf4;
    background: rgba(16, 22, 32, 0.92);
    border-color: rgba(212, 168, 75, 0.22);
}
html[data-tm-ui="dark"] .form-control:focus {
    color: #f2f6fc;
    background: rgba(20, 28, 40, 0.98);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.22);
}
html[data-tm-ui="dark"] .form-control::placeholder {
    color: #7d8fa3;
    opacity: 1;
}
html[data-tm-ui="dark"] select.form-control,
html[data-tm-ui="dark"] select.form-select {
    color: #e8ecf4;
    background-color: rgba(16, 22, 32, 0.92);
    border-color: rgba(212, 168, 75, 0.22);
}
html[data-tm-ui="dark"] textarea.form-control {
    color: #e8ecf4;
    background: rgba(16, 22, 32, 0.92);
}
html[data-tm-ui="dark"] .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.22);
}
html[data-tm-ui="dark"] .form-check-label {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .input-group-text {
    background: rgba(30, 38, 52, 0.9);
    color: var(--text-light);
    border-color: rgba(212, 168, 75, 0.22);
}
html[data-tm-ui="dark"] .btn-outline-secondary,
html[data-tm-ui="dark"] .btn-outline-primary {
    color: #c9d4e4;
    border-color: rgba(255, 255, 255, 0.28);
}
html[data-tm-ui="dark"] .btn-outline-secondary:hover,
html[data-tm-ui="dark"] .btn-outline-primary:hover {
    color: #0f1419;
    background: #c9d4e4;
    border-color: #c9d4e4;
}
html[data-tm-ui="dark"] .btn-secondary {
    background: rgba(52, 62, 78, 0.95);
    color: #e8ecf4;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-tm-ui="dark"] .table {
    color: #dfe6f1;
    --bs-table-bg: rgba(20, 26, 36, 0.35);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
    --bs-table-hover-bg: rgba(93, 173, 226, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-tm-ui="dark"] .table > :not(caption) > * > * {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: inherit;
}
html[data-tm-ui="dark"] .modal-content {
    background: linear-gradient(165deg, #1e2636 0%, #161d2a 100%);
    color: var(--text-color);
    border: 1px solid rgba(212, 168, 75, 0.22);
}
html[data-tm-ui="dark"] .modal-header,
html[data-tm-ui="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-tm-ui="dark"] .list-group-item {
    background: rgba(22, 28, 40, 0.95);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-tm-ui="dark"] .alert {
    background: rgba(30, 38, 52, 0.92);
    color: var(--text-color);
    border-color: rgba(212, 168, 75, 0.25);
}
html[data-tm-ui="dark"] code {
    background: rgba(0, 0, 0, 0.35);
    color: #f0c674;
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
html[data-tm-ui="dark"] .tm-mini-stats .text-muted,
html[data-tm-ui="dark"] .tm-radar-title {
    color: var(--text-light) !important;
}
html[data-tm-ui="dark"] .tm-radar-placeholder {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .tm-char-title {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .tm-camp-meta,
html[data-tm-ui="dark"] .tm-camp-meta #tmCampProfileName {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .tm-camp-meta #tmCampProfileQuote {
    color: var(--text-light) !important;
}
html[data-tm-ui="dark"] .float-ai-nav-text .float-ai-sub {
    color: rgba(255, 255, 255, 0.85);
}

html[data-tm-ui="dark"] .year-cycle-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: rgba(93, 173, 226, 0.28);
}
html[data-tm-ui="dark"] .year-cycle-block.future {
    background: rgba(255, 255, 255, 0.12);
}
html[data-tm-ui="dark"] .countdown-card {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.12) 0%, rgba(220, 20, 60, 0.1) 100%);
    border-color: rgba(236, 72, 102, 0.35);
}
html[data-tm-ui="dark"] .ai-assistant-float {
    border: 1px solid rgba(212, 168, 75, 0.2);
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.55);
}
html[data-tm-ui="dark"] .ai-assistant-body .message.assistant .message-content {
    background: rgba(32, 40, 54, 0.96);
    color: #e8ecf4;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-tm-ui="dark"] .ai-assistant-body .chat-input {
    background: rgba(16, 22, 32, 0.92);
    color: #e8ecf4;
    border-color: rgba(212, 168, 75, 0.22);
}
html[data-tm-ui="dark"] .ai-assistant-body .chat-input::placeholder {
    color: #7d8fa3;
}

html[data-tm-ui="dark"] .card-header,
html[data-tm-ui="dark"] .card-footer {
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.08);
}

/* 暗黑营地：侧栏品牌字、页眉小字、KPI 副标、各业务页硬编码色 */
html[data-tm-ui="dark"] .sidebar-logo,
html[data-tm-ui="dark"] .sidebar-logo .sidebar-nav-main,
html[data-tm-ui="dark"] .mobile-logo .sidebar-nav-main {
    color: #e8f2fc !important;
}
html[data-tm-ui="dark"] .sidebar-logo .sidebar-nav-main,
html[data-tm-ui="dark"] .mobile-logo .sidebar-nav-main {
    background: linear-gradient(135deg, #dce8f8 0%, #93c5e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}
html[data-tm-ui="dark"] .sidebar-logo .sidebar-nav-sub,
html[data-tm-ui="dark"] .mobile-logo .sidebar-nav-sub {
    color: #b4c4dc !important;
}
html[data-tm-ui="dark"] .sidebar-nav-item a .sidebar-nav-sub {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .content-subtitle {
    color: #b4c4dc !important;
}
html[data-tm-ui="dark"] .tm-heading-gaming .tm-heading-sub {
    color: #c9b896 !important;
}
html[data-tm-ui="dark"] .tm-sidebar-xp-line {
    color: #c5d2e8 !important;
    font-size: 12px;
}
html[data-tm-ui="dark"] .stats-grid .kpi-card .kpi-label .tm-kpi-sub {
    color: #a8bdd4 !important;
    opacity: 1;
}
html[data-tm-ui="dark"] .kpi-card .kpi-label {
    color: rgba(255, 255, 255, 0.94) !important;
}
html[data-tm-ui="dark"] .kpi-card .kpi-label .tm-kpi-sub {
    color: #b0c4d9 !important;
    opacity: 1;
}
html[data-tm-ui="dark"] .tm-mini-stats-inner .tm-stat-cell .text-muted {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .tm-mini-stats-inner .tm-kpi-sub {
    color: #9eb4cc !important;
    opacity: 1;
}
html[data-tm-ui="dark"] .tm-camp-meta #tmCampProfileQuote {
    color: #c5d4e8 !important;
}

html[data-tm-ui="dark"] .todo-item-meta {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .todo-item.completed {
    opacity: 0.92;
}
html[data-tm-ui="dark"] .todo-item.completed .todo-content h4 {
    color: #aabecf !important;
}
html[data-tm-ui="dark"] .todo-item.completed .todo-item-meta {
    color: #8fa4bd !important;
}
html[data-tm-ui="dark"] .btn-outline-primary {
    color: #7ec8eb;
    border-color: rgba(93, 173, 226, 0.55);
}
html[data-tm-ui="dark"] .btn-outline-primary:hover {
    color: #0f1419;
    background: #7ec8eb;
    border-color: #7ec8eb;
}

html[data-tm-ui="dark"] .goal-detail-content {
    color: #dce5f2 !important;
}
html[data-tm-ui="dark"] .goal-detail-empty {
    color: #a8b4c8 !important;
}
html[data-tm-ui="dark"] .progress-label,
html[data-tm-ui="dark"] .checkin-text {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .progress-value {
    color: #f8a5b8 !important;
}
html[data-tm-ui="dark"] .goal-progress-bar {
    background: rgba(255, 255, 255, 0.1);
}
html[data-tm-ui="dark"] .checkin-section {
    border-top-color: rgba(255, 255, 255, 0.1);
}
html[data-tm-ui="dark"] .checkin-dot:not(.filled) {
    background: rgba(255, 255, 255, 0.15);
}

html[data-tm-ui="dark"] .inspiration-content {
    color: #dce5f2 !important;
}
html[data-tm-ui="dark"] .inspiration-time {
    color: #b0c0d4 !important;
}
html[data-tm-ui="dark"] .inspiration-tag-empty {
    color: #a8b4c8 !important;
}
html[data-tm-ui="dark"] .inspiration-card-body::before {
    color: rgba(147, 197, 253, 0.16);
}
html[data-tm-ui="dark"] .inspiration-actions .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #c9d4e4 !important;
}
html[data-tm-ui="dark"] .inspiration-actions .btn-outline-primary {
    border-color: rgba(93, 173, 226, 0.55) !important;
    color: #7ec8eb !important;
}
html[data-tm-ui="dark"] .current-tag {
    background: rgba(255, 255, 255, 0.1);
    color: #e8ecf4;
}
html[data-tm-ui="dark"] .inspiration-empty {
    color: #b0c0d4 !important;
}

html[data-tm-ui="dark"] .ach-card .fw-bold {
    color: #eef3fa;
}
html[data-tm-ui="dark"] .ach-card .text-muted.small {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .ach-card .small {
    color: #c5d4e8 !important;
}
html[data-tm-ui="dark"] .ach-card .text-success {
    color: #6ee7b7 !important;
}

html[data-tm-ui="dark"] .goal-title {
    color: #eef3fa !important;
}
html[data-tm-ui="dark"] .goal-meta,
html[data-tm-ui="dark"] .goal-meta-item {
    color: #b8c9de !important;
}
html[data-tm-ui="dark"] .goal-card.completed .goal-title {
    color: #aabecf !important;
}
html[data-tm-ui="dark"] .goal-detail {
    background: linear-gradient(to right, rgba(245, 87, 108, 0.12), rgba(240, 147, 251, 0.1));
}

html[data-tm-ui="dark"] .todo-item.todo-xp-flash {
    animation: tmXpFlashDark 0.48s ease-out 1;
}

@keyframes tmXpFlashDark {
    0% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.45); }
    100% { box-shadow: 0 0 0 14px rgba(52, 152, 219, 0); }
}

/* 历练手记 / 商会账本 / 线索藏馆 · 暗黑主题列表可读性 */
html[data-tm-ui="dark"] .time-item,
html[data-tm-ui="dark"] .expense-item {
    border: 1px solid rgba(255, 255, 255, 0.06);
}
html[data-tm-ui="dark"] .time-content h4,
html[data-tm-ui="dark"] .expense-content h4 {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .time-item .btn-outline-primary,
html[data-tm-ui="dark"] .expense-item .btn-outline-primary,
html[data-tm-ui="dark"] .inspiration-card .btn-outline-primary {
    color: #7ebfe8;
    border-color: rgba(93, 173, 226, 0.55);
    background: rgba(93, 173, 226, 0.08);
}
html[data-tm-ui="dark"] .time-item .btn-outline-primary:hover,
html[data-tm-ui="dark"] .expense-item .btn-outline-primary:hover,
html[data-tm-ui="dark"] .inspiration-card .btn-outline-primary:hover {
    color: #fff;
    background: rgba(93, 173, 226, 0.35);
    border-color: #7ebfe8;
}
html[data-tm-ui="dark"] .inspiration-content {
    color: var(--text-color);
}
html[data-tm-ui="dark"] .inspiration-time {
    color: var(--text-light);
}
html[data-tm-ui="dark"] .tag-filter-item {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-tm-ui="dark"] .tag-filter-item.active {
    color: #fff;
}
html[data-tm-ui="dark"] .no-data {
    color: var(--text-light);
}
html[data-tm-ui="dark"] .highlight-keyword {
    color: #f0f4f8;
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.35) 0%, rgba(165, 105, 189, 0.35) 100%);
}

.tm-xp-toast-root {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.tm-xp-toast {
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(30, 58, 95, 0.92);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: min(360px, calc(100vw - 32px));
}
.tm-xp-toast.level-up {
    background: linear-gradient(135deg, #b8860b, #d4a84b);
    color: #2c1810;
}
.tm-xp-toast.tm-crystal-toast {
    background: linear-gradient(135deg, #1e3a5f, #2e86ab);
    border: 1px solid rgba(244, 196, 48, 0.45);
}
.tm-xp-toast.tm-toast-success {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}
.tm-xp-toast.tm-toast-error {
    background: linear-gradient(135deg, #b71c1c, #e53935);
}
.tm-xp-toast.tm-toast-info {
    background: rgba(30, 58, 95, 0.92);
}
@keyframes tmXpToastIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== 原生日期/时间：右侧图标清晰、可点击，且不撑高同行输入框 ========== */
.main-content input[type="datetime-local"],
.main-content input[type="date"],
.main-content input[type="time"],
.modal input[type="datetime-local"],
.modal input[type="date"],
.modal input[type="time"],
.dr-record-date-wrap input[type="date"],
.dr-ref-date-wrap input[type="date"] {
    padding-right: 0.65rem;
    color-scheme: light;
}

html[data-tm-ui="dark"] .main-content input[type="datetime-local"],
html[data-tm-ui="dark"] .main-content input[type="date"],
html[data-tm-ui="dark"] .main-content input[type="time"],
html[data-tm-ui="dark"] .modal input[type="datetime-local"],
html[data-tm-ui="dark"] .modal input[type="date"],
html[data-tm-ui="dark"] .modal input[type="time"],
html[data-tm-ui="dark"] .dr-record-date-wrap input[type="date"],
html[data-tm-ui="dark"] .dr-ref-date-wrap input[type="date"] {
    color-scheme: dark;
}

.main-content input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.main-content input[type="date"]::-webkit-calendar-picker-indicator,
.main-content input[type="time"]::-webkit-calendar-picker-indicator,
.modal input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.modal input[type="date"]::-webkit-calendar-picker-indicator,
.modal input[type="time"]::-webkit-calendar-picker-indicator,
.dr-record-date-wrap input[type="date"]::-webkit-calendar-picker-indicator,
.dr-ref-date-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0 0.35rem 0 0.1rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
    background-image: var(--tm-datetime-icon);
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    -webkit-appearance: none;
    appearance: none;
}

.main-content input[type="datetime-local"]::-moz-calendar-picker-indicator,
.main-content input[type="date"]::-moz-calendar-picker-indicator,
.main-content input[type="time"]::-moz-calendar-picker-indicator,
.modal input[type="datetime-local"]::-moz-calendar-picker-indicator,
.modal input[type="date"]::-moz-calendar-picker-indicator,
.modal input[type="time"]::-moz-calendar-picker-indicator,
.dr-record-date-wrap input[type="date"]::-moz-calendar-picker-indicator,
.dr-ref-date-wrap input[type="date"]::-moz-calendar-picker-indicator {
    width: 16px;
    height: 16px;
    margin: 0 0.35rem 0 0.1rem;
    padding: 0;
    cursor: pointer;
    opacity: 0.95;
}

html[data-tm-ui="dark"] .main-content input[type="datetime-local"]::-moz-calendar-picker-indicator,
html[data-tm-ui="dark"] .main-content input[type="date"]::-moz-calendar-picker-indicator,
html[data-tm-ui="dark"] .main-content input[type="time"]::-moz-calendar-picker-indicator,
html[data-tm-ui="dark"] .modal input[type="datetime-local"]::-moz-calendar-picker-indicator,
html[data-tm-ui="dark"] .modal input[type="date"]::-moz-calendar-picker-indicator,
html[data-tm-ui="dark"] .modal input[type="time"]::-moz-calendar-picker-indicator {
    filter: invert(1) brightness(1.15);
}

/* ========== 右侧辅助栏 ========== */
.main-wrapper {
    display: flex;
}
.sidebar {
    order: 1;
    flex-shrink: 0;
}
.main-content {
    order: 2;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}
.tm-right-sidebar {
    order: 3;
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    min-height: 0;
}
.tm-rs-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}
.tm-rs-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--text-light);
}
.tm-rs-wallet {
    font-weight: 700;
    color: #d4a017;
    font-size: 14px;
}
.tm-rs-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}
.tm-rs-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tm-rs-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tm-rs-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}
.tm-rs-panel {
    display: none;
}
.tm-rs-panel.active {
    display: block;
}
.tm-rs-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin: 12px 0 6px;
}
.tm-rs-section-title:first-child {
    margin-top: 0;
}
.tm-rs-card {
    background: rgba(102, 126, 234, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 8px;
}
.tm-rs-muted {
    color: var(--text-light);
    font-size: 12px;
}
.tm-rs-list-item {
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.tm-rs-link-btn {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.tm-rs-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 6px 0 4px;
}
.tm-rs-progress > div {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
}
.tm-rs-focus-display {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
    margin: 16px 0;
    color: var(--primary-color);
}
.tm-rs-focus-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.tm-rs-chat-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tm-rs-expand-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11990;
    background: rgba(0, 0, 0, 0.48);
}
.tm-rs-expand-scrim.active {
    display: block;
}
@media (min-width: 1101px) {
    body.tm-rs-chat-expanded .tm-right-sidebar {
        position: fixed;
        z-index: 12000;
        top: 20px;
        right: 20px;
        bottom: 20px;
        width: min(920px, calc(100vw - 40px));
        max-width: none;
        height: auto;
        border-radius: 16px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
        border: 1px solid rgba(214, 158, 46, 0.22);
    }
    body.tm-rs-chat-expanded .tm-rs-body {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.tm-rs-chat-expanded .tm-rs-panel.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    body.tm-rs-chat-expanded .tm-rs-chat-messages {
        flex: 1 1 auto;
        height: auto;
        max-height: none;
        min-height: 0;
    }
    body.tm-rs-chat-expanded .tm-rs-panel[data-panel="chat"] .tm-camp-ai-controls,
    body.tm-rs-chat-expanded .tm-rs-panel[data-panel="chat"] > .d-flex,
    body.tm-rs-chat-expanded .tm-rs-panel[data-panel="chat"] .tm-rs-chat-input-row,
    body.tm-rs-chat-expanded .tm-rs-panel[data-panel="chat"] .tm-goal-forge-dock {
        flex-shrink: 0;
    }
}
@media (max-width: 1100px) {
    .tm-rs-chat-expand-btn {
        display: none;
    }
}
.tm-rs-panel[data-panel="chat"] .tm-camp-ai-controls,
.tm-rs-panel[data-panel="chat"] .tm-goal-forge-dock {
    flex-shrink: 0;
}
.tm-rs-chat-messages {
    max-height: min(55vh, 520px);
    overflow-y: auto;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.55;
    -webkit-overflow-scrolling: touch;
}
.tm-rs-chat-msg {
    padding: 8px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    max-width: 98%;
    word-break: break-word;
}
.tm-rs-chat-msg--user {
    background: rgba(102, 126, 234, 0.15);
    margin-left: auto;
    white-space: pre-wrap;
}
.tm-rs-chat-msg--assistant {
    background: rgba(0, 0, 0, 0.05);
}
.tm-rs-chat-msg .tm-ai-msg-p {
    margin: 0 0 0.55em;
}
.tm-rs-chat-msg .tm-ai-msg-p:last-child {
    margin-bottom: 0;
}
.tm-rs-chat-msg .tm-ai-msg-heading {
    font-weight: 700;
    color: var(--primary-color, #2e86ab);
    margin: 0.55em 0 0.3em;
    font-size: 12.5px;
}
.tm-rs-chat-msg .tm-ai-msg-heading:first-child {
    margin-top: 0;
}
.tm-rs-chat-msg .tm-ai-msg-heading-inline {
    font-weight: 700;
    color: var(--primary-color, #2e86ab);
}
.tm-rs-chat-msg .tm-ai-msg-list {
    margin: 0.2em 0 0.55em;
    padding-left: 1.15em;
}
.tm-rs-chat-msg .tm-ai-msg-list li {
    margin: 0.2em 0;
}
.tm-rs-chat-msg .tm-ai-msg-list:last-child,
.tm-rs-chat-msg .tm-ai-msg-heading:last-child {
    margin-bottom: 0;
}
.tm-rs-chat-input-row {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: flex-end;
}
.tm-rs-chat-input-row .tm-camp-ai-input {
    flex: 1 1 auto;
    min-width: 0;
}
.tm-rs-inspiration-form {
    margin-bottom: 4px;
}
.tm-rs-inspiration-input {
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    min-height: 52px;
    max-height: 120px;
}
.tm-rs-inspiration-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-rs-inspiration-item {
    background: rgba(102, 126, 234, 0.06);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
}
.tm-rs-inspiration-content {
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}
.tm-rs-inspiration-tags {
    margin-top: 4px;
}
.tm-rs-inspiration-tags .badge {
    font-size: 10px;
    font-weight: 500;
}
.tm-rs-inspiration-meta {
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-light);
}
body.tm-rs-collapsed .tm-right-sidebar {
    width: 36px;
    overflow: hidden;
}
body.tm-rs-collapsed .tm-rs-tabs,
body.tm-rs-collapsed .tm-rs-body,
body.tm-rs-collapsed .tm-rs-wallet {
    display: none;
}
body.tm-rs-chat-open .float-ai-assistant,
body.is-focus-overlay .float-ai-assistant {
    display: none !important;
}
body:has(#tmRightSidebar) .float-ai-assistant {
    display: none !important;
}
.tm-rs-focus-source {
    font-size: 11px;
    color: var(--tm-muted, #6c757d);
}
.tm-rs-kr-row { margin-bottom: 6px; }
.tm-rs-kr-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 2px;
    gap: 6px;
}
.tm-rs-kr-label span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-rs-mobile-bar {
    display: none;
}
.tm-rs-drawer-backdrop {
    display: none;
}
@media (max-width: 1100px) {
    .tm-rs-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1035;
        background: var(--card-background);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    }
    .tm-rs-mobile-tab {
        flex: 1;
        border: none;
        background: transparent;
        padding: 6px 2px;
        font-size: 9px;
        color: var(--text-light);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 0;
    }
    .tm-rs-mobile-tab span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    .tm-rs-mobile-tab i { font-size: 16px; }
    .tm-rs-mobile-tab.active {
        color: var(--primary-color);
        font-weight: 700;
    }
    /* 窄屏底部 Tab 常驻：主内容区与悬浮控件统一避让 */
    body.tm-rs-mobile-layout .main-content,
    body:has(#tmRightSidebar) .main-content {
        padding-bottom: calc(20px + var(--tm-mobile-bar-offset));
        scroll-padding-bottom: calc(20px + var(--tm-mobile-bar-offset));
    }
    body.tm-rs-mobile-layout .main-wrapper,
    body:has(#tmRightSidebar) .main-wrapper {
        min-height: calc(100dvh - 16px);
        height: auto;
        max-height: none;
    }
    body.tm-rs-mobile-layout .float-ai-assistant,
    body:has(#tmRightSidebar) .float-ai-assistant {
        bottom: calc(8px + var(--tm-mobile-bar-offset)) !important;
        top: auto;
        transform: none;
    }
    body.tm-rs-mobile-layout .reminder-box,
    body:has(#tmRightSidebar) .reminder-box {
        bottom: calc(12px + var(--tm-mobile-bar-offset));
    }
    body.tm-rs-mobile-layout .tm-focus-distraction-fab,
    body:has(#tmRightSidebar) .tm-focus-distraction-fab {
        bottom: calc(16px + var(--tm-mobile-bar-offset));
    }
    body.tm-rs-mobile-layout .back-to-top,
    body:has(#tmRightSidebar) .back-to-top {
        bottom: calc(16px + var(--tm-mobile-bar-offset));
    }
    .tm-rs-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1038;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .tm-rs-drawer-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
    .tm-right-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-height: min(92vh, 860px);
        height: min(92vh, 860px);
        z-index: 1040;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
        /* iOS Safari / 夸克：translateY 移出视口后仍可能吃掉点击，关闭时必须禁用命中 */
        pointer-events: none;
    }
    .tm-right-sidebar.tm-rs-drawer-open {
        transform: translateY(0);
        pointer-events: auto;
    }
    body.tm-rs-collapsed .tm-right-sidebar {
        width: 100%;
    }
    .tm-rs-drawer-close {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: transparent;
        color: var(--text-light);
        cursor: pointer;
        margin-right: auto;
    }
    .tm-rs-toggle { display: none; }

    /* 灵感 / 对话：手机端主内容区拉高，对话气泡可占满抽屉剩余高度 */
    .tm-right-sidebar {
        --tm-rs-mobile-main-height: 260px;
    }
    .tm-rs-body {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .tm-rs-panel.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    .tm-rs-inspiration-input {
        min-height: var(--tm-rs-mobile-main-height);
        height: var(--tm-rs-mobile-main-height);
        max-height: 320px;
        font-size: 14px;
        padding: 12px;
        line-height: 1.55;
    }
    .tm-rs-panel[data-panel="inspiration"] .tm-rs-inspiration-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    .tm-rs-panel[data-panel="chat"] {
        overflow: hidden;
    }
    .tm-rs-panel[data-panel="chat"] .tm-rs-chat-messages {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        max-height: none;
        font-size: 14px;
        line-height: 1.6;
    }
}
/* 顶栏头像 → 设置 */
.tm-topbar-avatar-wrap {
    position: fixed;
    top: 14px;
    right: calc(280px + 20px);
    z-index: 1020;
}
body.tm-rs-collapsed .tm-topbar-avatar-wrap {
    right: calc(36px + 20px);
}
@media (max-width: 1100px) {
    .tm-topbar-avatar-wrap {
        top: auto;
        bottom: calc(var(--tm-mobile-bar-height) + 8px + env(safe-area-inset-bottom, 0px));
        right: 14px;
    }
    body.tm-rs-mobile-open .tm-topbar-avatar-wrap {
        bottom: calc(var(--tm-mobile-bar-height) + 84px + env(safe-area-inset-bottom, 0px));
    }
}
.tm-topbar-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.35);
    background: var(--card-background);
    box-shadow: var(--shadow);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 15px;
}
.tm-topbar-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tm-topbar-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
    overflow: hidden;
    z-index: 1060;
}
.tm-topbar-menu.open { display: block; }
.tm-topbar-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
}
.tm-topbar-menu a:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary-color);
}
@media (max-width: 1100px) {
    .tm-topbar-menu {
        bottom: calc(100% + 8px);
        top: auto;
    }
}

.tm-blueprint-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(46, 134, 171, 0.14);
    color: #2e86ab;
    margin-left: 4px;
    vertical-align: middle;
}

/* ========== Bootstrap 弹窗层级（全站） ========== */
/* 须高于 AI 悬浮(9999~10000)、提醒(10001)；.modal 必须高于 .modal-backdrop，否则无法编辑 */
body.modal-open .modal.show {
    z-index: 10200;
}
body.modal-open .modal-backdrop.show {
    z-index: 10190;
}
