/* ===================================================================
   美妆达人 (Makeup Expert) - 专属样式
   主题色：玫瑰粉 #e8618c → 玫瑰金 #c9956e → 香槟金 #d4af72
   CSS 前缀：me-（makeup expert）
   =================================================================== */

/* ---- CSS 变量 ---- */
:root {
    --me-primary:       #e8618c;
    --me-primary-dark:  #cc4870;
    --me-secondary:     #c9956e;
    --me-accent:        #b45b8a;
    --me-gold:          #d4af72;
    --me-bg:            #fff8f9;
    --me-surface:       #ffffff;
    --me-surface2:      #fff0f4;
    --me-border:        #f5c6d5;
    --me-border2:       #f0a8c0;
    --me-text:          #2d1520;
    --me-text2:         #6b2040;
    --me-text-muted:    #b06080;
    --me-toolbar-bg:    linear-gradient(105deg, #2d1520 0%, #6b2040 45%, #4a1535 100%);
    --me-toolbar-text:  #fff0f4;
    --me-shadow:        0 2px 12px rgba(232,97,140,.1);
    --me-shadow-md:     0 4px 24px rgba(232,97,140,.15);
    --me-radius:        10px;
    --me-radius-sm:     6px;
    --me-toolbar-h:     52px;
    --me-history-w:     220px;
    --me-input-w:       360px;
}

/* 暗黑模式变量 */
body.dark {
    --me-bg:        #1a0810;
    --me-surface:   #240e18;
    --me-surface2:  #1e0c14;
    --me-border:    #4a1535;
    --me-border2:   #6b2040;
    --me-text:      #ffe8f0;
    --me-text2:     #ffc8d8;
    --me-text-muted:#e891b0;
    --me-shadow:    0 2px 12px rgba(0,0,0,.45);
    --me-shadow-md: 0 4px 24px rgba(0,0,0,.55);
}

/* ===== 主容器 ===== */
.me-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px);
    min-height: 500px;
    background: var(--me-bg);
    border: 1px solid var(--me-border);
    border-radius: var(--me-radius);
    overflow: hidden;
    box-shadow: var(--me-shadow-md);
    transition: background .25s, border-color .25s;
}

.me-container.fullscreen-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    height: 100vh !important;
    border-radius: 0;
    border: none;
}

/* ===== 工具栏 ===== */
.me-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: var(--me-toolbar-h);
    background: var(--me-toolbar-bg);
    color: var(--me-toolbar-text);
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

/* 工具栏彩虹渐变装饰条 */
.me-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right,
        #e8618c, #f4a0bc, #d4af72, #e8618c,
        #b45b8a, #f9c8d8, #e8618c);
    background-size: 200% 100%;
    opacity: .9;
    animation: meBarShimmer 5s ease-in-out infinite;
}

@keyframes meBarShimmer {
    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(--me-primary);
    letter-spacing: .3px;
    white-space: nowrap;
    margin-right: 4px;
    text-shadow: 0 0 12px rgba(232,97,140,.5);
}

.me-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: #fce4ed;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, border-color .18s, color .18s;
}
.me-toolbar-btn:hover {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.me-toolbar-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.me-toolbar-btn-primary {
    background: linear-gradient(135deg, #e8618c, #cc4870) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(232,97,140,.45);
}
.me-toolbar-btn-primary:hover {
    background: linear-gradient(135deg, #f07aa0, #e8618c) !important;
    box-shadow: 0 4px 14px rgba(232,97,140,.6);
}
.me-toolbar-btn-primary.me-btn-loading {
    background: linear-gradient(90deg, #7c2040, #cc4870, #7c2040, #a83560) !important;
    background-size: 300% 100% !important;
    animation: meShimmer .8s infinite linear;
    box-shadow: none;
}
body.dark .me-toolbar-btn-primary.me-btn-loading {
    background: linear-gradient(90deg, #6b2040, #a83560, #6b2040, #8c2a4e) !important;
    background-size: 300% 100% !important;
    animation: meShimmer .8s infinite linear;
}

.me-toolbar-btn-cancel {
    background: rgba(180,91,138,.18) !important;
    border-color: rgba(180,91,138,.35) !important;
    color: #f4a8c8 !important;
}
.me-toolbar-btn-cancel:hover {
    background: rgba(180,91,138,.32) !important;
}

@keyframes meShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* 场合/风格选项校验抖动动画（命名空间隔离，避免全局 shake 冲突） */
@keyframes meShakeAnim {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}
.me-shake {
    animation: meShakeAnim 0.5s ease-in-out;
}

/* ===== 主内容区 ===== */
.me-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== 历史记录面板（左） ===== */
.me-history-panel {
    width: var(--me-history-w);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    background: var(--me-surface2);
    border-right: 1px solid var(--me-border);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.me-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--me-border);
    flex-shrink: 0;
}
.me-history-header h3 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--me-text2);
    white-space: nowrap;
}

.me-history-count {
    font-size: 11px;
    color: var(--me-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.me-history-clear-btn {
    background: none;
    border: none;
    color: var(--me-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .18s, background .18s;
    line-height: 1;
}
.me-history-clear-btn:hover {
    color: #e8618c;
    background: rgba(232,97,140,.1);
}

.me-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--me-border);
    flex-shrink: 0;
}
.me-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid var(--me-border);
    border-radius: 5px;
    font-size: 12px;
    background: var(--me-surface);
    color: var(--me-text);
    outline: none;
    transition: border-color .18s;
    box-sizing: border-box;
}
.me-history-search input:focus {
    border-color: var(--me-primary);
}
body.dark .me-history-search input {
    background: var(--me-surface2);
}
body.dark .me-history-search input::placeholder {
    color: var(--me-text-muted);
}

.me-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}
body.dark .me-history-list::-webkit-scrollbar-track {
    background: #1a0810;
}

.me-history-empty {
    text-align: center;
    color: var(--me-text-muted);
    font-size: 12px;
    padding: 24px 8px;
    opacity: .7;
}

.me-history-item {
    position: relative;
    padding: 10px 28px 10px 11px;
    border-radius: 7px;
    cursor: pointer;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-left: 2px solid transparent;
    transition: background .18s, border-color .18s;
    background: var(--me-surface);
}
.me-history-item:hover {
    background: var(--me-surface);
    border-color: var(--me-border2);
    border-left-color: var(--me-primary);
}
.me-history-item.active {
    background: rgba(232,97,140,.08);
    border-color: rgba(232,97,140,.35);
    border-left-color: var(--me-primary);
}
body.dark .me-history-item {
    background: rgba(255,255,255,.04);
}
body.dark .me-history-item:hover {
    background: rgba(255,255,255,.08);
}
body.dark .me-history-item.active {
    background: rgba(232,97,140,.12);
}

.me-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--me-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    padding-right: 22px;
}

.me-history-item-meta {
    font-size: 11px;
    color: var(--me-text-muted);
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.me-history-tag {
    background: rgba(232,97,140,.12);
    color: var(--me-primary-dark);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10.5px;
    font-weight: 500;
}
body.dark .me-history-tag {
    background: rgba(232,97,140,.2);
    color: #f07aa0;
}

/* 历史记录数量徽章 */
.me-history-badge {
    background: rgba(212,175,114,.18);
    color: #7a5500;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10.5px;
    font-weight: 600;
}
body.dark .me-history-badge {
    background: rgba(212,175,114,.22);
    color: #d4af72;
}

.me-history-del-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--me-text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity .18s, color .18s, background .18s;
}
.me-history-item:hover .me-history-del-btn {
    opacity: 1;
}
.me-history-del-btn:hover {
    color: #e8618c;
    background: rgba(232,97,140,.1);
}

/* ===== 输入面板（中） ===== */
.me-input-panel {
    width: var(--me-input-w);
    min-width: 290px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--me-border);
    background: var(--me-surface);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.me-panel-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--me-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
}
.me-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--me-text);
    white-space: nowrap;
}
.me-panel-tip {
    font-size: 11px;
    color: var(--me-text-muted);
    text-align: right;
}

.me-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
body.dark .me-input-body::-webkit-scrollbar-track {
    background: #1a0810;
}

.me-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.me-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--me-text2);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-left: 8px;
    border-left: 3px solid var(--me-primary);
    line-height: 1.4;
}
.me-required {
    color: #e8618c;
    font-size: 13px;
}
.me-optional {
    font-size: 0.85em;
    color: #6b4030;
    font-weight: 400;
}
body.dark .me-optional {
    color: #b89a8c;
}

/* ===== 肤质类型选择 ===== */
.me-skin-type-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.me-skin-type-btn {
    padding: 5px 12px;
    border: 1.5px solid var(--me-border);
    border-radius: 20px;
    background: var(--me-surface);
    cursor: pointer;
    font-size: 12px;
    color: var(--me-text2);
    white-space: nowrap;
    transition: all .18s;
    font-weight: 500;
}
.me-skin-type-btn:hover {
    border-color: var(--me-primary);
    background: rgba(232,97,140,.07);
    color: var(--me-primary-dark);
}
.me-skin-type-btn.selected {
    border-color: var(--me-primary);
    background: rgba(232,97,140,.12);
    color: var(--me-primary-dark);
    box-shadow: 0 0 0 2px rgba(232,97,140,.2);
}
body.dark .me-skin-type-btn {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-skin-type-btn:hover,
body.dark .me-skin-type-btn.selected {
    border-color: #f07aa0;
    background: rgba(232,97,140,.15);
    color: #f07aa0;
}

/* ===== 肤色选择 ===== */
.me-tone-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.me-tone-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1.5px solid var(--me-border);
    border-radius: 20px;
    background: var(--me-surface);
    cursor: pointer;
    font-size: 12px;
    color: var(--me-text2);
    white-space: nowrap;
    transition: all .18s;
    font-weight: 500;
}
.me-tone-btn .tone-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.08);
}
.me-tone-btn:hover {
    border-color: var(--me-secondary);
    background: rgba(201,149,110,.07);
    color: #8b4000;
}
.me-tone-btn.selected {
    border-color: var(--me-secondary);
    background: rgba(201,149,110,.15);
    color: #8b4000;
    box-shadow: 0 0 0 2px rgba(201,149,110,.25);
}
body.dark .me-tone-btn {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-tone-btn:hover,
body.dark .me-tone-btn.selected {
    border-color: #d4af72;
    background: rgba(201,149,110,.2);
    color: #d4af72;
}

/* ===== 妆容场合网格 ===== */
.me-occasion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.me-occasion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: 1.5px solid var(--me-border);
    border-radius: 8px;
    background: var(--me-surface);
    cursor: pointer;
    font-size: 11px;
    color: var(--me-text2);
    transition: all .18s;
    white-space: nowrap;
}
.me-occasion-btn .occasion-icon {
    font-size: 20px;
    line-height: 1;
}
.me-occasion-btn .occasion-label {
    font-size: 10.5px;
    font-weight: 600;
}
.me-occasion-btn:hover {
    border-color: var(--me-primary);
    background: rgba(232,97,140,.06);
    color: var(--me-primary-dark);
}
.me-occasion-btn.selected {
    border-color: var(--me-primary);
    background: rgba(232,97,140,.12);
    color: var(--me-primary-dark);
    box-shadow: 0 0 0 2px rgba(232,97,140,.2);
}
body.dark .me-occasion-btn {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-occasion-btn:hover,
body.dark .me-occasion-btn.selected {
    border-color: #f07aa0;
    background: rgba(232,97,140,.15);
    color: #f07aa0;
}

/* ===== 妆容风格网格 ===== */
.me-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.me-style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: 1.5px solid var(--me-border);
    border-radius: 8px;
    background: var(--me-surface);
    cursor: pointer;
    font-size: 11px;
    color: var(--me-text2);
    transition: all .18s;
    white-space: nowrap;
}
.me-style-btn .style-icon {
    font-size: 18px;
    line-height: 1;
}
.me-style-btn .style-label {
    font-size: 10.5px;
    font-weight: 600;
}
.me-style-btn:hover {
    border-color: var(--me-accent);
    background: rgba(180,91,138,.07);
    color: var(--me-accent);
}
.me-style-btn.selected {
    border-color: var(--me-accent);
    background: rgba(180,91,138,.12);
    color: var(--me-accent);
    box-shadow: 0 0 0 2px rgba(180,91,138,.2);
}
body.dark .me-style-btn {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-style-btn:hover,
body.dark .me-style-btn.selected {
    border-color: #d87ab8;
    background: rgba(180,91,138,.2);
    color: #d87ab8;
}

/* ===== 肤质困扰（多选） ===== */
.me-concern-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.me-concern-btn {
    padding: 4px 10px;
    border: 1.5px solid var(--me-border);
    border-radius: 4px;
    background: var(--me-surface);
    cursor: pointer;
    font-size: 11.5px;
    color: var(--me-text2);
    white-space: nowrap;
    transition: all .18s;
    font-weight: 500;
}
.me-concern-btn:hover {
    border-color: var(--me-gold);
    background: rgba(212,175,114,.08);
    color: #7a5500;
}
.me-concern-btn.selected {
    border-color: var(--me-gold);
    background: rgba(212,175,114,.18);
    color: #7a5500;
    box-shadow: 0 0 0 1.5px rgba(212,175,114,.3);
}
body.dark .me-concern-btn {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-concern-btn:hover,
body.dark .me-concern-btn.selected {
    border-color: #d4af72;
    background: rgba(212,175,114,.2);
    color: #d4af72;
}

/* ===== 预算级别 ===== */
.me-budget-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.me-budget-btn {
    flex: 1;
    padding: 7px 4px;
    border: 1.5px solid var(--me-border);
    border-radius: 7px;
    background: var(--me-surface);
    cursor: pointer;
    font-size: 11.5px;
    color: var(--me-text2);
    text-align: center;
    transition: all .18s;
    font-weight: 500;
}
.me-budget-btn .budget-icon {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
}
.me-budget-btn .budget-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
}
.me-budget-btn .budget-desc {
    display: block;
    font-size: 10px;
    color: var(--me-text-muted);
    margin-top: 1px;
}
.me-budget-btn:hover {
    border-color: var(--me-secondary);
    background: rgba(201,149,110,.07);
    color: #8b4000;
}
.me-budget-btn.selected {
    border-color: var(--me-secondary);
    background: rgba(201,149,110,.14);
    color: #8b4000;
    box-shadow: 0 0 0 2px rgba(201,149,110,.2);
}
body.dark .me-budget-btn {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-budget-btn:hover,
body.dark .me-budget-btn.selected {
    border-color: #c9956e;
    background: rgba(201,149,110,.2);
    color: #c9956e;
}
body.dark .me-budget-btn .budget-desc {
    color: var(--me-text-muted);
}

/* ===== 输入框 ===== */
.me-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--me-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--me-text);
    background: var(--me-surface);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
}
.me-input:focus {
    border-color: var(--me-primary);
    box-shadow: 0 0 0 3px rgba(232,97,140,.12);
}
body.dark .me-input {
    background: var(--me-surface2);
    border-color: var(--me-border);
    color: var(--me-text);
}
body.dark .me-input::placeholder {
    color: var(--me-text-muted);
}

/* 字符计数器 */
.me-char-counter {
    font-size: 11px;
    color: var(--me-text-muted);
    text-align: right;
    margin-top: 3px;
    line-height: 1;
}
.me-char-counter.me-char-warn {
    color: #e75480;
    font-weight: 600;
}
body.dark .me-char-counter {
    color: var(--me-text-muted);
}
body.dark .me-char-counter.me-char-warn {
    color: #e75480;
    font-weight: 600;
}

/* ===== 中栏底部操作按钮 ===== */
.me-input-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--me-border);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.me-inline-btn {
    flex: 1;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s;
    text-align: center;
}
.me-inline-btn-primary {
    background: linear-gradient(135deg, #e8618c, #cc4870);
    color: #fff;
    box-shadow: 0 2px 8px rgba(232,97,140,.35);
}
.me-inline-btn-primary:hover {
    background: linear-gradient(135deg, #f07aa0, #e8618c);
    box-shadow: 0 4px 12px rgba(232,97,140,.5);
}
.me-inline-btn-primary.me-btn-loading {
    background: linear-gradient(90deg, #7c2040, #cc4870, #7c2040, #a83560) !important;
    background-size: 300% 100% !important;
    animation: meShimmer .8s infinite linear;
    box-shadow: none;
}
.me-inline-btn-cancel {
    background: rgba(180,91,138,.12);
    color: var(--me-accent);
    border: 1.5px solid rgba(180,91,138,.3);
    flex: 0 0 auto;
    padding: 9px 16px;
}
.me-inline-btn-cancel:hover {
    background: rgba(180,91,138,.22);
}

/* ===== 结果面板（右） ===== */
.me-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--me-surface);
    transition: background .25s;
    overflow: hidden;
}

.me-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.me-result-occasion-tag {
    background: rgba(232,97,140,.15);
    color: var(--me-primary-dark);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
.me-result-style-tag {
    background: rgba(180,91,138,.12);
    color: var(--me-accent);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
body.dark .me-result-occasion-tag {
    background: rgba(232,97,140,.2);
    color: #f07aa0;
}
body.dark .me-result-style-tag {
    background: rgba(180,91,138,.2);
    color: #d87ab8;
}

.me-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}
body.dark .me-result-body::-webkit-scrollbar-track {
    background: #1a0810;
}

/* ===== 占位区（口红动画） ===== */
.me-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 20px;
}

.me-placeholder-icon {
    margin-bottom: 20px;
}

.me-lipstick-wrap {
    position: relative;
    width: 80px;
    height: 90px;
    margin: 0 auto;
}

.me-lipstick {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    animation: meRocking 2.5s ease-in-out infinite;
    transform-origin: bottom center;
}

.me-lip-body {
    width: 28px;
    height: 54px;
    background: linear-gradient(135deg, #e8618c, #cc4870);
    border-radius: 3px 3px 0 0;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(232,97,140,.4);
}

.me-lip-tip {
    width: 28px;
    height: 18px;
    background: linear-gradient(135deg, #f07aa0, #e8618c);
    border-radius: 50% 50% 0 0;
    clip-path: ellipse(50% 100% at 50% 100%);
    margin: 0 auto;
    box-shadow: 0 -2px 6px rgba(232,97,140,.3);
}

@keyframes meRocking {
    0%, 100% { transform: translateX(-50%) rotate(-8deg); }
    50%       { transform: translateX(-50%) rotate(8deg); }
}

.me-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.me-sp {
    position: absolute;
    font-size: 12px;
    color: var(--me-gold);
    animation: meSparkle 2s ease-in-out infinite;
}
.me-sp.sp1 { top: 10px; left: 5px;  animation-delay: 0s;    color: #e8618c; }
.me-sp.sp2 { top: 5px;  right: 5px; animation-delay: .6s;   color: var(--me-gold); }
.me-sp.sp3 { top: 30px; right: 0;   animation-delay: 1.2s;  color: var(--me-accent); }

@keyframes meSparkle {
    0%, 100% { opacity: .3; transform: scale(.8); }
    50%       { opacity: 1;  transform: scale(1.2); }
}

.me-placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--me-text2);
    margin: 0 0 8px;
}
.me-placeholder-desc {
    font-size: 13px;
    color: var(--me-text-muted);
    margin: 0 0 4px;
    line-height: 1.6;
}

/* ===== 加载动画（调色盘） ===== */
.me-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: 16px;
}

.me-loading-palette {
    display: flex;
    gap: 8px;
    align-items: center;
    height: 40px;
}

.me-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: meDotBounce 1.2s ease-in-out infinite;
}
.me-dot.md1 { background: #e8618c; animation-delay: 0s; }
.me-dot.md2 { background: #f07aa0; animation-delay: .16s; }
.me-dot.md3 { background: #d4af72; animation-delay: .32s; }
.me-dot.md4 { background: #c9956e; animation-delay: .48s; }
.me-dot.md5 { background: #b45b8a; animation-delay: .64s; }

@keyframes meDotBounce {
    0%, 100% { transform: translateY(0) scale(1); opacity: .8; }
    50%       { transform: translateY(-14px) scale(1.3); opacity: 1; }
}

.me-loading-brush {
    width: 100px;
    height: 4px;
    background: var(--me-border);
    border-radius: 2px;
    overflow: hidden;
}

.me-brush-anim {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--me-primary), transparent);
    animation: meBrushSlide 1.2s ease-in-out infinite;
}

@keyframes meBrushSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.me-loading-text {
    font-size: 13px;
    color: var(--me-text-muted);
    margin: 0;
    /* 文案切换由 JS fadeOut/fadeIn 控制，勿加 opacity 动画 */
}

/* ===== 结果内容区 ===== */
.me-result-content {
    line-height: 1.8;
    color: var(--me-text);
}

/* 妆容定位标题块 */
.me-result-content .me-look-header {
    background: linear-gradient(135deg, rgba(232,97,140,.08) 0%, rgba(212,175,114,.1) 100%);
    border: 1.5px solid var(--me-border2);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 18px;
    position: relative;
    overflow: hidden;
}
.me-result-content .me-look-header::before {
    content: '💄';
    position: absolute;
    right: 14px;
    top: 12px;
    font-size: 28px;
    opacity: .2;
}
body.dark .me-result-content .me-look-header {
    background: linear-gradient(135deg, rgba(232,97,140,.1), rgba(212,175,114,.12));
    border-color: var(--me-border2);
}

.me-result-content .me-look-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--me-primary-dark);
    margin: 0 0 8px;
    line-height: 1.4;
}
body.dark .me-result-content .me-look-title {
    color: #f07aa0;
}

.me-result-content .me-look-desc {
    font-size: 13.5px;
    color: var(--me-text2);
    line-height: 1.7;
    margin: 0;
}
body.dark .me-result-content .me-look-desc {
    color: var(--me-text2);
}

/* 妆容步骤 */
.me-result-content .me-step {
    margin: 0 0 14px;
    border: 1px solid var(--me-border);
    border-radius: 9px;
    overflow: hidden;
    transition: border-color .2s;
}
.me-result-content .me-step:hover {
    border-color: var(--me-border2);
}
body.dark .me-result-content .me-step {
    border-color: var(--me-border);
}

.me-result-content .me-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(232,97,140,.1), rgba(212,175,114,.07));
    font-size: 13.5px;
    font-weight: 700;
    color: var(--me-text2);
    border-bottom: 1px solid var(--me-border);
}
body.dark .me-result-content .me-step-title {
    background: rgba(232,97,140,.08);
    color: var(--me-text2);
}

.me-result-content .me-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8618c, #cc4870);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.me-result-content .me-step-body {
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--me-text);
}
.me-result-content .me-step-body p {
    margin: 0;
}
body.dark .me-result-content .me-step-body {
    background: rgba(255,255,255,.02);
}

/* 产品推荐区 */
.me-result-content .me-product-section {
    margin: 0 0 16px;
}

.me-result-content .me-product-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--me-secondary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.me-result-content .me-product-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--me-border2), transparent);
}
body.dark .me-result-content .me-product-section-title {
    color: #c9956e;
}

.me-result-content .me-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.me-result-content .me-product-card {
    border: 1px solid var(--me-border);
    border-radius: 9px;
    padding: 12px;
    background: var(--me-surface);
    transition: border-color .2s, box-shadow .2s, transform .2s;
    position: relative;
    overflow: hidden;
}
.me-result-content .me-product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e8618c, #d4af72);
}
.me-result-content .me-product-card:hover {
    border-color: var(--me-border2);
    box-shadow: 0 6px 18px rgba(232,97,140,.16);
    transform: translateY(-2px);
}
body.dark .me-result-content .me-product-card {
    background: rgba(255,255,255,.03);
    border-color: var(--me-border);
}

.me-result-content .me-product-type {
    display: inline-block;
    background: rgba(232,97,140,.12);
    color: var(--me-primary-dark);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
}
body.dark .me-result-content .me-product-type {
    background: rgba(232,97,140,.2);
    color: #f07aa0;
}

.me-result-content .me-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--me-text);
    margin: 0 0 5px;
    line-height: 1.4;
}

.me-result-content .me-product-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--me-secondary);
    margin: 0 0 6px;
}
body.dark .me-result-content .me-product-price {
    color: #d4af72;
}

.me-result-content .me-product-why {
    font-size: 11.5px;
    color: var(--me-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* 专业技巧 */
.me-result-content .me-tips-box {
    background: linear-gradient(135deg, rgba(212,175,114,.08), rgba(232,97,140,.06));
    border: 1.5px solid var(--me-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0 0 14px;
}
body.dark .me-result-content .me-tips-box {
    background: rgba(232,97,140,.06);
    border-color: var(--me-border2);
}

.me-result-content .me-tips-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--me-text2);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.dark .me-result-content .me-tips-title {
    color: var(--me-text2);
}

.me-result-content .me-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.me-result-content .me-tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--me-text);
    padding: 7px 10px;
    background: var(--me-surface);
    border-radius: 6px;
    border: 1px solid var(--me-border);
}
.me-result-content .me-tips-list li::before {
    content: '✦';
    flex-shrink: 0;
    font-size: 10px;
    color: var(--me-primary);
    margin-top: 3px;
}
body.dark .me-result-content .me-tips-list li {
    background: rgba(255,255,255,.04);
    border-color: var(--me-border);
}

/* AI输出通用标签 - h2 / ul / ol / li / p / a */
.me-result-content h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--me-primary-dark);
    margin: 16px 0 10px;
    line-height: 1.4;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--me-border);
}
body.dark .me-result-content h2 {
    color: #f07aa0;
    border-bottom-color: var(--me-border);
}
.me-result-content p {
    font-size: 13.5px;
    line-height: 1.8;
    margin: 0 0 10px;
    color: var(--me-text);
}
.me-result-content ul,
.me-result-content ol {
    padding-left: 20px;
    margin: 4px 0 12px;
}
.me-result-content li {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--me-text);
    margin-bottom: 4px;
}
body.dark .me-result-content p,
body.dark .me-result-content li {
    color: var(--me-text);
}
.me-result-content a {
    color: var(--me-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .18s;
}
.me-result-content a:hover {
    color: var(--me-primary-dark);
}
body.dark .me-result-content a {
    color: #f07aa0;
}
body.dark .me-result-content a:hover {
    color: #ffc0d0;
}

/* AI输出 Markdown 通用标签样式强制补全 */
.me-result-content em {
    font-style: italic;
    color: var(--me-accent);
}
body.dark .me-result-content em {
    color: #d87ab8;
}
.me-result-content strong {
    font-weight: 700;
    color: var(--me-text);
}
.me-result-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--me-text2);
    margin: 14px 0 8px;
    line-height: 1.4;
}
.me-result-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--me-text2);
    margin: 12px 0 7px;
}
body.dark .me-result-content h3,
body.dark .me-result-content h4 {
    color: var(--me-text2);
}
.me-result-content h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--me-text2);
    margin: 10px 0 6px;
}
body.dark .me-result-content h5 {
    color: var(--me-text2);
}
.me-result-content blockquote {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-left: 3px solid var(--me-primary);
    background: rgba(232,97,140,.05);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--me-text2);
    line-height: 1.7;
}
body.dark .me-result-content blockquote {
    background: rgba(232,97,140,.08);
    border-left-color: #f07aa0;
    color: var(--me-text2);
}
.me-result-content pre {
    background: var(--me-surface2);
    border: 1px solid var(--me-border);
    border-radius: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    font-size: 12px;
    margin: 0 0 12px;
    line-height: 1.6;
}
body.dark .me-result-content pre {
    background: rgba(255,255,255,.04);
    border-color: var(--me-border);
}
.me-result-content code {
    background: rgba(232,97,140,.08);
    color: var(--me-accent);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 12px;
    font-family: monospace;
}
body.dark .me-result-content code {
    background: rgba(232,97,140,.15);
    color: #d87ab8;
}

/* 错误状态 */
.me-result-content.me-result-error {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.me-error-inner {
    text-align: center;
    padding: 20px;
}
.me-error-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.me-error-msg {
    font-size: 14px;
    color: #e8618c;
    font-weight: 600;
    margin: 0 0 6px;
}
.me-error-hint {
    font-size: 12px;
    color: var(--me-text-muted);
    margin: 0 0 14px;
}
.me-retry-btn {
    padding: 7px 18px;
    background: linear-gradient(135deg, #e8618c, #cc4870);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .18s;
}
.me-retry-btn:hover {
    background: linear-gradient(135deg, #f07aa0, #e8618c);
}
body.dark .me-error-msg {
    color: #f07aa0;
}
body.dark .me-error-hint {
    color: var(--me-text-muted);
}
body.dark .me-retry-btn {
    background: linear-gradient(135deg, #a83560, #7c2040);
}
body.dark .me-retry-btn:hover {
    background: linear-gradient(135deg, #cc4870, #a83560);
}

/* ===== 示例模态框 ===== */
@keyframes meOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes meModalSlideIn {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.me-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000;
    animation: meOverlayFadeIn .2s ease-out;
}

.me-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: meModalSlideIn .22s cubic-bezier(.34,1.4,.64,1);
    z-index: 10001;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    background: var(--me-surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.me-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.me-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--me-border);
    background: var(--me-surface2);
    flex-shrink: 0;
}
.me-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--me-text2);
}

.me-modal-close {
    background: none;
    border: none;
    color: var(--me-text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .18s, background .18s;
}
.me-modal-close:hover {
    color: var(--me-primary);
    background: rgba(232,97,140,.1);
}

.me-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-content: start;
}

.me-example-card {
    padding: 12px;
    border: 1.5px solid var(--me-border);
    border-radius: 9px;
    cursor: pointer;
    background: var(--me-surface);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.me-example-card:hover {
    border-color: var(--me-primary);
    box-shadow: 0 4px 12px rgba(232,97,140,.18);
    background: rgba(232,97,140,.04);
}
body.dark .me-example-card {
    background: rgba(255,255,255,.04);
    border-color: var(--me-border);
}
body.dark .me-example-card:hover {
    border-color: var(--me-primary);
    background: rgba(232,97,140,.1);
}

.me-example-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--me-text);
    margin: 0 0 6px;
}

.me-example-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.me-example-tag {
    background: rgba(232,97,140,.12);
    color: var(--me-primary-dark);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 500;
}
body.dark .me-example-tag {
    background: rgba(232,97,140,.2);
    color: #f07aa0;
}

.me-example-desc {
    font-size: 11.5px;
    color: var(--me-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 响应式 ===== */
@media (max-width: 639px) {
    .me-main-content {
        flex-direction: column;
    }
    .me-history-panel {
        width: 100%;
        min-width: unset;
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid var(--me-border);
    }
    .me-input-panel {
        width: 100%;
        min-width: unset;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--me-border);
    }
    .me-result-panel {
        min-height: 300px;
    }
    .me-modal-body {
        grid-template-columns: 1fr;
    }
    .me-occasion-grid,
    .me-style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .me-product-grid {
        grid-template-columns: 1fr 1fr;
    }
    body.dark .me-history-panel {
        border-bottom-color: var(--me-border);
    }
    body.dark .me-input-panel {
        border-bottom-color: var(--me-border);
    }
}
