/* ===============================================================
   dream_interpretation.css  —  周公解梦样式
   梦幻深紫 + 星空夜蓝主题配色
   参考 cold_jokes.css 布局风格
   =============================================================== */

/* ── 主容器 ─────────────────────────────────────────────── */
.di-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    min-height: 540px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.di-container.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100vh;
    z-index: 9000;
    border-radius: 0;
    border: none;
}

/* ── 顶部工具栏 ───────────────────────────────────────────── */
.di-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 50%, #7c3aed 100%);
    border-bottom: 1px solid #3b0764;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-group + .toolbar-group {
    margin-left: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.25);
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-right: 6px;
    white-space: nowrap;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.55);
    transform: translateY(-1px);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: rgba(255,255,255,0.9);
    color: #5b21b6;
    font-weight: 600;
    border-color: rgba(255,255,255,0.9);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    color: #4c1d95;
}

/* 解梦按钮 loading shimmer 动画 */
.toolbar-btn-primary.di-btn-loading {
    background: linear-gradient(90deg, #4c1d95 0%, #a78bfa 35%, #4c1d95 65%, #3b0764 100%);
    background-size: 200% 100%;
    animation: diBtnShimmer 1.4s ease-in-out infinite;
    color: #fff;
    border-color: transparent;
    cursor: not-allowed;
    opacity: 1;
}

@keyframes diBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.toolbar-btn-danger {
    background: rgba(239,68,68,0.75);
    border-color: rgba(239,68,68,0.9);
    color: #fff;
}

.toolbar-btn-danger:hover:not(:disabled) {
    background: rgba(239,68,68,0.95);
}

/* ── 三栏主布局 ──────────────────────────────────────────── */
.di-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* ── 左栏：历史记录 ───────────────────────────────────────── */
.di-history-panel {
    width: 210px;
    min-width: 170px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #ede9fe;
    overflow: hidden;
    min-height: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 10px;
    background: linear-gradient(to bottom, #faf5ff, #f5f3ff);
    border-bottom: 1px solid #ede9fe;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #5b21b6;
}

.history-count {
    font-size: 10px;
    color: #a78bfa;
    margin-left: 4px;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover { background: #fde8e8; }

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid #ede9fe;
    border-radius: 5px;
    font-size: 12px;
    color: #334155;
    background: #faf5ff;
    outline: none;
}

.history-search input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: #faf5ff; }
.history-list::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

.history-empty {
    padding: 24px 12px;
    text-align: center;
    color: #a78bfa;
    font-size: 12px;
    line-height: 1.8;
}

.history-item {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid #f5f3ff;
    cursor: pointer;
    transition: background 0.15s;
}

.history-item:hover { background: #faf5ff; }
.history-item.active { background: #ede9fe; border-left: 3px solid #7c3aed; }

.history-item-dream {
    font-size: 12px;
    color: #3b0764;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

.history-item-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.history-item-meta span {
    font-size: 10px;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 1px 5px;
    border-radius: 3px;
}

.history-item-del {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #c4b5fd;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
}

.history-item:hover .history-item-del { opacity: 1; }
.history-item-del:hover { background: #fde8e8; color: #ef4444; }

/* ── 中栏：输入配置 ───────────────────────────────────────── */
.di-input-panel {
    width: 320px;
    min-width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #ede9fe;
    overflow: hidden;
    min-height: 0;
}

.panel-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #ede9fe;
    background: linear-gradient(to bottom, #faf5ff, #f5f3ff);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5b21b6;
}

.panel-tip {
    font-size: 11px;
    color: #a78bfa;
}

.di-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 16px;
    overscroll-behavior: contain;
}

.di-input-body::-webkit-scrollbar { width: 4px; }
.di-input-body::-webkit-scrollbar-track { background: #faf5ff; }
.di-input-body::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 2px; }
.di-input-body::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

/* 字段组 */
.di-field-group {
    margin-bottom: 14px;
    position: relative;
}

.di-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4c1d95;
    margin-bottom: 6px;
}

.required-mark {
    color: #ef4444;
    font-size: 12px;
}

.optional-mark {
    color: #a78bfa;
    font-weight: 400;
}

.di-dream-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    font-size: 13px;
    color: #3b0764;
    background: #faf5ff;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    line-height: 1.6;
}

.di-dream-textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
    background: #fff;
}

.di-dream-textarea::placeholder { color: #c4b5fd; }

.di-char-counter {
    text-align: right;
    font-size: 11px;
    color: #a78bfa;
    margin-top: 3px;
}

/* 选项组 */
.di-option-group {
    margin-bottom: 14px;
}

/* 情绪选项 */
.di-mood-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.di-mood-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
    background: #faf5ff;
    min-width: 52px;
    flex: 1;
}

.di-mood-option:hover {
    border-color: #7c3aed;
    background: #ede9fe;
}

.di-mood-option.selected {
    border-color: #7c3aed;
    background: #ede9fe;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}

.di-mood-option .di-opt-icon { font-size: 18px; line-height: 1; }
.di-mood-option .di-opt-name { font-size: 10px; color: #4c1d95; white-space: nowrap; }

/* 风格选项 */
.di-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.di-style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 8px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
    background: #faf5ff;
    text-align: center;
}

.di-style-option:hover {
    border-color: #7c3aed;
    background: #ede9fe;
    transform: translateY(-1px);
}

.di-style-option.selected {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}

.di-style-option .di-opt-icon { font-size: 20px; line-height: 1; }
.di-style-option .di-opt-name { font-size: 12px; font-weight: 600; color: #4c1d95; }
.di-style-option .di-opt-hint { font-size: 10px; color: #a78bfa; }

/* 快捷标签 */
.di-quick-tags { margin-bottom: 14px; }

.di-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.di-quick-tag {
    padding: 4px 9px;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    background: #faf5ff;
    color: #5b21b6;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.di-quick-tag:hover {
    background: #ede9fe;
    border-color: #7c3aed;
    transform: translateY(-1px);
}

.di-quick-tag.active {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #4c1d95;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}

/* 提示框 */
.di-tips-box {
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #5b21b6;
}

.di-tips-box p {
    margin: 0 0 6px;
    font-weight: 600;
    color: #4c1d95;
}

.di-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.di-tips-box li {
    margin-bottom: 4px;
    line-height: 1.5;
    color: #6d28d9;
}

.di-tips-box kbd {
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    color: #4c1d95;
    font-family: monospace;
}

/* ── 右栏：解梦结果 ───────────────────────────────────────── */
.di-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #faf5ff;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.di-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #ede9fe;
    background: linear-gradient(to bottom, #faf5ff, #f5f3ff);
    flex-shrink: 0;
}

.di-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5b21b6;
}

.result-actions-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

@keyframes diReinterpretPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.35); }
    50%       { box-shadow: 0 0 0 6px rgba(124,58,237,0); }
}

.di-reinterpret-btn {
    padding: 5px 12px;
    border: 1px solid #7c3aed;
    border-radius: 5px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    animation: diReinterpretPulse 2.4s ease-in-out infinite;
}

.di-reinterpret-btn:hover {
    background: #ddd6fe;
    transform: translateY(-1px);
    animation: none;
    box-shadow: 0 3px 10px rgba(124,58,237,0.25);
}

.di-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    overscroll-behavior: contain;
}

.di-result-body::-webkit-scrollbar { width: 5px; }
.di-result-body::-webkit-scrollbar-track { background: #f5f3ff; }
.di-result-body::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 3px; }
.di-result-body::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

/* 占位提示 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
    counter-reset: placeholder-step;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: moonFloat 3s ease-in-out infinite;
}

@keyframes moonFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50%       { transform: translateY(-10px) rotate(5deg); }
}

.placeholder-title {
    font-size: 17px;
    font-weight: 600;
    color: #4c1d95;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #8b5cf6;
    margin: 0 0 4px;
    line-height: 1.8;
    counter-increment: placeholder-step;
}

.placeholder-desc::before {
    content: counter(placeholder-step) ". ";
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 700;
}

.placeholder-desc:last-of-type {
    color: #7c3aed;
    font-weight: 600;
    margin-top: 4px;
}

/* 加载中 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
}

.loading-moon {
    font-size: 44px;
    animation: moonSpin 2s linear infinite;
    margin-bottom: 12px;
}

@keyframes moonSpin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7c3aed;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1); opacity: 1; }
}

.loading-text {
    font-size: 14px;
    color: #5b21b6;
    font-weight: 500;
    margin: 0 0 6px;
}

.loading-dream {
    font-size: 12px;
    color: #a78bfa;
    margin: 0;
    max-width: 280px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 解梦结果内容卡片 ─────────────────────────────────────── */
@keyframes diFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.di-result-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: diFadeIn 0.35s ease-out;
}

.di-result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 60%, #ede9fe 100%);
    border-radius: 8px;
    border: 1px solid #c4b5fd;
    font-size: 11px;
    box-shadow: 0 1px 6px rgba(124,58,237,0.1);
}

.di-meta-dream {
    font-weight: 600;
    color: #4c1d95;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.di-meta-style, .di-meta-sentiment, .di-meta-time {
    color: #6d28d9;
    background: rgba(255,255,255,0.7);
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.di-meta-time { color: #a78bfa; margin-left: auto; }

/* 分段 */
.di-section {
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(124,58,237,0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.di-section:hover {
    box-shadow: 0 4px 18px rgba(124,58,237,0.13);
    border-color: #c4b5fd;
}

.di-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #5b21b6;
    margin-bottom: 10px;
    padding-bottom: 6px;
    padding-left: 8px;
    border-left: 3px solid #7c3aed;
    border-bottom: 1px solid #f3f0ff;
    letter-spacing: 0.5px;
}

/* 梦境概述 */
.di-overview-text {
    font-size: 13px;
    color: #3b0764;
    line-height: 1.8;
    margin: 0;
    word-break: break-word;
}

/* 符号卡片网格 */
.di-symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.di-symbol-card {
    background: linear-gradient(135deg, #faf5ff, #ede9fe);
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.di-symbol-card:hover {
    border-color: #a78bfa;
    box-shadow: 0 3px 10px rgba(124,58,237,0.13);
}

.di-symbol-name {
    font-size: 12px;
    font-weight: 700;
    color: #5b21b6;
    margin-bottom: 5px;
}

.di-symbol-meaning {
    font-size: 12px;
    color: #4c1d95;
    line-height: 1.6;
    word-break: break-word;
}

/* 吉凶预兆 */
.di-omen-box {
    font-size: 13px;
    line-height: 1.8;
    padding: 10px 14px;
    border-radius: 7px;
    border-left: 3px solid;
    word-break: break-word;
}

.di-omen-positive {
    background: linear-gradient(135deg, #a7f3d0, #34d399);
    border-left-color: #059669;
    border-left-width: 4px;
    color: #065f46;
}

.di-omen-neutral {
    background: linear-gradient(135deg, #e9d5ff, #c084fc);
    border-left-color: #7c3aed;
    border-left-width: 4px;
    color: #3b0764;
}

.di-omen-negative {
    background: linear-gradient(135deg, #fed7d7, #f87171);
    border-left-color: #ef4444;
    border-left-width: 4px;
    color: #7f1d1d;
}

/* 建议列表 */
.di-suggestions-list {
    margin: 0;
    padding-left: 18px;
    list-style: none;
}

.di-suggestions-list li {
    font-size: 13px;
    color: #3b0764;
    line-height: 1.7;
    margin-bottom: 6px;
    padding-left: 4px;
    position: relative;
    word-break: break-word;
}

.di-suggestions-list li::before {
    content: "✦";
    position: absolute;
    left: -16px;
    color: #7c3aed;
    font-size: 10px;
    top: 4px;
}

/* 幸运提示 */
.di-lucky-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #3b0764 0%, #4c1d95 35%, #6d28d9 70%, #7c3aed 100%);
    color: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    box-shadow: 0 4px 18px rgba(76,29,149,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.di-lucky-icon {
    font-size: 20px;
    flex-shrink: 0;
    animation: diLuckyFloat 2.5s ease-in-out infinite;
}

@keyframes diLuckyFloat {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50%       { transform: rotate(8deg) scale(1.2); }
}
.di-lucky-text { line-height: 1.5; word-break: break-word; }

/* 错误提示 */
.di-error-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.di-error-icon { font-size: 44px; margin-bottom: 12px; }
.di-error-msg { font-size: 14px; color: #ef4444; margin: 0 0 6px; }
.di-error-hint { font-size: 12px; color: #a78bfa; margin: 0 0 16px; }

.error-retry-btn {
    padding: 8px 20px;
    background: #ede9fe;
    border: 1px solid #7c3aed;
    border-radius: 6px;
    color: #5b21b6;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.error-retry-btn:hover { background: #ddd6fe; transform: translateY(-1px); }

/* 结果内容与错误容器基础规则 */
.result-content {
    word-break: break-word;
}

.result-error-wrap {
    flex-shrink: 0;
}

/* ── 示例模态框 ──────────────────────────────────────────── */
.di-modal-overlay {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    position: fixed;
    inset: 0;
    background: rgba(76,29,149,0.4);
    z-index: 10000;
    backdrop-filter: blur(3px);
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.di-modal-overlay.show {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
}

.di-modal {
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 680px;
    max-width: 95vw;
    max-height: 75vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(76,29,149,0.3);
    z-index: 10001;
    overflow: hidden;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, visibility 0s linear 0.25s;
}

.di-modal.show {
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, visibility 0s linear 0s;
}

.di-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
    flex-shrink: 0;
}

.di-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.di-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.di-modal-close:hover { background: rgba(255,255,255,0.35); }

.di-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.di-modal-body::-webkit-scrollbar { width: 5px; }
.di-modal-body::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 3px; }
.di-modal-body::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

/* 示例网格 */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.example-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #ede9fe;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.18s;
    background: #faf5ff;
}

.example-card:hover {
    border-color: #7c3aed;
    background: #ede9fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.12);
}

.example-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }

.example-info { flex: 1; min-width: 0; }

.example-label {
    font-size: 13px;
    font-weight: 600;
    color: #3b0764;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.example-desc {
    font-size: 11px;
    color: #a78bfa;
    margin-bottom: 5px;
}

.example-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.example-badge {
    font-size: 10px;
    background: #ede9fe;
    color: #5b21b6;
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ── AI输出表格样式 ──────────────────────────────────────── */
.di-result-wrapper table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(124,58,237,0.08);
}

.di-result-wrapper th {
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.di-result-wrapper td {
    padding: 7px 12px;
    border-bottom: 1px solid #ede9fe;
    color: #3b0764;
    word-break: break-word;
    line-height: 1.6;
}

.di-result-wrapper tr:nth-child(even) td {
    background: #faf5ff;
}

.di-result-wrapper tr:hover td {
    background: #ede9fe;
    transition: background 0.15s;
}

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .di-history-panel { display: none; }
    .di-input-panel { width: 280px; min-width: 240px; }
}

@media (max-width: 640px) {
    .di-input-panel {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #ede9fe;
        max-height: 50%;
    }
    .di-main-content { flex-direction: column; }
    .di-style-grid { grid-template-columns: repeat(4, 1fr); }
}
