/* ===================================================================
   激励大师 (Motivation Master) - 专属样式
   主题色：激励橙 #f97316 → 能量紫 #8b5cf6 → 热血红 #ef4444
   =================================================================== */

/* ---- CSS 变量 ---- */
:root {
    --mm-primary:       #f97316;
    --mm-primary-dark:  #ea580c;
    --mm-secondary:     #8b5cf6;
    --mm-accent:        #ef4444;
    --mm-gold:          #f59e0b;
    --mm-bg:            #fdf8f3;
    --mm-surface:       #ffffff;
    --mm-surface2:      #fef3e8;
    --mm-border:        #fed7aa;
    --mm-border2:       #fdba74;
    --mm-text:          #1c0a00;
    --mm-text2:         #431407;
    --mm-text-muted:    #9a3412;
    --mm-toolbar-bg:    linear-gradient(100deg, #1c0a00 0%, #431407 40%, #2d1b69 100%);
    --mm-toolbar-text:  #fff7ed;
    --mm-shadow:        0 2px 12px rgba(249, 115, 22, .1);
    --mm-shadow-md:     0 4px 24px rgba(249, 115, 22, .15);
    --mm-radius:        10px;
    --mm-radius-sm:     6px;
    --mm-toolbar-h:     52px;
    --mm-history-w:     220px;
    --mm-input-w:       350px;
}

/* 暗黑模式变量 */
body.dark {
    --mm-bg:        #1a0f08;
    --mm-surface:   #241508;
    --mm-surface2:  #1e1108;
    --mm-border:    #4a2010;
    --mm-border2:   #6b3015;
    --mm-text:      #fef3e2;
    --mm-text2:     #fed7aa;
    --mm-text-muted:#fb923c;
    --mm-shadow:    0 2px 12px rgba(0,0,0,.45);
    --mm-shadow-md: 0 4px 24px rgba(0,0,0,.55);
}

/* ===== 主容器 ===== */
.mm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px);
    min-height: 500px;
    background: var(--mm-bg);
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
    overflow: hidden;
    box-shadow: var(--mm-shadow-md);
    transition: background .25s, border-color .25s;
}

.mm-container.fullscreen-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    height: 100vh !important;
    border-radius: 0;
    border: none;
}

/* ===== 工具栏 ===== */
.mm-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: var(--mm-toolbar-h);
    background: var(--mm-toolbar-bg);
    color: var(--mm-toolbar-text);
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

/* 工具栏火焰渐变装饰条 */
.mm-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right,
        #ef4444, #f97316, #f59e0b, #f97316,
        #8b5cf6, #ec4899, #ef4444);
    background-size: 200% 100%;
    opacity: .9;
    animation: mmBarShimmer 4s ease-in-out infinite;
}

@keyframes mmBarShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--mm-primary);
    letter-spacing: .3px;
    white-space: nowrap;
    margin-right: 4px;
    text-shadow: 0 0 12px rgba(249,115,22,.5);
}

.mm-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 5px;
    background: rgba(255,255,255,.08);
    color: #fde8d0;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, border-color .18s, color .18s;
}
.mm-toolbar-btn:hover {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.mm-toolbar-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.mm-toolbar-btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249,115,22,.45);
}
.mm-toolbar-btn-primary:hover {
    background: linear-gradient(135deg, #fb923c, #f97316) !important;
    box-shadow: 0 4px 14px rgba(249,115,22,.6);
}
.mm-toolbar-btn-primary.mm-btn-loading {
    background: linear-gradient(90deg, #7c2d12, #ea580c, #7c2d12, #c2410c) !important;
    background-size: 300% 100% !important;
    animation: mmShimmer .8s infinite linear;
    box-shadow: none;
}

.mm-toolbar-btn-cancel {
    background: rgba(239,68,68,.18) !important;
    border-color: rgba(239,68,68,.35) !important;
    color: #fca5a5 !important;
}
.mm-toolbar-btn-cancel:hover {
    background: rgba(239,68,68,.32) !important;
}

@keyframes mmShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

body.dark .mm-toolbar-btn-primary.mm-btn-loading {
    background: linear-gradient(90deg, #7c2d12, #c2410c, #7c2d12, #9a3412) !important;
    background-size: 300% 100% !important;
    animation: mmShimmer .8s infinite linear;
}

/* ===== 主内容区 ===== */
.mm-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== 历史记录面板（左） ===== */
.mm-history-panel {
    width: var(--mm-history-w);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    background: var(--mm-surface2);
    border-right: 1px solid var(--mm-border);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.mm-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--mm-border);
    flex-shrink: 0;
}
.mm-history-header h3 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--mm-text2);
    white-space: nowrap;
}

.mm-history-count {
    font-size: 11px;
    color: var(--mm-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.mm-history-clear-btn {
    background: none;
    border: none;
    color: var(--mm-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .18s, background .18s;
    line-height: 1;
}
.mm-history-clear-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,.1);
}

.mm-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--mm-border);
    flex-shrink: 0;
}
.mm-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid var(--mm-border);
    border-radius: 5px;
    font-size: 12px;
    background: var(--mm-surface);
    color: var(--mm-text);
    outline: none;
    transition: border-color .18s;
    box-sizing: border-box;
}
.mm-history-search input:focus {
    border-color: var(--mm-primary);
}
body.dark .mm-history-search input {
    background: var(--mm-surface2);
}

.mm-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.mm-history-empty {
    text-align: center;
    color: var(--mm-text-muted);
    font-size: 12px;
    padding: 24px 8px;
    opacity: .7;
}

.mm-history-item {
    position: relative;
    padding: 10px 28px 10px 11px;
    border-radius: 7px;
    cursor: pointer;
    margin-bottom: 4px;
    border: 1px solid transparent;
    transition: background .18s, border-color .18s;
    background: var(--mm-surface);
}
.mm-history-item:hover {
    background: var(--mm-surface);
    border-color: var(--mm-border2);
}
.mm-history-item.active {
    background: rgba(249,115,22,.08);
    border-color: rgba(249,115,22,.35);
}
body.dark .mm-history-item {
    background: rgba(255,255,255,.04);
}
body.dark .mm-history-item:hover {
    background: rgba(255,255,255,.08);
}
body.dark .mm-history-item.active {
    background: rgba(249,115,22,.12);
}

.mm-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--mm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.mm-history-item-meta {
    font-size: 11px;
    color: var(--mm-text-muted);
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.mm-history-tag {
    background: rgba(249,115,22,.12);
    color: var(--mm-primary-dark);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10.5px;
    font-weight: 500;
}
body.dark .mm-history-tag {
    background: rgba(249,115,22,.2);
    color: #fb923c;
}

.mm-history-del-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--mm-text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity .18s, color .18s, background .18s;
}
.mm-history-item:hover .mm-history-del-btn {
    opacity: 1;
}
.mm-history-del-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,.1);
}

/* ===== 输入面板（中） ===== */
.mm-input-panel {
    width: var(--mm-input-w);
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--mm-border);
    background: var(--mm-surface);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.mm-panel-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--mm-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
}
.mm-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--mm-text);
    white-space: nowrap;
}
body.dark .mm-panel-header h3 {
    color: var(--mm-text);
}
.mm-panel-tip {
    font-size: 11px;
    color: var(--mm-text-muted);
    text-align: right;
}

.mm-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mm-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mm-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--mm-text2);
    display: flex;
    align-items: center;
    gap: 4px;
}
.mm-required {
    color: #ef4444;
    font-size: 13px;
}
.mm-optional {
    font-size: 11px;
    color: var(--mm-text-muted);
    font-weight: 400;
}

.mm-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--mm-border);
    border-radius: 7px;
    font-size: 13px;
    color: var(--mm-text);
    background: var(--mm-surface);
    resize: vertical;
    outline: none;
    line-height: 1.6;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
    font-family: inherit;
}
.mm-textarea:focus {
    border-color: var(--mm-primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
body.dark .mm-textarea {
    background: var(--mm-surface2);
    border-color: var(--mm-border);
    color: var(--mm-text);
}

.mm-char-counter {
    font-size: 11px;
    color: var(--mm-text-muted);
    text-align: right;
    margin-top: -4px;
}
.mm-char-counter.warn {
    color: #f59e0b;
}
.mm-char-counter.over {
    color: #ef4444;
    font-weight: 600;
}

.mm-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--mm-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--mm-text);
    background: var(--mm-surface);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
}
.mm-input:focus {
    border-color: var(--mm-primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
body.dark .mm-input {
    background: var(--mm-surface2);
    border-color: var(--mm-border);
    color: var(--mm-text);
}

/* ===== 激励类型网格 ===== */
.mm-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mm-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: 1.5px solid var(--mm-border);
    border-radius: 8px;
    background: var(--mm-surface);
    cursor: pointer;
    font-size: 11px;
    color: var(--mm-text2);
    transition: all .18s;
    white-space: nowrap;
}
.mm-type-btn .type-icon {
    font-size: 20px;
    line-height: 1;
}
.mm-type-btn .type-label {
    font-size: 10.5px;
    font-weight: 600;
}
.mm-type-btn:hover {
    border-color: var(--mm-primary);
    background: rgba(249,115,22,.06);
    color: var(--mm-primary-dark);
}
.mm-type-btn.selected {
    border-color: var(--mm-primary);
    background: rgba(249,115,22,.12);
    color: var(--mm-primary-dark);
    box-shadow: 0 0 0 2px rgba(249,115,22,.2);
}
body.dark .mm-type-btn {
    background: var(--mm-surface2);
    border-color: var(--mm-border);
    color: var(--mm-text);
}
body.dark .mm-type-btn:hover,
body.dark .mm-type-btn.selected {
    border-color: #fb923c;
    background: rgba(249,115,22,.15);
    color: #fb923c;
}

/* ===== 激励风格 ===== */
.mm-style-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mm-style-btn {
    padding: 5px 12px;
    border: 1.5px solid var(--mm-border);
    border-radius: 20px;
    background: var(--mm-surface);
    cursor: pointer;
    font-size: 12px;
    color: var(--mm-text2);
    white-space: nowrap;
    transition: all .18s;
    font-weight: 500;
}
.mm-style-btn:hover {
    border-color: var(--mm-secondary);
    background: rgba(139,92,246,.07);
    color: var(--mm-secondary);
}
.mm-style-btn.selected {
    border-color: var(--mm-secondary);
    background: rgba(139,92,246,.12);
    color: var(--mm-secondary);
    box-shadow: 0 0 0 2px rgba(139,92,246,.2);
}
body.dark .mm-style-btn {
    background: var(--mm-surface2);
    border-color: var(--mm-border);
    color: var(--mm-text);
}
body.dark .mm-style-btn:hover,
body.dark .mm-style-btn.selected {
    border-color: #a78bfa;
    background: rgba(139,92,246,.18);
    color: #a78bfa;
}

/* ===== 输出形式 ===== */
.mm-format-row {
    display: flex;
    gap: 6px;
}

.mm-format-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1.5px solid var(--mm-border);
    border-radius: 8px;
    background: var(--mm-surface);
    cursor: pointer;
    font-size: 12px;
    color: var(--mm-text2);
    text-align: center;
    transition: all .18s;
}
.mm-format-btn .format-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}
.mm-format-btn .format-label {
    font-weight: 600;
    display: block;
    font-size: 11.5px;
}
.mm-format-btn .format-desc {
    font-size: 10px;
    color: var(--mm-text-muted);
    display: block;
    margin-top: 1px;
}
.mm-format-btn:hover {
    border-color: var(--mm-gold);
    background: rgba(245,158,11,.07);
    color: #92400e;
}
.mm-format-btn.selected {
    border-color: var(--mm-gold);
    background: rgba(245,158,11,.12);
    color: #92400e;
    box-shadow: 0 0 0 2px rgba(245,158,11,.2);
}
body.dark .mm-format-btn {
    background: var(--mm-surface2);
    border-color: var(--mm-border);
    color: var(--mm-text);
}
body.dark .mm-format-btn:hover,
body.dark .mm-format-btn.selected {
    border-color: #fbbf24;
    background: rgba(245,158,11,.18);
    color: #fbbf24;
}
body.dark .mm-format-btn .format-desc {
    color: var(--mm-text-muted);
}

/* ===== 结果面板（右） ===== */
.mm-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--mm-surface);
    transition: background .25s;
    overflow: hidden;
}

.mm-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.mm-result-type-tag {
    background: rgba(249,115,22,.15);
    color: var(--mm-primary-dark);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
.mm-result-style-tag {
    background: rgba(139,92,246,.12);
    color: var(--mm-secondary);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
body.dark .mm-result-type-tag {
    background: rgba(249,115,22,.2);
    color: #fb923c;
}
body.dark .mm-result-style-tag {
    background: rgba(139,92,246,.2);
    color: #a78bfa;
}

.mm-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

/* ===== 占位区 ===== */
.mm-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 20px;
}

.mm-placeholder-flame {
    margin-bottom: 20px;
}
.flame-wrap {
    position: relative;
    width: 60px;
    height: 80px;
    margin: 0 auto;
}
.flame {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50% 50% 20% 20%;
    animation: flameAnim 1.5s ease-in-out infinite alternate;
}
.flame.f1 {
    width: 28px; height: 50px;
    background: linear-gradient(to top, #f59e0b, #f97316);
    animation-delay: 0s;
}
.flame.f2 {
    width: 20px; height: 38px;
    background: linear-gradient(to top, #f97316, #ef4444);
    animation-delay: .2s;
}
.flame.f3 {
    width: 12px; height: 26px;
    background: linear-gradient(to top, #ef4444, #fde68a);
    animation-delay: .4s;
}

@keyframes flameAnim {
    0%   { transform: translateX(-50%) scaleX(1) scaleY(1); }
    100% { transform: translateX(-50%) scaleX(0.85) scaleY(1.08); }
}

.mm-placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mm-text2);
    margin: 0 0 8px;
}
.mm-placeholder-desc {
    font-size: 13px;
    color: var(--mm-text-muted);
    margin: 0 0 4px;
    line-height: 1.6;
}

/* ===== 加载动画 ===== */
.mm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: 16px;
}

.mm-loading-sparks {
    display: flex;
    gap: 8px;
    height: 40px;
    align-items: center;
}
.spark {
    font-size: 20px;
    color: var(--mm-primary);
    animation: sparkBounce 1.2s ease-in-out infinite;
}
.spark.s1 { animation-delay: 0s;    color: #ef4444; }
.spark.s2 { animation-delay: .16s;  color: #f97316; }
.spark.s3 { animation-delay: .32s;  color: #f59e0b; }
.spark.s4 { animation-delay: .48s;  color: #8b5cf6; }
.spark.s5 { animation-delay: .64s;  color: #ec4899; }

@keyframes sparkBounce {
    0%, 100% { transform: translateY(0) scale(1); opacity: .8; }
    50%       { transform: translateY(-14px) scale(1.3); opacity: 1; }
}

.mm-loading-dots {
    display: flex;
    gap: 6px;
}
.mm-loading-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--mm-primary);
    animation: mmDotBounce 1s ease-in-out infinite;
}
.mm-loading-dots span:nth-child(2) { animation-delay: .15s; background: var(--mm-secondary); }
.mm-loading-dots span:nth-child(3) { animation-delay: .3s;  background: var(--mm-gold); }

@keyframes mmDotBounce {
    0%, 100% { transform: translateY(0); opacity: .7; }
    50%       { transform: translateY(-10px); opacity: 1; }
}

.mm-loading-text {
    font-size: 13px;
    color: var(--mm-text-muted);
    margin: 0;
    animation: mmTextPulse 2s ease-in-out infinite;
}
@keyframes mmTextPulse {
    0%, 100% { opacity: .7; }
    50%       { opacity: 1; }
}

/* ===== 结果内容 ===== */
.mm-result-content {
    line-height: 1.8;
    color: var(--mm-text);
}

/* AI输出：引言大字 */
.mm-result-content .mm-quote {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--mm-primary-dark);
    border-left: 4px solid var(--mm-primary);
    padding: 12px 16px;
    margin: 0 0 16px;
    background: rgba(249,115,22,.06);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
body.dark .mm-result-content .mm-quote {
    background: rgba(249,115,22,.1);
    color: #fb923c;
}

/* AI输出：激励段落 */
.mm-result-content .mm-para {
    font-size: 14px;
    line-height: 1.9;
    color: var(--mm-text);
    margin: 0 0 12px;
}

/* AI输出：要点列表 */
.mm-result-content .mm-points {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mm-result-content .mm-points li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    line-height: 1.6;
    padding: 8px 12px;
    background: var(--mm-surface2);
    border-radius: 7px;
    border: 1px solid var(--mm-border);
}
body.dark .mm-result-content .mm-points li {
    background: rgba(255,255,255,.04);
    border-color: var(--mm-border);
}
.mm-result-content .mm-points li::before {
    content: '🔥';
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 1px;
}

/* AI输出：名言卡片 */
.mm-result-content .mm-motto {
    background: linear-gradient(135deg, rgba(249,115,22,.08) 0%, rgba(139,92,246,.08) 100%);
    border: 1.5px solid var(--mm-border2);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 14px;
    position: relative;
}
.mm-result-content .mm-motto::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 14px;
    font-size: 48px;
    color: var(--mm-primary);
    line-height: 1;
    opacity: .4;
    font-family: Georgia, serif;
}
.mm-result-content .mm-motto-text {
    font-size: 14px;
    font-style: italic;
    color: var(--mm-text);
    line-height: 1.7;
    margin: 0 0 6px;
    font-weight: 500;
}
.mm-result-content .mm-motto-author {
    font-size: 12px;
    color: var(--mm-text-muted);
    text-align: right;
}

/* AI输出：分节标题 */
.mm-result-content .mm-section-head {
    font-size: 14px;
    font-weight: 700;
    color: var(--mm-primary-dark);
    margin: 14px 0 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mm-result-content .mm-section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--mm-border2), transparent);
}
body.dark .mm-result-content .mm-section-head {
    color: #fb923c;
}

/* 错误状态 */
.mm-result-content.mm-result-error {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.mm-error-inner {
    text-align: center;
    padding: 20px;
}
.mm-error-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.mm-error-msg {
    font-size: 14px;
    color: #ef4444;
    font-weight: 600;
    margin: 0 0 6px;
}
.mm-error-hint {
    font-size: 12px;
    color: var(--mm-text-muted);
    margin: 0 0 14px;
}
.mm-retry-btn {
    padding: 7px 18px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .18s;
}
.mm-retry-btn:hover {
    background: linear-gradient(135deg, #fb923c, #f97316);
}
/* 错误状态暗黑模式 */
body.dark .mm-error-msg {
    color: #fca5a5;
}
body.dark .mm-error-hint {
    color: var(--mm-text-muted);
}
body.dark .mm-retry-btn {
    background: linear-gradient(135deg, #c2410c, #9a3412);
}
body.dark .mm-retry-btn:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

/* ===== 示例模态框 ===== */
.mm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10001;
}
.mm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    width: min(680px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.mm-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--mm-surface);
}
body.dark .mm-modal-content {
    background: #241508;
}
.mm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mm-border);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(249,115,22,.08), rgba(139,92,246,.06));
}
.mm-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--mm-text);
}
.mm-modal-close {
    background: none;
    border: none;
    color: var(--mm-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background .18s, color .18s;
}
.mm-modal-close:hover {
    background: rgba(239,68,68,.1);
    color: #ef4444;
}
.mm-modal-body {
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    align-content: start;
}

.mm-example-card {
    padding: 14px;
    border: 1.5px solid var(--mm-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    background: var(--mm-surface);
}
.mm-example-card:hover {
    border-color: var(--mm-primary);
    background: rgba(249,115,22,.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(249,115,22,.2);
}
body.dark .mm-example-card {
    background: rgba(255,255,255,.04);
    border-color: var(--mm-border);
}
body.dark .mm-example-card:hover {
    background: rgba(249,115,22,.1);
    border-color: #fb923c;
}
.mm-example-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--mm-text);
    margin-bottom: 6px;
}
.mm-example-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}
.mm-example-tag {
    background: rgba(249,115,22,.1);
    color: var(--mm-primary-dark);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10.5px;
    font-weight: 600;
}
body.dark .mm-example-tag {
    background: rgba(249,115,22,.18);
    color: #fb923c;
}
.mm-example-desc {
    font-size: 11.5px;
    color: var(--mm-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 暗黑模式 placeholder 颜色 ===== */
body.dark .mm-textarea::placeholder,
body.dark .mm-input::placeholder {
    color: #6b4030;
    opacity: 1;
}

/* ===== 滚动条 ===== */
.mm-history-list::-webkit-scrollbar,
.mm-input-body::-webkit-scrollbar,
.mm-result-body::-webkit-scrollbar,
.mm-modal-body::-webkit-scrollbar {
    width: 5px;
}
.mm-history-list::-webkit-scrollbar-track,
.mm-input-body::-webkit-scrollbar-track,
.mm-result-body::-webkit-scrollbar-track,
.mm-modal-body::-webkit-scrollbar-track {
    background: var(--mm-surface2);
    border-radius: 3px;
}
.mm-history-list::-webkit-scrollbar-thumb,
.mm-input-body::-webkit-scrollbar-thumb,
.mm-result-body::-webkit-scrollbar-thumb,
.mm-modal-body::-webkit-scrollbar-thumb {
    background: var(--mm-border2);
    border-radius: 3px;
}
body.dark .mm-history-list::-webkit-scrollbar-track,
body.dark .mm-input-body::-webkit-scrollbar-track,
body.dark .mm-result-body::-webkit-scrollbar-track,
body.dark .mm-modal-body::-webkit-scrollbar-track {
    background: #1e1108;
}
body.dark .mm-history-list::-webkit-scrollbar-thumb,
body.dark .mm-input-body::-webkit-scrollbar-thumb,
body.dark .mm-result-body::-webkit-scrollbar-thumb,
body.dark .mm-modal-body::-webkit-scrollbar-thumb {
    background: var(--mm-border2);
}

/* ===== 中栏操作按钮区 ===== */
.mm-input-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--mm-border);
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--mm-surface);
    transition: background .25s, border-color .25s;
}
body.dark .mm-input-footer {
    background: var(--mm-surface);
    border-color: var(--mm-border);
}

.mm-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: .2px;
    transition: background .2s, box-shadow .2s, transform .15s;
}
.mm-inline-btn:focus { outline: none; }

.mm-inline-btn-primary {
    flex: 1;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 2px 12px rgba(249,115,22,.38);
}
.mm-inline-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fb923c, #f97316);
    box-shadow: 0 4px 18px rgba(249,115,22,.55);
    transform: translateY(-1px);
}
.mm-inline-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(249,115,22,.3);
}
.mm-inline-btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}
.mm-inline-btn-primary.mm-btn-loading {
    background: linear-gradient(90deg, #7c2d12, #ea580c, #7c2d12, #c2410c);
    background-size: 300% 100%;
    animation: mmShimmer .8s infinite linear;
    box-shadow: none;
}
body.dark .mm-inline-btn-primary.mm-btn-loading {
    background: linear-gradient(90deg, #7c2d12, #c2410c, #7c2d12, #9a3412);
    background-size: 300% 100%;
    animation: mmShimmer .8s infinite linear;
}

.mm-inline-btn-cancel {
    padding: 10px 14px;
    background: rgba(239,68,68,.1);
    color: #ef4444;
    border: 1.5px solid rgba(239,68,68,.3);
}
.mm-inline-btn-cancel:hover {
    background: rgba(239,68,68,.18);
    border-color: rgba(239,68,68,.55);
}
body.dark .mm-inline-btn-cancel {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
    border-color: rgba(239,68,68,.35);
}
body.dark .mm-inline-btn-cancel:hover {
    background: rgba(239,68,68,.22);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    :root {
        --mm-history-w: 0px;
        --mm-input-w:   100%;
    }
    .mm-history-panel {
        display: none;
    }
    .mm-main-content {
        flex-direction: column;
    }
    .mm-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--mm-border);
        max-height: 50%;
    }
    .mm-result-panel {
        min-height: 280px;
    }
    .mm-type-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .mm-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mm-format-row {
        flex-wrap: wrap;
    }
    .mm-format-btn {
        flex: 1 0 calc(33% - 4px);
    }
}
