/* =============================================
   法律助理 - legal_assistant.css
   深蓝 · 金色 法律主题，三栏布局
   ============================================= */

/* ========== 主容器 ========== */
.la-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4fb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(26, 58, 107, 0.13);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.la-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;
}

/* ========== 顶部工具栏 ========== */
.la-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1a3a6b 0%, #2a5298 60%, #1e4080 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(26, 58, 107, 0.4);
    flex-shrink: 0;
}

.la-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* 主操作按钮（法律分析） */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #D4AF37 0%, #b8971e 100%) !important;
    border-color: #D4AF37 !important;
    color: #1a2540 !important;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.45);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e8c84a 0%, #c9a828 100%) !important;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.55) !important;
    color: #1a2540 !important;
}

/* ========== 表单校验抖动 ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70%  { transform: translateX(5px); }
}

.la-input.shake,
.la-select.shake,
.la-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;
}

/* ========== 主内容区：三栏 ========== */
.la-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4fb;
}

/* ========== 左栏：历史记录 ========== */
.la-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #d0dbe8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #f4f7fb 0%, #eaf0f8 100%);
    border-bottom: 1px solid #d0dbe8;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a6b;
}

.history-count {
    font-size: 11px;
    color: #7a9cc8;
    font-weight: 400;
}

.history-limit-footer {
    flex-shrink: 0;
    padding: 5px 8px;
    text-align: center;
    font-size: 10px;
    color: #a0b4cc;
    border-top: 1px solid #d0dbe8;
    background: #f4f7fb;
    letter-spacing: 0.2px;
    user-select: none;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #d0dbe8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c8d8ea;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
}

.history-search input:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.13);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list:hover::-webkit-scrollbar-track { background: #eaf0f8; }
.history-list::-webkit-scrollbar-thumb { background: #c5d4e4; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #2a5298; }

.history-empty {
    text-align: center;
    color: #7a9cc8;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
}

@keyframes hiFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #f4f7fb;
    border: 1px solid #d0dbe8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: hiFadeIn 0.2s ease;
}

.history-item:hover {
    background: #eaf0f8;
    border-color: #2a5298;
    transform: translateX(2px);
}

.history-item.active {
    background: #e6edf8;
    border-color: #D4AF37;
    box-shadow: 0 1px 3px rgba(212, 175, 55, 0.3);
}

.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;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

.history-item-category {
    font-size: 12px;
    font-weight: 600;
    color: #1a3a6b;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.history-item-preview {
    font-size: 11px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.history-item-time {
    font-size: 10px;
    color: #7a9cc8;
}

/* ========== 中栏：表单输入 ========== */
.la-input-panel {
    width: 380px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #d0dbe8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：结果展示 ========== */
.la-result-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

/* ========== 通用面板头部 ========== */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f4f7fb 0%, #eaf0f8 100%);
    border-bottom: 1px solid #d0dbe8;
    flex-shrink: 0;
}

/* 输入/结果面板标题：绿色左边框装饰（规范）*/
.la-input-panel .panel-header h3,
.la-result-panel .panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a6b;
    white-space: nowrap;
    border-left: 4px solid #2ECC71;
    padding-left: 10px;
}

.panel-tip {
    font-size: 11px;
    color: #7a9cc8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.result-category-tag {
    font-size: 11px;
    color: #1a3a6b;
    background: #e6edf8;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.result-mode-tag {
    font-size: 10px;
    color: #2a5298;
    background: rgba(42, 82, 152, 0.1);
    border: 1px solid rgba(42, 82, 152, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-time {
    font-size: 11px;
    color: #7a9cc8;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-regen-btn {
    flex-shrink: 0;
    padding: 3px 9px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    color: #8a6e00;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.6;
}

.result-regen-btn:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: #D4AF37;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.result-regen-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ========== 中栏表单体 ========== */
.la-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.la-input-body::-webkit-scrollbar { width: 4px; }
.la-input-body::-webkit-scrollbar-track { background: transparent; }
.la-input-body:hover::-webkit-scrollbar-track { background: #eaf0f8; }
.la-input-body::-webkit-scrollbar-thumb { background: #c5d4e4; border-radius: 2px; }
.la-input-body::-webkit-scrollbar-thumb:hover { background: #2a5298; }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1a3a6b;
    margin-bottom: 5px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

.la-input,
.la-select,
.la-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c8d8ea;
    border-radius: 5px;
    font-size: 13px;
    color: #1a2540;
    background: #f8fafd;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.la-input:focus,
.la-select:focus,
.la-textarea:focus {
    border-color: #2a5298;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.12);
}

.la-input:hover:not(:focus),
.la-select:hover:not(:focus),
.la-textarea:hover:not(:focus) {
    border-color: #7a9cc8;
    background: #fff;
}

.la-input::placeholder,
.la-textarea::placeholder {
    color: #a0b4cc;
}

.la-textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.65;
}

.la-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.la-textarea-hint {
    font-size: 11px;
    color: #a0b4cc;
    user-select: none;
}

#charCount {
    font-size: 11px;
    color: #a0b4cc;
    transition: color 0.2s;
}

#charCount.warn   { color: #f97316; font-weight: 600; }
#charCount.danger { color: #ef4444; font-weight: 600; }

.la-textarea::-webkit-scrollbar { width: 4px; }
.la-textarea::-webkit-scrollbar-track { background: transparent; }
.la-textarea:hover::-webkit-scrollbar-track { background: #eaf0f8; }
.la-textarea::-webkit-scrollbar-thumb { background: #c5d4e4; border-radius: 2px; }
.la-textarea::-webkit-scrollbar-thumb:hover { background: #2a5298; }

.la-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%232a5298'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* 禁用态 */
.la-input:disabled,
.la-select:disabled,
.la-textarea:disabled {
    background: #f0f4fb !important;
    color: #9ba8ba !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #d8e4f0 !important;
    box-shadow: none !important;
}

.la-input:disabled::placeholder,
.la-textarea:disabled::placeholder {
    color: #a0b4cc;
}

/* ========== 结果区域 ========== */
.la-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.la-result-body::-webkit-scrollbar { width: 4px; }
.la-result-body::-webkit-scrollbar-track { background: transparent; }
.la-result-body:hover::-webkit-scrollbar-track { background: #eaf0f8; }
.la-result-body::-webkit-scrollbar-thumb { background: #c5d4e4; border-radius: 2px; }
.la-result-body::-webkit-scrollbar-thumb:hover { background: #2a5298; }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    text-align: center;
    user-select: none;
}

@keyframes laScalesFloat {
    0%, 100% { transform: translateY(0);    opacity: 0.85; }
    50%       { transform: translateY(-8px); opacity: 1;    }
}

.placeholder-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: laScalesFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(26, 58, 107, 0.18));
}

.placeholder-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a3a6b;
    margin: 0 0 12px;
}

.placeholder-desc {
    font-size: 13px;
    color: #7a9cc8;
    margin: 4px 0;
    line-height: 1.65;
}

.placeholder-disclaimer {
    margin-top: 28px;
    font-size: 12px;
    color: #8a6e00;
    padding: 12px 18px;
    border-left: 3px solid #D4AF37;
    text-align: left;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.07) 0%, rgba(26, 58, 107, 0.04) 100%);
    border-radius: 0 6px 6px 0;
    max-width: 380px;
    line-height: 1.7;
}

/* ========== 加载动画：天平 ========== */
.result-loading {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.loading-scales-wrap {
    margin-bottom: 22px;
    position: relative;
}

.loading-scales {
    width: 80px;
    height: 60px;
    position: relative;
    margin: 0 auto;
}

.scale-beam {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #2a5298;
    border-radius: 2px;
    transform-origin: center center;
    animation: scaleBeam 2s ease-in-out infinite;
}

.scale-left,
.scale-right {
    position: absolute;
    top: 14px;
    width: 20px;
    height: 20px;
    border: 2px solid #2a5298;
    border-radius: 3px;
    background: rgba(212, 175, 55, 0.25);
}

.scale-left  { left: 2px;  animation: scaleLeft  2s ease-in-out infinite; }
.scale-right { right: 2px; animation: scaleRight 2s ease-in-out infinite; }

@keyframes scaleBeam {
    0%, 100% { transform: translateX(-50%) rotate(-8deg); }
    50%       { transform: translateX(-50%) rotate(8deg);  }
}

@keyframes scaleLeft {
    0%, 100% { transform: translateY(6px); }
    50%       { transform: translateY(-6px); }
}

@keyframes scaleRight {
    0%, 100% { transform: translateY(-6px); }
    50%       { transform: translateY(6px); }
}

.loading-text {
    font-size: 13px;
    color: #7a9cc8;
    font-weight: 500;
    margin: 0 0 16px;
}

/* 加载进度光条 */
@keyframes laLoadingBar {
    0%   { left: -40%; width: 30%; }
    50%  { width: 40%; }
    100% { left: 110%; width: 30%; }
}

.la-loading-bar {
    position: relative;
    width: 240px;
    max-width: 80%;
    height: 3px;
    background: rgba(42, 82, 152, 0.12);
    border-radius: 2px;
    overflow: hidden;
    margin: 4px auto 0;
}

.la-loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%; /* 与 @keyframes laLoadingBar 0% 保持一致，防止首帧跳变 */
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, #D4AF37 40%, #2a5298 60%, transparent 100%);
    animation: laLoadingBar 1.8s ease-in-out infinite;
    border-radius: 2px;
}

/* ========== 结果内容区 ========== */
@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content {
    flex: 1;
    min-height: 0;
    padding: 28px 32px;
    font-size: 14px;
    line-height: 1.9;
    color: #1a2540;
    word-break: break-word;
    overflow-wrap: break-word;
    border-left: 4px solid #D4AF37;
    background: linear-gradient(to bottom, #fdfeff 0%, #fff 100%);
}

/* 结果淡入动效（类触发，支持重播） */
.result-content.la-result-enter {
    animation: resultFadeIn 0.4s ease;
}

.result-content.result-content--error {
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fff;
}

.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    flex: 1;
    min-height: 200px;
}

.result-error-icon  { font-size: 40px; margin-bottom: 16px; line-height: 1; }
.result-error-title { font-size: 14px; font-weight: 600; color: #dc2626; margin: 0 0 8px; }
.result-error-hint  { font-size: 12px; color: #9ca3af; margin: 0; }

.la-retry-btn {
    margin-top: 18px;
    padding: 9px 24px;
    background: linear-gradient(135deg, #2a5298 0%, #1a3a6b 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(26, 58, 107, 0.3);
}

.la-retry-btn:hover {
    background: linear-gradient(135deg, #3565bb 0%, #22488a 100%);
    box-shadow: 0 4px 14px rgba(26, 58, 107, 0.4);
    transform: translateY(-1px);
}

.la-retry-btn:active { transform: translateY(0); }

/* 段落样式 */
.result-content p { margin: 0 0 1.1em; line-height: 1.9; }
.result-content p:last-child { margin-bottom: 0; }
.result-content .result-blank-line { margin: 0; height: 0.5em; }

/* 法律分析结构化标题（【法律依据】等）—— 提升选择器优先级，确保覆盖通用 p 规则 */
.result-content p.result-section-title {
    font-weight: 700;
    color: #1a3a6b;
    padding: 6px 12px;
    background: linear-gradient(to right, rgba(212, 175, 55, 0.15) 0%, rgba(26, 58, 107, 0.05) 100%);
    border-left: 3px solid #D4AF37;
    border-radius: 0 4px 4px 0;
    margin: 1.2em 0 0.5em;
    font-size: 13px;
    line-height: 1.6;
}

/* 列表、代码、分隔线、标题等富文本元素（规范 207c57f8 / a26312bf）*/
.result-content ul,
.result-content ol {
    padding-left: 1.6em;
    margin: 0.4em 0 1em;
}

.result-content ul li,
.result-content ol li {
    margin-bottom: 0.4em;
    line-height: 1.8;
}

.result-content ul li::marker,
.result-content ol li::marker {
    color: #1a3a6b;
    font-weight: 600;
}

.result-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #2ECC71;
    background: rgba(46, 204, 113, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.result-content hr {
    border: none;
    border-top: 1px solid rgba(26, 58, 107, 0.1);
    margin: 1.2em 0;
}

.result-content h1,
.result-content h2 {
    border-left: 4px solid #2ECC71;
    padding-left: 10px;
    font-size: 15px;
    color: #1a3a6b;
    margin: 1.2em 0 0.6em;
    line-height: 1.5;
}

/* 分析模式 → 结果区左边框色 */
.result-content[data-mode="detailed"] { border-left-color: #D4AF37; }
.result-content[data-mode="quick"]    { border-left-color: #2a5298; }
.result-content[data-mode="case"]     { border-left-color: #2ECC71; }

/* ========== 示例模态框 ========== */
.la-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 22, 50, 0.45);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.la-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 90%;
    max-width: 780px;
    max-height: 82vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(26, 58, 107, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: laModalSlideIn 0.22s ease-out;
}

@keyframes laModalSlideIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 16px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.la-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.la-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #d0dbe8;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a3a6b 0%, #2a5298 100%);
    color: #fff;
}

.la-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.la-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.la-modal-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.la-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    align-content: start;
}

.la-modal-body::-webkit-scrollbar { width: 4px; }
.la-modal-body::-webkit-scrollbar-track { background: transparent; }
.la-modal-body:hover::-webkit-scrollbar-track { background: #eaf0f8; }
.la-modal-body::-webkit-scrollbar-thumb { background: #c5d4e4; border-radius: 2px; }
.la-modal-body::-webkit-scrollbar-thumb:hover { background: #2a5298; }

/* ========== 示例卡片 ========== */
.example-card {
    border: 1px solid #d0dbe8;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafd;
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #D4AF37 0%, #2a5298 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.example-card:hover {
    border-color: #2a5298;
    background: #eaf0f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(26, 58, 107, 0.14);
}

.example-card:hover::before { opacity: 1; }

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a3a6b;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.example-card-badge {
    font-size: 10px;
    font-weight: 500;
    background: #e6edf8;
    color: #2a5298;
    padding: 1px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.example-card-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}

.example-card-import {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #1a3a6b;
    background: #e6edf8;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: #2a5298;
    color: #fff;
}

/* ========== 响应式布局 ========== */
@media (max-width: 1100px) {
    .la-input-panel { width: 320px; }
    .panel-tip { display: none; }
}

@media (max-width: 800px) {
    .la-main-content { flex-direction: column; overflow-y: auto; }
    .la-history-panel { width: 100%; max-height: 160px; border-right: none; border-bottom: 1px solid #d0dbe8; }
    .la-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #d0dbe8; max-height: 440px; }
    .la-result-panel { width: 100%; min-height: 300px; }
    .la-modal-body { grid-template-columns: 1fr; }
}

/* ========== 打印样式 ========== */
@media print {
    .la-toolbar,
    .la-history-panel,
    .la-input-panel,
    #resultPlaceholder,
    #resultLoading { display: none !important; }
    .la-container,
    .la-container.fullscreen { position: static !important; height: auto; box-shadow: none; }
    .la-main-content { display: block; }
    .la-result-panel { width: 100%; }
    .la-result-body { overflow: visible; }
    .result-content { padding: 0; }
}

/* ========== 暗黑模式（body.dark） ========== */
body.dark .la-container {
    background: #0f1827;
}

body.dark .la-main-content {
    background: #0f1827;
}

body.dark .la-history-panel,
body.dark .la-input-panel,
body.dark .la-result-panel {
    background: #131f33;
    border-color: rgba(42, 82, 152, 0.25);
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #192840 0%, #131f33 100%);
    border-color: rgba(42, 82, 152, 0.2);
}

body.dark .history-panel-header h3 {
    color: #7ab0e8;
}

body.dark .history-limit-footer {
    background: #0f1827;
    color: #3a5070;
    border-color: rgba(42, 82, 152, 0.2);
}

body.dark .history-search input {
    background: #192840;
    border-color: rgba(42, 82, 152, 0.3);
    color: #c8d8ea;
}

body.dark .history-search input:focus {
    border-color: #4a72c4;
    box-shadow: 0 0 0 2px rgba(74, 114, 196, 0.2);
}

body.dark .history-search input::placeholder { color: #3a5070; }

body.dark .history-item {
    background: #192840;
    border-color: rgba(42, 82, 152, 0.25);
}

body.dark .history-item:hover {
    background: #1e3050;
    border-color: #4a72c4;
}

body.dark .history-item.active {
    background: #1e3050;
    border-color: #D4AF37;
}

body.dark .history-item-category { color: #7ab0e8; }
body.dark .history-item-preview  { color: #4a6070; }
body.dark .history-item-time     { color: #3a5878; }
body.dark .history-empty         { color: #3a5070; }

body.dark .history-list::-webkit-scrollbar-thumb { background: #2a4870; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #4a72c4; }
body.dark .history-list:hover::-webkit-scrollbar-track { background: #192840; }

body.dark .panel-header {
    background: linear-gradient(to bottom, #192840 0%, #131f33 100%);
    border-color: rgba(42, 82, 152, 0.2);
}

body.dark .la-input-panel .panel-header h3,
body.dark .la-result-panel .panel-header h3 {
    color: #7ab0e8;
}

body.dark .panel-tip { color: #3a5878; }

body.dark .la-input-body::-webkit-scrollbar-thumb { background: #2a4870; }
body.dark .la-input-body::-webkit-scrollbar-thumb:hover { background: #4a72c4; }
body.dark .la-input-body:hover::-webkit-scrollbar-track { background: #192840; }

body.dark .form-group label { color: #7ab0e8; }

body.dark .la-input,
body.dark .la-select,
body.dark .la-textarea {
    background: #192840;
    border-color: rgba(42, 82, 152, 0.3);
    color: #c8d8ea;
}

body.dark .la-input:focus,
body.dark .la-select:focus,
body.dark .la-textarea:focus {
    background: #1e3050;
    border-color: #4a72c4;
    box-shadow: 0 0 0 3px rgba(74, 114, 196, 0.18);
}

body.dark .la-input:hover:not(:focus),
body.dark .la-select:hover:not(:focus),
body.dark .la-textarea:hover:not(:focus) {
    border-color: #3a5878;
    background: #1e2d42;
}

body.dark .la-input::placeholder,
body.dark .la-textarea::placeholder { color: #3a5070; }

body.dark .la-textarea-hint { color: #3a5878; }

body.dark .la-input:disabled,
body.dark .la-select:disabled,
body.dark .la-textarea:disabled {
    background: #111d2e !important;
    color: #3a5070 !important;
    border-color: rgba(42, 82, 152, 0.15) !important;
}

body.dark .la-textarea::-webkit-scrollbar-thumb { background: #2a4870; }
body.dark .la-textarea::-webkit-scrollbar-thumb:hover { background: #4a72c4; }
body.dark .la-textarea:hover::-webkit-scrollbar-track { background: #192840; }

body.dark .la-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a72c4'/%3E%3C/svg%3E");
}

body.dark .la-result-body {
    background: #131f33;
}

body.dark .la-result-body::-webkit-scrollbar-thumb { background: #2a4870; }
body.dark .la-result-body::-webkit-scrollbar-thumb:hover { background: #4a72c4; }
body.dark .la-result-body:hover::-webkit-scrollbar-track { background: #192840; }

body.dark .placeholder-title    { color: #7ab0e8; }
body.dark .placeholder-desc     { color: #3a5878; }
body.dark .placeholder-disclaimer {
    color: #a08040;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(26, 58, 107, 0.08) 100%);
    border-color: rgba(212, 175, 55, 0.35);
}

body.dark .scale-beam,
body.dark .scale-left,
body.dark .scale-right {
    border-color: #4a72c4;
    background: rgba(212, 175, 55, 0.12);
}

body.dark .scale-beam { background: #4a72c4; }
body.dark .loading-text { color: #3a5878; }

body.dark .la-loading-bar {
    background: rgba(74, 114, 196, 0.15);
}

body.dark .la-loading-bar::after {
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.7) 40%, #4a72c4 60%, transparent 100%);
}

body.dark .result-content {
    background: linear-gradient(to bottom, #141f32 0%, #131f33 100%);
    color: #c8d8ea;
    /* 暗黑模式下边框颜色显式覆盖（规范） */
    border-left-color: rgba(212, 175, 55, 0.65);
}

/* 暗黑模式下按分析模式覆盖边框颜色 */
body.dark .result-content[data-mode="detailed"] { border-left-color: rgba(212, 175, 55, 0.65); }
body.dark .result-content[data-mode="quick"]    { border-left-color: rgba(74, 114, 196, 0.8); }
body.dark .result-content[data-mode="case"]     { border-left-color: rgba(46, 204, 113, 0.75); }

body.dark .result-content.result-content--error {
    background: #131f33;
}

body.dark .result-content p.result-section-title {
    color: #7ab0e8;
    background: linear-gradient(to right, rgba(212, 175, 55, 0.1) 0%, rgba(26, 58, 107, 0.12) 100%);
    border-left-color: rgba(212, 175, 55, 0.5);
}

/* 暗黑：富文本元素 */
body.dark .result-content ul li::marker,
body.dark .result-content ol li::marker {
    color: #7ab0e8;
}

body.dark .result-content code {
    color: #2ECC71;
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.18);
}

body.dark .result-content hr {
    border-top-color: rgba(74, 114, 196, 0.2);
}

body.dark .result-content h1,
body.dark .result-content h2 {
    color: #7ab0e8;
    border-left-color: #2ECC71;
}

body.dark .result-category-tag {
    background: #1e3050;
    color: #7ab0e8;
}

body.dark .result-mode-tag {
    background: rgba(74, 114, 196, 0.12);
    border-color: rgba(74, 114, 196, 0.25);
    color: #7ab0e8;
}

body.dark .result-time { color: #3a5878; }

body.dark .result-regen-btn {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.25);
    color: #c8a830;
}

body.dark .result-regen-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
}

body.dark .result-error-title { color: #f87171; }
body.dark .result-error-hint  { color: #4a6080; }

body.dark .la-retry-btn {
    background: linear-gradient(135deg, #2a5298 0%, #1a3a6b 100%);
}

body.dark .la-retry-btn:hover {
    background: linear-gradient(135deg, #3565bb 0%, #22488a 100%);
}

body.dark .la-modal {
    background: #131f33;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body.dark .la-modal-body {
    background: #131f33;
}

body.dark .la-modal-body::-webkit-scrollbar-thumb { background: #2a4870; }
body.dark .la-modal-body::-webkit-scrollbar-thumb:hover { background: #4a72c4; }
body.dark .la-modal-body:hover::-webkit-scrollbar-track { background: #192840; }

body.dark .example-card {
    background: #192840;
    border-color: rgba(42, 82, 152, 0.3);
}

body.dark .example-card:hover {
    background: #1e3050;
    border-color: #4a72c4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.dark .example-card-title   { color: #7ab0e8; }
body.dark .example-card-badge   { background: #1e3050; color: #4a72c4; }
body.dark .example-card-desc    { color: #4a6080; }

body.dark .example-card-import {
    background: #1e3050;
    color: #7ab0e8;
}

body.dark .example-card-import:hover {
    background: #4a72c4;
    color: #fff;
}

body.dark #charCount { color: #3a5878; }
body.dark #charCount.warn   { color: #f97316; }
body.dark #charCount.danger { color: #ef4444; }
