/* ========== 电影观后感工具 - 影院暗色主题 ========== */

/* ========== 主容器 ========== */
.mr-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

/* 全屏模式 */
.mr-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.mr-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 40%, #2c1810 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    position: relative;
}

/* 胶片穿孔装饰条 */
.mr-toolbar::before,
.mr-toolbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #c0392b 0px,
        #c0392b 12px,
        transparent 12px,
        transparent 20px
    );
    opacity: 0.75;
}
.mr-toolbar::before { top: 0; }
.mr-toolbar::after  { bottom: 0; }

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 30px;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-right: 6px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.25s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.40);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.toolbar-btn:active:not(:disabled) { transform: translateY(0); }

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(192, 57, 43, 0.45);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.6);
}

.toolbar-btn-primary.mr-btn-loading {
    animation: mrPulse 1.2s ease-in-out infinite;
}

@keyframes mrPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* 进度条 */
#mrProgressBar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #c0392b, #f5a623, #c0392b);
    background-size: 200% 100%;
    animation: mrProgressShimmer 1.5s linear infinite;
    transition: width 0.3s ease;
    z-index: 10;
    display: none;
}

@keyframes mrProgressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: 0 0; }
}

/* ========== 主内容区 ========== */
.mr-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f2f5;
}

/* ========== 左侧历史面板 ========== */
.mr-history-panel {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.mr-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafbfc, #f4f6f9);
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.mr-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.mr-history-count {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    margin-left: 4px;
}

.mr-history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.mr-history-clear-btn:hover { background: #fde8e8; }

.mr-history-search {
    padding: 8px;
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.mr-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
}

.mr-history-search input::placeholder { color: #BCAAA4; }

.mr-history-search input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.1);
}

.mr-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
}

.mr-history-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.8;
    padding: 24px 8px;
}

.mr-history-item {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    margin: 3px 0;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-left: 3px solid transparent; /* 防布局抖动预设 */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    gap: 6px;
}

.mr-history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.mr-history-item.active {
    background: #fef2f2;
    border-left-color: #c0392b; /* 仅改左边框颜色，宽度不变 */
    box-shadow: 0 1px 4px rgba(192, 57, 43, 0.12);
}

.mr-history-item-main { flex: 1; min-width: 0; }

.mr-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.mr-history-item-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #6b7280;
}

.mr-history-item-stars {
    color: #f5a623;
    font-size: 11px;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.mr-history-item-del {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    opacity: 0;
    flex-shrink: 0;
    line-height: 1;
}

.mr-history-item:hover .mr-history-item-del { opacity: 1; }
.mr-history-item-del:hover { background: #fde8e8; color: #ef4444; }

/* ========== 中栏：输入面板 ========== */
.mr-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mr-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: linear-gradient(to bottom, #fafbfc, #f4f6f9);
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.mr-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.mr-panel-tip {
    font-size: 11px;
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.mr-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.mr-field-group { margin-bottom: 14px; }

.mr-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.mr-required { color: #c0392b; margin-left: 2px; }
.mr-optional { color: #9ca3af; font-weight: 400; font-size: 11px; }

.mr-text-input,
.mr-title-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    font-family: inherit;
}

.mr-title-input {
    font-size: 14px;
    font-weight: 600;
    padding: 9px 12px;
}

.mr-text-input::placeholder,
.mr-title-input::placeholder { color: #BCAAA4; }

.mr-text-input:focus,
.mr-title-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

/* 电影类型多选 */
.mr-genre-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mr-genre-option {
    padding: 4px 9px;
    border: 1px solid #e0e4ec;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4b5563;
    background: #fafbfc;
    user-select: none;
    white-space: nowrap;
}

.mr-genre-option:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fef2f2;
}

.mr-genre-option.selected {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    border-color: #c0392b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.3);
}

/* 星级评分 */
.mr-star-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.mr-star {
    font-size: 26px;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    user-select: none;
}

.mr-star.active  { color: #f5a623; }
.mr-star.hover   { color: #f5a623; transform: scale(1.2); }
.mr-star:hover   { transform: scale(1.15); }

.mr-rating-label {
    font-size: 12px;
    color: #6b7280;
    margin-left: 6px;
    font-weight: 500;
}

/* 写作风格 / 观影角度 */
.mr-style-options,
.mr-angle-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mr-style-option,
.mr-angle-option {
    padding: 5px 10px;
    border: 1px solid #e0e4ec;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4b5563;
    background: #fafbfc;
    user-select: none;
    white-space: nowrap;
}

.mr-style-option:hover,
.mr-angle-option:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fef2f2;
}

.mr-style-option.selected,
.mr-angle-option.selected {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    border-color: #c0392b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.3);
}

/* 观影笔记 */
.mr-notes-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, height 0.12s ease;
    box-sizing: border-box;
    color: #374151;
    min-height: 72px;
    max-height: 160px;
    overflow-y: hidden;
}

.mr-notes-textarea::placeholder { color: #BCAAA4; }

.mr-notes-textarea:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.mr-char-counter {
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
}

.mr-char-counter.warning { color: #f59e0b; }
.mr-char-counter.limit   { color: #c0392b; }

/* 使用说明 */
.mr-tips-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 11px 13px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.7;
}

.mr-tips-box p {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: #374151;
}

.mr-tips-box ul { margin: 0; padding-left: 16px; }
.mr-tips-box li { margin-bottom: 3px; }

/* ========== 右栏：结果面板 ========== */
.mr-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-width: 300px;
}

.mr-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    background: linear-gradient(to bottom, #fafbfc, #f4f6f9);
    border-bottom: 1px solid #e4e8f0;
    flex-shrink: 0;
}

.mr-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.mr-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mr-result-movie-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    background: #fef2f2;
    color: #922b21;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mr-result-stars-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    background: #fffbeb;
    color: #92400e;
    letter-spacing: 1px;
}

.mr-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* 占位提示 */
.mr-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #9ca3af;
    padding: 40px 20px;
}

.mr-placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.7;
    animation: mrFloat 3s ease-in-out infinite;
}

@keyframes mrFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

.mr-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.mr-placeholder-desc {
    font-size: 13px;
    margin: 3px 0;
    color: #9ca3af;
}

/* 加载中 */
.mr-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* AI 三点弹跳 */
.ai-loading-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.ai-loading-indicator span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #c0392b;
    border-radius: 50%;
    animation: mrBounce 1.2s ease-in-out infinite;
}

.ai-loading-indicator span:nth-child(2) { animation-delay: 0.2s; background: #e74c3c; }
.ai-loading-indicator span:nth-child(3) { animation-delay: 0.4s; background: #c0392b; }

@keyframes mrBounce {
    0%, 80%, 100% { transform: translateY(0);    opacity: 0.7; }
    40%           { transform: translateY(-12px); opacity: 1; }
}

/* 呼吸闪烁加载文字 */
.mr-loading-text {
    font-size: 14px;
    color: #6b7280;
    animation: mrBreath 1.8s ease-in-out infinite;
    margin: 0;
}

@keyframes mrBreath {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

/* ========== AI 生成的观后感内容样式 ========== */
.mr-result-content { line-height: 1.7; }

.mr-review-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 开篇印象 */
.mr-opening {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #2c1810 100%);
    border-radius: 8px;
    padding: 18px 20px;
}

.mr-opening-quote {
    font-size: 15px;
    font-weight: 600;
    color: #f5e6c8;
    line-height: 1.8;
    font-style: italic;
    border-left: 3px solid #c0392b;
    padding-left: 14px;
    position: relative;
}

.mr-opening-quote::before {
    content: '❝';
    position: absolute;
    left: -10px;
    top: -4px;
    font-size: 20px;
    color: #c0392b;
    opacity: 0.6;
    font-style: normal;
}

/* 各板块通用 */
.mr-section {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.mr-section:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); }

.mr-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px 9px 11px;
    background: linear-gradient(to right, #fef2f2, #fff8f8, #f9fafb);
    border-left: 3px solid #c0392b;
    border-bottom: 1px solid #f0e8e8;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.mr-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #c0392b;
    border-radius: 50%;
    flex-shrink: 0;
}

.mr-section-body {
    padding: 13px 14px;
    font-size: 14px;
    color: #374151;
    line-height: 1.85;
}

/* 印象深刻的场景/台词 */
.mr-highlight-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 14px;
    background: #fffbf2;
    border-bottom: 1px solid #fef3c7;
}

.mr-highlight-item:last-child { border-bottom: none; }

.mr-quote-icon {
    font-size: 22px;
    color: #f5a623;
    flex-shrink: 0;
    line-height: 1.2;
    margin-top: -2px;
}

.mr-highlight-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.8;
    font-style: italic;
}

/* 综合评价 */
.mr-verdict {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #2c1810 100%);
    border-radius: 8px;
    padding: 16px 18px;
}

.mr-verdict-stars {
    font-size: 24px;
    color: #f5a623;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
}

.mr-verdict-text {
    font-size: 13px;
    color: #e2d6c8;
    line-height: 1.85;
}

/* 错误提示 */
#mrResultError {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mr-result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.mr-result-error .error-icon { font-size: 40px; margin-bottom: 12px; }
.mr-result-error .error-msg  { font-size: 14px; color: #ef4444; margin: 0 0 6px 0; }
.mr-result-error .error-tip  { font-size: 12px; color: #9ca3af; margin: 0 0 16px 0; }

.mr-retry-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #c0392b, #922b21);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.mr-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
}

/* ========== 模态框 ========== */
.mr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    backdrop-filter: blur(3px);
}

.mr-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    max-width: 740px;
    width: calc(100% - 40px);
    max-height: 80vh;
    overflow: hidden;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 100001;
    animation: mrModalIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.mr-modal.mr-entering {
    animation: none;
    transform: translate(-50%, -52%) scale(0.96);
    opacity: 0;
}

@keyframes mrModalIn {
    from { opacity: 0; transform: translate(-50%, -52%) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.mr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #2c1810 100%);
    color: #fff;
    flex-shrink: 0;
}

.mr-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.mr-modal-close {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mr-modal-close:hover { background: rgba(255,255,255,0.25); }

.mr-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fff;
}

.mr-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.mr-example-card {
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mr-example-card:hover {
    background: #fef2f2;
    border-color: #c0392b;
    box-shadow: 0 3px 12px rgba(192, 57, 43, 0.12);
    transform: translateY(-1px);
}

.mr-example-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.mr-example-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.mr-example-badge-genre {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #fef2f2;
    color: #922b21;
    font-weight: 500;
}

.mr-example-badge-stars {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #fffbeb;
    color: #92400e;
}

.mr-example-badge-style {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 500;
}

.mr-example-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

/* 示例加载状态 */
.mr-example-loading {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
    font-size: 14px;
    grid-column: 1 / -1;
}

/* ========== Toast 提示 ========== */
.mr-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(13, 13, 13, 0.93);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200000;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-left: 3px solid transparent;
}

.mr-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mr-toast.warn { background: rgba(120, 53, 15, 0.93); border-left-color: #f59e0b; }
.mr-toast.info { background: rgba(15, 52, 96, 0.93);  border-left-color: #60a5fa; }

/* Input shake 动画 */
@keyframes mrShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.shake { animation: mrShake 0.4s ease; }

/* ========== 自定义滚动条 ========== */
.mr-history-list::-webkit-scrollbar,
.mr-input-body::-webkit-scrollbar,
.mr-result-body::-webkit-scrollbar,
.mr-modal-body::-webkit-scrollbar { width: 5px; }

.mr-history-list::-webkit-scrollbar-track,
.mr-input-body::-webkit-scrollbar-track,
.mr-result-body::-webkit-scrollbar-track,
.mr-modal-body::-webkit-scrollbar-track { background: transparent; }

.mr-history-list::-webkit-scrollbar-thumb,
.mr-input-body::-webkit-scrollbar-thumb,
.mr-result-body::-webkit-scrollbar-thumb,
.mr-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.mr-history-list::-webkit-scrollbar-thumb:hover,
.mr-input-body::-webkit-scrollbar-thumb:hover,
.mr-result-body::-webkit-scrollbar-thumb:hover,
.mr-modal-body::-webkit-scrollbar-thumb:hover { background: #c0392b; }

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .mr-main-content { flex-direction: column; }

    .mr-history-panel {
        width: 100%;
        height: 108px;
        border-right: none;
        border-bottom: 1px solid #e4e8f0;
    }

    /* 移动端隐藏搜索框，改为横向滚动展示历史记录 */
    .mr-history-search { display: none; }

    .mr-history-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 6px 8px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .mr-history-item {
        flex-shrink: 0;
        width: 150px;
        transform: none !important; /* 禁用 translateX 防止横向滚动布局错乱 */
    }

    /* 移动端删除按钮始终可见（touch设备无hover态） */
    .mr-history-item-del { opacity: 1; }

    .mr-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e4e8f0;
        max-height: 360px;
    }

    .mr-result-panel { min-height: 300px; }

    .toolbar-title { display: none; }

    /* 横向历史滚动条细化：隐藏竖向宽度，横向设为4px */
    .mr-history-list::-webkit-scrollbar { width: 0; height: 4px; }
}

/* ========== 暗黑模式（body.dark） ========== */
body.dark .mr-container { background: #0f172a; }
body.dark .mr-main-content { background: #0f172a; }

body.dark .mr-toolbar {
    background: linear-gradient(135deg, #050505 0%, #0d0d0d 40%, #1a0c08 100%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.7);
}

body.dark .mr-history-panel,
body.dark .mr-input-panel,
body.dark .mr-result-panel {
    background: #111827;
    border-color: rgba(55, 65, 81, 0.6);
}

body.dark .mr-history-header {
    background: linear-gradient(to bottom, #1a2234, #151e2e);
    border-bottom-color: rgba(55, 65, 81, 0.6);
}

body.dark .mr-history-header h3,
body.dark .mr-panel-header h3,
body.dark .mr-result-header h3 {
    color: #e2e8f0;
}

body.dark .mr-history-count { color: #6b7280; }

body.dark .mr-history-search input {
    background: #0f172a;
    border-color: #374151;
    color: #e2e8f0;
}

body.dark .mr-history-search input::placeholder { color: #6b7280; }

body.dark .mr-history-search input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

body.dark .mr-history-item {
    background: #1a2234;
    border-color: rgba(55, 65, 81, 0.5);
}

body.dark .mr-history-item:hover {
    background: #1e2a3d;
    border-color: #374151;
}

body.dark .mr-history-item.active {
    background: #2d1a1a;
    border-left-color: #c0392b;
}

body.dark .mr-history-item-title  { color: #e2e8f0; }
body.dark .mr-history-item-meta   { color: #6b7280; }
body.dark .mr-history-empty       { color: #6b7280; }

body.dark .mr-history-clear-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

body.dark .mr-history-clear-btn:hover { background: rgba(239, 68, 68, 0.22); }

body.dark .mr-panel-header {
    background: linear-gradient(to bottom, #1a2234, #151e2e);
    border-bottom-color: rgba(55, 65, 81, 0.6);
}

body.dark .mr-panel-tip { color: #6b7280; background: rgba(107, 114, 128, 0.15); }

body.dark .mr-field-label { color: #9ca3af; }

body.dark .mr-text-input,
body.dark .mr-title-input,
body.dark .mr-notes-textarea {
    background: #0f172a;
    border-color: #374151;
    color: #e2e8f0;
}

body.dark .mr-text-input::placeholder,
body.dark .mr-title-input::placeholder,
body.dark .mr-notes-textarea::placeholder { color: #6b7280; }

body.dark .mr-text-input:focus,
body.dark .mr-title-input:focus,
body.dark .mr-notes-textarea:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

body.dark .mr-genre-option,
body.dark .mr-style-option,
body.dark .mr-angle-option {
    background: #1a2234;
    border-color: #374151;
    color: #9ca3af;
}

body.dark .mr-genre-option:hover,
body.dark .mr-style-option:hover,
body.dark .mr-angle-option:hover {
    border-color: #c0392b;
    color: #e74c3c;
    background: #2d1a1a;
}

body.dark .mr-star { color: #374151; }
body.dark .mr-star.active,
body.dark .mr-star.hover { color: #f5a623; }

body.dark .mr-rating-label { color: #6b7280; }

body.dark .mr-tips-box {
    background: #1a2234;
    border-color: #374151;
    color: #6b7280;
}

body.dark .mr-tips-box p { color: #e2e8f0; }

body.dark .mr-result-header {
    background: linear-gradient(to bottom, #1a2234, #151e2e);
    border-bottom-color: rgba(55, 65, 81, 0.6);
}

body.dark .mr-placeholder-title { color: #6b7280; }
body.dark .mr-placeholder-desc  { color: #6b7280; }

body.dark .mr-loading-text { color: #6b7280; }

body.dark .ai-loading-indicator span { background: #c0392b; }
body.dark .ai-loading-indicator span:nth-child(2) { background: #e74c3c; }

/* 暗黑模式下观后感内容样式 */
body.dark .mr-section {
    background: #1a2234;
    border-color: rgba(55, 65, 81, 0.5);
}

body.dark .mr-section-title {
    background: linear-gradient(to right, #2d1a1a, #1a2234);
    border-bottom-color: rgba(55, 65, 81, 0.5);
    color: #e2e8f0;
}

body.dark .mr-section-body { color: #d1d5db; }

body.dark .mr-highlight-item {
    background: #1e1a0a;
    border-bottom-color: rgba(78, 52, 0, 0.5);
}

body.dark .mr-highlight-text { color: #d1d5db; }

body.dark .mr-result-movie-badge {
    background: #2d1a1a;
    color: #f87171;
}

body.dark .mr-result-stars-badge {
    background: #1e1a0a;
    color: #fbbf24;
}

body.dark .mr-char-counter { color: #6b7280; }

/* 暗黑模式错误提示 */
body.dark .mr-result-error .error-msg { color: #f87171; }
body.dark .mr-result-error .error-tip { color: #6b7280; }

/* 暗黑模式重试按钮 */
body.dark .mr-retry-btn {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

body.dark .mr-retry-btn:hover {
    background: linear-gradient(135deg, #991b1b, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* 暗黑模式模态框 */
body.dark .mr-modal-body { background: #111827; }
body.dark .mr-modal      { background: #111827; }

body.dark .mr-example-card {
    background: #1a2234;
    border-color: #374151;
}

body.dark .mr-example-card:hover {
    background: #2d1a1a;
    border-color: #c0392b;
}

body.dark .mr-example-title { color: #e2e8f0; }
body.dark .mr-example-desc  { color: #6b7280; }
body.dark .mr-example-loading { color: #9ca3af; }

/* 暗黑模式自定义滚动条 */
body.dark .mr-history-list::-webkit-scrollbar-thumb,
body.dark .mr-input-body::-webkit-scrollbar-thumb,
body.dark .mr-result-body::-webkit-scrollbar-thumb,
body.dark .mr-modal-body::-webkit-scrollbar-thumb { background: #374151; }

body.dark .mr-history-list::-webkit-scrollbar-thumb:hover,
body.dark .mr-input-body::-webkit-scrollbar-thumb:hover,
body.dark .mr-result-body::-webkit-scrollbar-thumb:hover,
body.dark .mr-modal-body::-webkit-scrollbar-thumb:hover { background: #c0392b; }

/* ——— Bug Fix #1：暗黑模式下类型/风格/角度已选项红色渐变被 body.dark .mr-xxx-option (0,2,1) 覆盖
   解决方案：提升已选规则至 (0,3,1) 使其明确优先 ——— */
body.dark .mr-genre-option.selected,
body.dark .mr-style-option.selected,
body.dark .mr-angle-option.selected {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    border-color: #c0392b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.35);
}

body.dark .mr-genre-option.selected:hover,
body.dark .mr-style-option.selected:hover,
body.dark .mr-angle-option.selected:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.5);
}

/* ——— Bug Fix #2：暗黑模式字数计数器 warning/limit 状态被 body.dark .mr-char-counter (0,2,1) 覆盖
   解决方案：提升至 (0,3,1) ——— */
body.dark .mr-char-counter.warning { color: #f59e0b; }
body.dark .mr-char-counter.limit   { color: #e74c3c; }

/* ——— Bug Fix #3：示例模态框徽章在暗黑模式下背景过亮（#fef2f2 等），与暗色卡片违和 ——— */
body.dark .mr-example-badge-genre {
    background: rgba(192, 57, 43, 0.18);
    color: #f87171;
}
body.dark .mr-example-badge-stars {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}
body.dark .mr-example-badge-style {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

/* ——— Bug Fix #4：历史删除按钮暗黑模式悬停亮粉背景 (#fde8e8) 突兀 ——— */
body.dark .mr-history-item-del { color: #4b5563; }
body.dark .mr-history-item-del:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
