/* =============================================
   营销话术生成器 - marketing_speech.css
   主题色：橙红渐变，体现营销活力与转化力
   参考 feedback_generation 三栏布局风格
   ============================================= */

/* ========== 主容器 ========== */
.ms-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fef9f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ms-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.ms-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 60%, #ffc837 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.35);
    flex-shrink: 0;
}

/* 工具栏标题 */
.ms-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.96);
    letter-spacing: 0.5px;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.ms-toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #d95f10;
    transition: all 0.2s;
    white-space: nowrap;
}

.ms-toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    color: #c2540e;
}

.ms-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ms-toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮（生成话术）*/
.ms-toolbar-btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    letter-spacing: 0.3px;
}

.ms-toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.55);
    color: #fff !important;
}

/* ========== Shake 抖动动画（校验错误提示） ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.ms-input.shake,
.ms-select.shake,
.ms-textarea.shake {
    animation: shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* 行内校验错误提示 */
.ms-field-error {
    display: block;
    font-size: 11px;
    color: #ef4444;
    margin-top: 3px;
    line-height: 1.4;
    animation: fieldErrIn 0.2s ease;
}

@keyframes fieldErrIn {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.dark .ms-field-error {
    color: #f87171;
}

/* ========== 主内容区：三栏 ========== */
.ms-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fef9f5;
}

/* ========== 左栏：历史记录 ========== */
.ms-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fde8d6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ms-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fff7f0 0%, #fef0e6 100%);
    border-bottom: 1px solid #fde8d6;
    flex-shrink: 0;
}

.ms-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.ms-history-count {
    font-size: 11px;
    color: #d97706;
    font-weight: 400;
}

.ms-history-clear-btn {
    background: #fff0e8;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.ms-history-clear-btn:hover {
    background: #fde8e8;
}

.ms-history-search {
    padding: 8px;
    border-bottom: 1px solid #fde8d6;
    flex-shrink: 0;
}

.ms-history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #fde8d6;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fffbf8;
}

.ms-history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
}

.ms-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

/* 自定义滚动条 */
.ms-history-list::-webkit-scrollbar {
    width: 4px;
}
.ms-history-list::-webkit-scrollbar-track {
    background: transparent;
}
.ms-history-list:hover::-webkit-scrollbar-track {
    background: #fff7ed;
}
.ms-history-list::-webkit-scrollbar-thumb {
    background: #fed7aa;
    border-radius: 2px;
}
.ms-history-list::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.ms-history-empty {
    text-align: center;
    color: #d97706;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    opacity: 0.6;
}

.ms-history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #fffbf8;
    border: 1px solid #fde8d6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: hiSlideIn 0.2s ease;
}

@keyframes hiSlideIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.ms-history-item:hover {
    background: #fff7ed;
    border-color: #fdba74;
    transform: translateX(2px);
}

.ms-history-item.active {
    background: #fff3e0;
    border-color: #f97316;
    box-shadow: inset 3px 0 0 #f97316, 0 1px 3px rgba(249, 115, 22, 0.18);
}

.ms-history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.ms-history-item:hover .ms-history-item-del {
    opacity: 1;
}

.ms-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

.ms-history-item-product {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
    margin-bottom: 2px;
}

.ms-history-item-scenario {
    font-size: 11px;
    color: #f97316;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-history-item-time {
    font-size: 10px;
    color: #d97706;
    opacity: 0.7;
}

/* ========== 中栏：表单输入 ========== */
.ms-input-panel {
    width: 380px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fde8d6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：结果展示 ========== */
.ms-result-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

/* ========== 通用面板头部 ========== */
.ms-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fff7f0 0%, #fef0e6 100%);
    border-bottom: 1px solid #fde8d6;
    flex-shrink: 0;
}

.ms-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    white-space: nowrap;
}

.ms-panel-tip {
    font-size: 11px;
    color: #d97706;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-result-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
}

.ms-result-tag {
    font-size: 11px;
    color: #d95f10;
    background: #fff3e0;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.ms-result-char {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.ms-result-time {
    font-size: 11px;
    color: #d97706;
    white-space: nowrap;
    opacity: 0.75;
}

/* ========== 表单输入区 ========== */
.ms-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.ms-input-body::-webkit-scrollbar {
    width: 4px;
}
.ms-input-body::-webkit-scrollbar-track {
    background: transparent;
}
.ms-input-body::-webkit-scrollbar-thumb {
    background: #fed7aa;
    border-radius: 2px;
}
.ms-input-body::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.ms-form-group {
    margin-bottom: 14px;
}

.ms-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    margin-bottom: 5px;
}

.ms-required {
    color: #ef4444;
    margin-left: 2px;
}

.ms-label-tip {
    font-size: 11px;
    color: #d97706;
    font-weight: 400;
}

.ms-input,
.ms-select,
.ms-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #fde8d6;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #fffbf8;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.ms-input:focus,
.ms-select:focus,
.ms-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: #fff;
}

.ms-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f97316' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.ms-textarea {
    resize: vertical;
    min-height: 80px;
}

.ms-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.ms-textarea-hint {
    font-size: 11px;
    color: #d97706;
    opacity: 0.7;
}

.ms-char-count {
    font-size: 11px;
    color: #d97706;
}

.ms-form-row {
    display: flex;
    gap: 10px;
}

.ms-form-half {
    flex: 1;
    min-width: 0;
}

/* ========== 结果展示区 ========== */
.ms-result-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.ms-result-body::-webkit-scrollbar {
    width: 5px;
}
.ms-result-body::-webkit-scrollbar-track {
    background: transparent;
}
.ms-result-body:hover::-webkit-scrollbar-track {
    background: #fff7ed;
}
.ms-result-body::-webkit-scrollbar-thumb {
    background: #fed7aa;
    border-radius: 3px;
}
.ms-result-body::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

/* 占位区 */
.ms-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    min-height: 200px;
    user-select: none;
}

.ms-placeholder-icon {
    font-size: 52px;
    margin-bottom: 14px;
    animation: msFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(249, 115, 22, 0.2));
}

@keyframes msFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ms-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    margin: 0 0 8px 0;
}

.ms-placeholder-desc {
    font-size: 12px;
    color: #d97706;
    margin: 2px 0;
    text-align: center;
    opacity: 0.75;
}

/* 加载区 */
.ms-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    min-height: 200px;
    gap: 16px;
}

.ms-loading-animation {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 36px;
}

.ms-loading-bar {
    width: 7px;
    border-radius: 4px;
    background: linear-gradient(to top, #ff6b35, #ffc837);
    animation: msBounce 1.2s ease-in-out infinite;
}

.ms-loading-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.ms-loading-bar:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.ms-loading-bar:nth-child(3) { height: 28px; animation-delay: 0.3s; }
.ms-loading-bar:nth-child(4) { height: 20px; animation-delay: 0.45s; }
.ms-loading-bar:nth-child(5) { height: 12px; animation-delay: 0.6s; }

@keyframes msBounce {
    0%, 100% { transform: scaleY(1); opacity: 0.7; }
    50% { transform: scaleY(1.6); opacity: 1; }
}

.ms-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #d95f10;
    margin: 0;
}

.ms-loading-sub {
    font-size: 12px;
    color: #d97706;
    margin: 0;
    opacity: 0.7;
}

/* 结果内容 */
.ms-result-content {
    font-size: 14px;
    line-height: 1.85;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    background: linear-gradient(135deg, #fffbf8 0%, #fff8f3 100%);
    border-radius: 8px;
    padding: 18px 20px;
    border: 1px solid #fde8d6;
    border-left: 4px solid #f97316;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.06);
}

/* 结果内容淡入动画（独立动画类，避免硬编码到基础类） */
.ms-result-enter {
    animation: msResultFadeIn 0.4s ease-out forwards;
}

@keyframes msResultFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ms-result-content--error {
    background: #fff5f5 !important;
    border-color: #fecaca !important;
    border-left-color: #ef4444 !important;
    white-space: normal !important;
    display: flex !important;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 24px 20px !important;
}

.ms-result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #dc2626;
}

.ms-result-error-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.ms-result-error-title {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 6px 0;
}

.ms-result-error-hint {
    font-size: 12px;
    color: #ef4444;
    margin: 0 0 14px 0;
    opacity: 0.75;
}

/* 错误状态重试按钮 */
.ms-error-retry-btn {
    margin-top: 4px;
    padding: 7px 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.ms-error-retry-btn:hover {
    background: linear-gradient(135deg, #ff8c60 0%, #f9a83e 100%);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.45);
    transform: translateY(-1px);
}

/* ========== 字数计数分级着色 ========== */
.ms-result-char.count-normal {
    color: #3b82f6;
    background: #eff6ff;
}

.ms-result-char.count-warning {
    color: #d97706;
    background: #fef3c7;
}

.ms-result-char.count-danger {
    color: #ef4444;
    background: #fef2f2;
}

/* ========== 示例模态框 ========== */
.ms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.ms-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 760px;
    max-width: 95vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(249, 115, 22, 0.2);
    overflow: hidden;
}

.ms-modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.ms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    flex-shrink: 0;
}

.ms-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.ms-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ms-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ms-modal-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

.ms-modal-body::-webkit-scrollbar {
    width: 5px;
}
.ms-modal-body::-webkit-scrollbar-thumb {
    background: #fed7aa;
    border-radius: 3px;
}
.ms-modal-body::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

/* 示例卡片 */
.ms-example-card {
    border: 1px solid #fde8d6;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fffbf8;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ms-example-card:hover {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.ms-example-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-example-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.ms-example-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-example-badge {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #fff3e0;
    color: #d95f10;
    border: 1px solid #fed7aa;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

.ms-example-desc {
    font-size: 11px;
    color: #d97706;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== 复制提示 Toast ========== */
.ms-copy-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    z-index: 19999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ms-copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 暗黑模式 body.dark 前缀 ========== */
body.dark .ms-container {
    background: #1a1510;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .ms-toolbar {
    background: linear-gradient(135deg, #b84b20 0%, #b36b18 60%, #b48a15 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .ms-toolbar-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fed7aa;
}

body.dark .ms-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

body.dark .ms-toolbar-btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff !important;
}

body.dark .ms-main-content {
    background: #1a1510;
}

body.dark .ms-history-panel {
    background: #221a13;
    border-right-color: #3d2c1a;
}

body.dark .ms-history-header {
    background: linear-gradient(to bottom, #2a1f14 0%, #221a13 100%);
    border-bottom-color: #3d2c1a;
}

body.dark .ms-history-header h3 {
    color: #fdba74;
}

body.dark .ms-history-count {
    color: #f97316;
}

body.dark .ms-history-clear-btn {
    background: #3d1c1c;
    color: #f87171;
}

body.dark .ms-history-clear-btn:hover {
    background: #5a2020;
}

body.dark .ms-history-search {
    border-bottom-color: #3d2c1a;
}

body.dark .ms-history-search input {
    background: #2a1f14;
    border-color: #3d2c1a;
    color: #d6c4a8;
}

body.dark .ms-history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

body.dark .ms-history-list::-webkit-scrollbar-thumb {
    background: #4d3520;
}

body.dark .ms-history-list::-webkit-scrollbar-thumb:hover {
    background: #c2540e;
}

body.dark .ms-history-list:hover::-webkit-scrollbar-track {
    background: #1f160e;
}

body.dark .ms-history-empty {
    color: #b45309;
}

body.dark .ms-history-item {
    background: #2a1f14;
    border-color: #3d2c1a;
}

body.dark .ms-history-item:hover {
    background: #332515;
    border-color: #6b4226;
}

body.dark .ms-history-item.active {
    background: #3d2a10;
    border-color: #f97316;
    box-shadow: inset 3px 0 0 #f97316, 0 1px 3px rgba(249, 115, 22, 0.25);
}

body.dark .ms-history-item-product {
    color: #fdba74;
}

body.dark .ms-history-item-scenario {
    color: #f97316;
}

body.dark .ms-history-item-time {
    color: #d97706;
    opacity: 0.6;
}

/* 暗黑：历史记录删除按钮 */
body.dark .ms-history-item-del {
    background: #3d1c1c;
    color: #f87171;
}

body.dark .ms-history-item-del:hover {
    background: #b91c1c;
    color: #fff;
}

body.dark .ms-input-panel {
    background: #1e1610;
    border-right-color: #3d2c1a;
}

body.dark .ms-result-panel {
    background: #1e1610;
}

body.dark .ms-panel-header {
    background: linear-gradient(to bottom, #2a1f14 0%, #221a13 100%);
    border-bottom-color: #3d2c1a;
}

body.dark .ms-panel-header h3 {
    color: #fdba74;
}

body.dark .ms-panel-tip {
    color: #b45309;
}

body.dark .ms-result-time {
    color: #b45309;
}

body.dark .ms-result-tag {
    background: #3d2510;
    color: #f97316;
}

body.dark .ms-result-char {
    background: #2a2420;
    color: #7a6a58;
}

body.dark .ms-input-body::-webkit-scrollbar-thumb {
    background: #4d3520;
}

body.dark .ms-input-body::-webkit-scrollbar-thumb:hover {
    background: #c2540e;
}

body.dark .ms-form-group label {
    color: #fdba74;
}

body.dark .ms-label-tip {
    color: #b45309;
}

body.dark .ms-input,
body.dark .ms-select,
body.dark .ms-textarea {
    background: #2a1f14;
    border-color: #3d2c1a;
    color: #d6c4a8;
}

body.dark .ms-input:focus,
body.dark .ms-select:focus,
body.dark .ms-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
    background: #2f2418;
}

body.dark .ms-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f97316' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

body.dark .ms-input::placeholder,
body.dark .ms-textarea::placeholder {
    color: #6b5540;
}

body.dark .ms-textarea-hint {
    color: #b45309;
}

body.dark .ms-char-count {
    color: #b45309;
}

body.dark .ms-result-body::-webkit-scrollbar-thumb {
    background: #4d3520;
}

body.dark .ms-result-body::-webkit-scrollbar-thumb:hover {
    background: #c2540e;
}

body.dark .ms-result-body:hover::-webkit-scrollbar-track {
    background: #1f160e;
}

body.dark .ms-result-placeholder {
    background: transparent;
}

body.dark .ms-placeholder-title {
    color: #fdba74;
}

body.dark .ms-placeholder-desc {
    color: #b45309;
}

body.dark .ms-result-content {
    background: linear-gradient(135deg, #241a0e 0%, #1e1610 100%);
    border-color: #3d2c1a;
    border-left-color: #f97316;
    color: #d6c4a8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .ms-result-content--error {
    background: #2a1515 !important;
    border-color: #5a2020 !important;
    border-left-color: #ef4444 !important;
}

/* 暗黑：错误块文字颜色适配 */
body.dark .ms-result-error-title {
    color: #f87171;
}

body.dark .ms-result-error-hint {
    color: #fca5a5;
    opacity: 0.85;
}

body.dark .ms-error-retry-btn {
    background: linear-gradient(135deg, #b84b20 0%, #b36b18 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.dark .ms-error-retry-btn:hover {
    background: linear-gradient(135deg, #d45a28 0%, #c97a20 100%);
}

body.dark .ms-result-char.count-normal {
    color: #60a5fa;
    background: #1e2d40;
}

body.dark .ms-result-char.count-warning {
    color: #fbbf24;
    background: #2d2010;
}

body.dark .ms-result-char.count-danger {
    color: #f87171;
    background: #2a1515;
}

body.dark .ms-loading-text {
    color: #fdba74;
}

body.dark .ms-loading-sub {
    color: #b45309;
}

body.dark .ms-modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

body.dark .ms-modal {
    background: #221a13;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark .ms-modal-header {
    background: linear-gradient(135deg, #b84b20 0%, #b36b18 100%);
}

body.dark .ms-modal-body {
    background: #221a13;
}

body.dark .ms-modal-body::-webkit-scrollbar-thumb {
    background: #4d3520;
}

body.dark .ms-modal-body::-webkit-scrollbar-thumb:hover {
    background: #c2540e;
}

body.dark .ms-example-card {
    background: #2a1f14;
    border-color: #3d2c1a;
}

body.dark .ms-example-card:hover {
    background: #332515;
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

body.dark .ms-example-title {
    color: #fdba74;
}

body.dark .ms-example-badge {
    background: #3d2510;
    color: #f97316;
    border-color: #6b4226;
}

body.dark .ms-example-desc {
    color: #b45309;
}

/* ========== 响应式布局 ========== */
@media (max-width: 1024px) {
    .ms-history-panel {
        width: 180px;
    }
    .ms-input-panel {
        width: 340px;
    }
}

@media (max-width: 768px) {
    .ms-container {
        height: auto;
        min-height: unset;
    }

    .ms-main-content {
        flex-direction: column;
        overflow: visible;
    }

    .ms-history-panel {
        width: 100%;
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid #fde8d6;
    }

    .ms-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #fde8d6;
    }

    .ms-result-panel {
        min-height: 300px;
    }

    .ms-result-body {
        min-height: 300px;
    }

    .ms-modal-body {
        grid-template-columns: 1fr;
    }

    .ms-form-row {
        flex-direction: column;
        gap: 0;
    }

    body.dark .ms-history-panel {
        border-bottom-color: #3d2c1a;
    }

    body.dark .ms-input-panel {
        border-bottom-color: #3d2c1a;
    }
}
