/* =============================================
   时间管理 - time_management.css
   主题色：橙金色系，体现时间感与效率感
   布局：三栏结构（历史 / 任务输入 / 规划结果）
   ============================================= */

/* ========== 主容器 ========== */
.tm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdfaf5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.tm-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.tm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #c2410c 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35);
    flex-shrink: 0;
}

.tm-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.tm-toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #c2410c;
    transition: all 0.2s;
    white-space: nowrap;
}

.tm-toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.tm-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.tm-toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮（生成规划） */
.tm-toolbar-btn-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.4);
}

.tm-toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.5);
    color: #fff;
}

/* 取消按钮（保持工具栏白色背景，红色文字明确标识危险操作） */
.tm-toolbar-btn-cancel {
    background: rgba(255, 255, 255, 0.92);
    color: #ef4444;
    font-weight: 600;
}

.tm-toolbar-btn-cancel:hover:not(:disabled) {
    background: #fff;
    color: #dc2626;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.2);
}

/* ========== 主内容区：三栏 ========== */
.tm-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdfaf5;
}

/* ========== 左栏：历史记录 ========== */
.tm-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fed7aa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fff7ed 0%, #ffedd5 100%);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.tm-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #9a3412;
}

.tm-history-count {
    font-size: 11px;
    color: #fb923c;
    font-weight: 400;
}

.tm-history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.tm-history-clear-btn:hover {
    background: #fde8e8;
}

.tm-history-search {
    padding: 8px;
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.tm-history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fffbf5;
}

.tm-history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
}

.tm-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.tm-history-list::-webkit-scrollbar { width: 4px; }
.tm-history-list::-webkit-scrollbar-track { background: transparent; }
.tm-history-list:hover::-webkit-scrollbar-track { background: #fff7ed; }
.tm-history-list::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.tm-history-list::-webkit-scrollbar-thumb:hover { background: #f97316; }

.tm-history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
}

.tm-history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #fffbf5;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: tmHiFadeIn 0.2s ease;
}

@keyframes tmHiFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.tm-history-item:hover {
    background: #fff7ed;
    border-color: #fb923c;
    transform: translateX(2px);
}

.tm-history-item.active {
    background: #ffedd5;
    border-color: #f97316;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.tm-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 18px;
}

.tm-history-item-meta {
    font-size: 11px;
    color: #fb923c;
    margin-top: 2px;
}

.tm-history-item-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.tm-history-item-del {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.tm-history-item:hover .tm-history-item-del {
    opacity: 1;
}

.tm-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

/* ========== 中栏：任务输入 ========== */
.tm-input-panel {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-panel-header {
    padding: 12px 16px 10px;
    background: linear-gradient(to bottom, #fffbf5 0%, #fff7ed 100%);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.tm-panel-header h3 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.tm-panel-tip {
    font-size: 11px;
    color: #b0b8c9;
}

/* 结果面板头部：标题与元信息并排显示 */
.tm-result-panel .tm-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
}

.tm-result-panel .tm-panel-header h3 {
    margin: 0;
}

.tm-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.tm-input-body::-webkit-scrollbar { width: 4px; }
.tm-input-body::-webkit-scrollbar-track { background: transparent; }
.tm-input-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.tm-input-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 区块 */
.tm-section {
    margin-bottom: 16px;
    background: #fffbf5;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 12px;
}

.tm-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #9a3412;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tm-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tm-task-stats {
    font-size: 11px;
    color: #f97316;
    font-weight: 500;
}

.tm-form-row {
    display: flex;
    gap: 10px;
}

.tm-form-group {
    margin-bottom: 8px;
}

.tm-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #78350f;
    margin-bottom: 4px;
}

.tm-form-group-half {
    flex: 1;
    min-width: 0;
}

.tm-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #1e293b;
}

.tm-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
}

.tm-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.tm-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
}

.tm-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    resize: vertical;
    background: #fff;
    color: #1e293b;
    font-family: inherit;
}

.tm-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
}

/* ---- 任务列表 ---- */
.tm-task-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.tm-task-list::-webkit-scrollbar { width: 4px; }
.tm-task-list::-webkit-scrollbar-track { background: transparent; }
.tm-task-list:hover::-webkit-scrollbar-track { background: #fff7ed; }
.tm-task-list::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.tm-task-list::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 任务列表空状提示 */
.tm-task-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    padding: 14px 0 10px;
    font-style: italic;
    user-select: none;
}

.tm-task-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    animation: tmTaskIn 0.2s ease;
    position: relative;
}

@keyframes tmTaskIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tm-task-item:hover {
    border-color: #fb923c;
    background: #fff7ed;
}

/* 拖拽排序状态 */
.tm-task-item.tm-task-dragging {
    opacity: 0.42;
    border-style: dashed;
    cursor: grabbing;
}

.tm-task-item.tm-task-drag-over {
    border-top: 2px solid #f97316;
    background: #fff7ed;
}

.tm-task-drag-handle {
    color: #d1d5db;
    cursor: grab;
    font-size: 14px;
    flex-shrink: 0;
    user-select: none;
}

.tm-task-drag-handle:active {
    cursor: grabbing;
    color: #f97316;
}

.tm-task-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tm-task-priority-dot.high   { background: #ef4444; }
.tm-task-priority-dot.medium { background: #f59e0b; }
.tm-task-priority-dot.low    { background: #22c55e; }

.tm-task-name {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-task-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #ffedd5;
    color: #9a3412;
    white-space: nowrap;
    flex-shrink: 0;
}

.tm-task-minutes {
    font-size: 11px;
    color: #6b7280;
    flex-shrink: 0;
    white-space: nowrap;
}

.tm-task-del {
    width: 20px;
    height: 20px;
    background: transparent;
    color: #d1d5db;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-task-item:hover .tm-task-del {
    color: #ef4444;
}

.tm-task-del:hover {
    background: #fde8e8;
}

/* ---- 添加任务行 ---- */
.tm-add-task-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.tm-add-task-name {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    padding: 6px 10px;
}

.tm-add-task-min {
    width: 68px;
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 8px;
}

.tm-add-task-pri {
    width: 72px;
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 6px;
}

.tm-add-task-cat {
    width: 82px;
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 6px;
}

.tm-add-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tm-add-btn:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(249, 115, 22, 0.3);
}

/* ---- 抖动动画 ---- */
@keyframes tmShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.tm-input.shake, .tm-select.shake, .tm-textarea.shake {
    animation: tmShake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.tm-add-btn.shake {
    animation: tmShake 0.5s ease-in-out;
}

/* ========== 右栏：规划结果 ========== */
.tm-result-panel {
    flex: 1.2;
    min-width: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tm-result-style {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #ffedd5;
    color: #9a3412;
    font-weight: 500;
}

.tm-result-time {
    font-size: 11px;
    color: #9ca3af;
}

.tm-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

.tm-result-body::-webkit-scrollbar { width: 5px; }
.tm-result-body::-webkit-scrollbar-track { background: #fdfaf5; }
.tm-result-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 3px; }
.tm-result-body::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 占位区域 */
.tm-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 24px;
}

/* 时钟动画 */
.tm-placeholder-clock {
    margin-bottom: 20px;
}

.clock-face {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #fed7aa;
    background: #fffbf5;
    position: relative;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 3px;
    background: #f97316;
}

.clock-hour {
    width: 3px;
    height: 20px;
    margin-left: -1.5px;
    animation: tmClockHour 43200s linear infinite;
}

.clock-minute {
    width: 2px;
    height: 26px;
    margin-left: -1px;
    background: #ea580c;
    animation: tmClockMinute 3600s linear infinite;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #c2410c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@keyframes tmClockHour {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes tmClockMinute {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.tm-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #78350f;
    margin: 0 0 8px;
}

.tm-placeholder-desc {
    font-size: 12px;
    color: #9ca3af;
    margin: 2px 0;
}

/* 加载状态 */
.tm-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 24px;
}

.tm-loading-hourglass {
    font-size: 36px;
    animation: tmHourglassSpin 1.5s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes tmHourglassSpin {
    0%   { transform: rotate(0deg); }
    45%  { transform: rotate(0deg); }
    55%  { transform: rotate(180deg); }
    100% { transform: rotate(180deg); }
}

.tm-loading-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.tm-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    animation: tmDotBounce 1.2s ease-in-out infinite;
}

.tm-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.tm-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tmDotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.1); opacity: 1;   }
}

.tm-loading-text {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* 结果内容 */
.tm-result-content {
    font-size: 13.5px;
    line-height: 1.85;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 结果淡入动画类（独立定义，由JS动态添加，禁止在基础类中硬编码） */
.tm-result-enter {
    animation: tmResultFadeIn 0.35s ease-out forwards;
}

@keyframes tmResultFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tm-result-content strong { font-weight: 600; color: #92400e; }
.tm-result-content em { font-style: italic; color: #9a3412; }
.tm-result-content li::marker { color: #f97316; }

.tm-result-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #78350f;
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #fed7aa;
}

.tm-result-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    margin: 10px 0 4px;
}

.tm-result-content ul,
.tm-result-content ol {
    padding-left: 20px;
    margin: 6px 0;
}

.tm-result-content li {
    margin-bottom: 3px;
}

.tm-result-content pre {
    background: #f8f4ec;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    padding: 10px 14px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
}

.tm-result-content code {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
}

.tm-result-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.tm-result-content blockquote {
    border-left: 3px solid #f97316;
    margin: 8px 0;
    padding: 6px 14px;
    background: #fff7ed;
    color: #78350f;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

/* 错误状态 */
.tm-result-content.tm-result-content--error {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: normal;
}

.tm-result-error-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: #fff5f5;
    border-left: 4px solid #ef4444;
    border-radius: 0 6px 6px 0;
    margin: 4px 0;
}

.tm-result-error-icon {
    flex-shrink: 0;
    font-size: 22px;
    color: #ef4444;
    line-height: 1.3;
}

.tm-result-error-body {
    flex: 1;
}

.tm-result-error-title {
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 4px;
}

.tm-result-error-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 10px;
}

.tm-result-error-retry-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.tm-result-error-retry-btn:hover {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* ========== 示例模态框 ========== */
.tm-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
    backdrop-filter: blur(2px);
}

.tm-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.tm-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.tm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    flex-shrink: 0;
}

.tm-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.tm-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tm-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.tm-modal-body {
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.tm-example-card {
    border: 1.5px solid #fed7aa;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fffbf5;
}

.tm-example-card:hover {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.tm-example-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.tm-example-card-title span:first-child {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.tm-example-card-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #ffedd5;
    color: #c2410c;
    flex-shrink: 0;
}

.tm-example-card-desc {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px;
    line-height: 1.5;
}

.tm-example-task-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
}

.tm-example-task-item {
    font-size: 11px;
    color: #9a3412;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tm-example-import-btn {
    width: 100%;
    padding: 6px 0;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tm-example-import-btn:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

/* ========== 暗黑模式 ========== */
body.dark .tm-container {
    background: #1a1a2e;
}

body.dark .tm-main-content {
    background: #1a1a2e;
}

body.dark .tm-toolbar {
    background: linear-gradient(135deg, #b45309 0%, #92400e 50%, #78350f 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .tm-toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fcd34d;
}

body.dark .tm-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
}

body.dark .tm-toolbar-btn-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
}

body.dark .tm-toolbar-btn-cancel {
    background: rgba(255, 255, 255, 0.12);
    color: #f87171;
    font-weight: 600;
}

body.dark .tm-toolbar-btn-cancel:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    color: #fca5a5;
}

body.dark .tm-history-panel {
    background: #16213e;
    border-right-color: #78350f;
}

body.dark .tm-history-header {
    background: linear-gradient(to bottom, #1e1e3a 0%, #16213e 100%);
    border-bottom-color: #78350f;
}

body.dark .tm-history-header h3 {
    color: #fcd34d;
}

body.dark .tm-history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark .tm-history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

body.dark .tm-history-search {
    border-bottom-color: #78350f;
}

body.dark .tm-history-search input {
    background: #1a1a2e;
    border-color: #78350f;
    color: #e2e8f0;
}

body.dark .tm-history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

body.dark .tm-history-item {
    background: #1e1e3a;
    border-color: #78350f;
}

body.dark .tm-history-item:hover {
    background: #252545;
    border-color: #f97316;
}

body.dark .tm-history-item.active {
    background: #2a1f0e;
    border-color: #f97316;
    box-shadow: inset 3px 0 0 #3b82f6;
}

body.dark .tm-history-item-title {
    color: #fcd34d;
}

body.dark .tm-history-item-meta {
    color: #fb923c;
}

body.dark .tm-history-item-time {
    color: #6b7280;
}

body.dark .tm-history-item-del {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark .tm-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

body.dark .tm-input-panel {
    background: #1e1e3a;
    border-right-color: #374151;
}

body.dark .tm-panel-header {
    background: linear-gradient(to bottom, #1e1e3a 0%, #252545 100%);
    border-bottom-color: #78350f;
}

body.dark .tm-panel-header h3 {
    color: #fcd34d;
}

body.dark .tm-panel-tip {
    color: #6b7280;
}

body.dark .tm-input-body {
    background: #1e1e3a;
}

body.dark .tm-section {
    background: #252545;
    border-color: #374151;
}

body.dark .tm-section-title {
    color: #fcd34d;
}

body.dark .tm-task-stats {
    color: #fb923c;
}

body.dark .tm-form-group label {
    color: #fbbf24;
}

body.dark .tm-input,
body.dark .tm-select,
body.dark .tm-textarea {
    background: #1a1a2e;
    border-color: #374151;
    color: #e2e8f0;
}

body.dark .tm-input:focus,
body.dark .tm-select:focus,
body.dark .tm-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

body.dark .tm-input::placeholder,
body.dark .tm-textarea::placeholder {
    color: #6b7280;
}

body.dark .tm-history-search input::placeholder {
    color: #6b7280;
}

/* 暗黑模式下时间选择器图标显示修正 */
body.dark input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) brightness(0.9);
    cursor: pointer;
}

body.dark .tm-task-item {
    background: #1a1a2e;
    border-color: #374151;
}

body.dark .tm-task-item:hover {
    background: #252545;
    border-color: #f97316;
}

body.dark .tm-task-item.tm-task-drag-over {
    background: #2a2540;
    border-top-color: #f97316;
}

body.dark .tm-task-empty {
    color: #6b7280;
}

body.dark .tm-task-name {
    color: #e2e8f0;
}

body.dark .tm-task-badge {
    background: #2a1f0e;
    color: #fcd34d;
}

body.dark .tm-task-minutes {
    color: #9ca3af;
}

body.dark .tm-task-del {
    color: #4b5563;
}

body.dark .tm-task-item:hover .tm-task-del {
    color: #f87171;
}

body.dark .tm-add-btn {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

body.dark .tm-result-panel {
    background: #1e1e3a;
}

body.dark .tm-result-panel .tm-panel-header {
    background: linear-gradient(to bottom, #1e1e3a 0%, #252545 100%);
    border-bottom-color: #78350f;
}

body.dark .tm-result-panel .tm-panel-header h3 {
    color: #fcd34d;
}

body.dark .tm-result-style {
    background: #2a1f0e;
    color: #fcd34d;
}

body.dark .tm-result-time {
    color: #6b7280;
}

body.dark .tm-result-body {
    background: #1e1e3a;
}

body.dark .tm-result-body::-webkit-scrollbar-track { background: #1e1e3a; }
body.dark .tm-history-list::-webkit-scrollbar-track { background: #16213e; }
body.dark .tm-input-body::-webkit-scrollbar-track { background: #1e1e3a; }
body.dark .tm-task-list::-webkit-scrollbar-track { background: #252545; }

body.dark .tm-placeholder {
    background: #1e1e3a;
}

body.dark .clock-face {
    border-color: #78350f;
    background: #252545;
}

body.dark .clock-hand,
body.dark .clock-minute {
    background: #f97316;
}

body.dark .clock-center {
    background: #fcd34d;
}

body.dark .tm-placeholder-title {
    color: #fcd34d;
}

body.dark .tm-placeholder-desc {
    color: #6b7280;
}

body.dark .tm-loading {
    background: #1e1e3a;
}

body.dark .tm-loading-text {
    color: #6b7280;
}

body.dark .tm-result-content {
    color: #e0e7ff;
}

body.dark .tm-result-content strong {
    color: #fcd34d;
}

body.dark .tm-result-content em {
    color: #fb923c;
}

body.dark .tm-result-content li::marker {
    color: #f97316;
}

body.dark .tm-result-content h3 {
    color: #fcd34d;
    border-bottom-color: #374151;
}

body.dark .tm-result-content h4 {
    color: #fb923c;
}

body.dark .tm-result-content pre {
    background: #1a1a2e;
    border-color: #374151;
    color: #e2e8f0;
}

body.dark .tm-result-content code {
    background: #2a1f0e;
    color: #fcd34d;
}

body.dark .tm-result-content blockquote {
    background: #252545;
    border-left-color: #f97316;
    color: #d1d5db;
}

body.dark .tm-result-error-block {
    background: #2d1515;
    border-left-color: #f87171;
}

body.dark .tm-result-error-icon { color: #f87171; }

body.dark .tm-result-error-title { color: #fca5a5; }

body.dark .tm-result-error-hint { color: #6b7280; }

body.dark .tm-result-error-retry-btn {
    background: #dc2626;
    color: #fff;
}

body.dark .tm-result-error-retry-btn:hover {
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

body.dark .tm-modal-content {
    background: #1e1e3a;
}

body.dark .tm-modal-body {
    background: #1e1e3a;
}

body.dark .tm-example-card {
    background: #252545;
    border-color: #374151;
}

body.dark .tm-example-card:hover {
    border-color: #f97316;
    background: #2a2540;
}

body.dark .tm-example-card-title span:first-child {
    color: #fcd34d;
}

body.dark .tm-example-card-badge {
    background: #2a1f0e;
    color: #fcd34d;
}

body.dark .tm-example-card-desc {
    color: #9ca3af;
}

body.dark .tm-example-task-item {
    color: #fb923c;
}

/* ========== 响应式适配 ========== */
@media (max-width: 900px) {
    .tm-history-panel {
        display: none;
    }
    .tm-add-task-cat {
        display: none;
    }
}

@media (max-width: 639px) {
    .tm-main-content {
        flex-direction: column;
    }
    .tm-input-panel, .tm-result-panel {
        flex: none;
        height: 50%;
    }
    .tm-add-task-pri {
        display: none;
    }
}
