/* ========================================
   辩论大师 debate_master.css
   主题色：正方红 #e53935 / 反方蓝 #1e88e5 / 工具栏深色 #1a2035
   ======================================== */

/* ========== 主容器 ========== */
.dm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.dm-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.dm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1a2035 0%, #263050 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(26, 32, 53, 0.4);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    margin-right: 6px;
    letter-spacing: 0.5px;
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
    transition: all 0.25s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border-color: #e53935;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.45);
}

/* ========== 主内容三栏布局 ========== */
.dm-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4f8;
}

/* ========== 左栏：历史记录 ========== */
.dm-history-panel {
    width: 195px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.history-count {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.history-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
    color: #ef4444;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #f0f4f8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}

.history-search input:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.1);
    background: white;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 20px 10px;
}

.history-item {
    padding: 9px 10px;
    margin-bottom: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.history-item.active {
    background: #fef2f2;
    border-color: #e53935;
    box-shadow: 0 1px 4px rgba(229, 57, 53, 0.15);
}

.history-item.active-con {
    background: #eff6ff;
    border-color: #1e88e5;
    box-shadow: 0 1px 4px rgba(30, 136, 229, 0.15);
}

.history-item-topic {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-item-position {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
}

.history-item-position.pro {
    background: #fef2f2;
    color: #e53935;
}

.history-item-position.con {
    background: #eff6ff;
    color: #1e88e5;
}

.history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

.history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #fde8e8;
    color: #ef4444;
}

/* ========== 中栏：参数设置 ========== */
.dm-input-panel {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
}

.panel-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f0f4f8;
    background: linear-gradient(to bottom, #fafafa 0%, #f8f9fa 100%);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.panel-tip {
    font-size: 11px;
    color: #94a3b8;
}

.dm-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 7px;
}

.label-required {
    color: #e53935;
}

.label-tip {
    font-weight: 400;
    color: #94a3b8;
    font-size: 11px;
}

/* 辩题文本域 */
.dm-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fafafa;
    color: #1e293b;
}

.dm-textarea:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    background: white;
}

.dm-textarea::placeholder {
    color: #94a3b8;
    font-size: 12px;
}

.char-counter {
    text-align: right;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* 立场选择器 */
.position-selector {
    display: flex;
    gap: 10px;
}

.position-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.25s;
    gap: 3px;
}

.position-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.position-btn.pro.active {
    border-color: #e53935;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: 0 3px 10px rgba(229, 57, 53, 0.2);
}

.position-btn.con.active {
    border-color: #1e88e5;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 3px 10px rgba(30, 136, 229, 0.2);
}

.pos-icon {
    font-size: 20px;
    line-height: 1;
}

.pos-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.pos-desc {
    font-size: 10px;
    color: #64748b;
}

/* 下拉选择 */
.dm-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    background: #fafafa;
    color: #1e293b;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.dm-select:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    background-color: white;
}

/* 论点深度选择 */
.depth-selector {
    display: flex;
    gap: 8px;
}

.depth-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    gap: 2px;
}

.depth-btn:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.depth-btn.active {
    border-color: #e53935;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #e53935;
}

.depth-name {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
}

.depth-count {
    font-size: 10px;
    color: #94a3b8;
}

.depth-btn.active .depth-count {
    color: #e57373;
}

/* 热门辩题快捷按钮压感 */
.hot-topic-btn.hot-topic-pressing {
    transform: scale(0.94) translateY(1px);
    box-shadow: none;
    opacity: 0.82;
}

/* 热门辩题 */
.hot-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hot-topic-btn {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    font-size: 11px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.hot-topic-btn:hover {
    border-color: #e53935;
    background: #fef2f2;
    color: #e53935;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.15);
}

/* 生成主按钮 */
.generate-main-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
    letter-spacing: 0.5px;
}

.generate-main-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    box-shadow: 0 6px 18px rgba(229, 57, 53, 0.4);
    transform: translateY(-2px);
}

.generate-main-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.generate-main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-hint {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin: 6px 0 0 0;
}

/* ========== 右栏：论点展示区 ========== */
.dm-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
    min-width: 320px;
}

.dm-result-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    flex-direction: row;
}

.dm-result-panel .panel-header h3 {
    margin: 0;
    flex-shrink: 0;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-meta-position {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fef2f2;
    color: #e53935;
}

.result-meta-position.con {
    background: #eff6ff;
    color: #1e88e5;
}

.result-point-count {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 10px;
}

.result-time {
    font-size: 10px;
    color: #94a3b8;
}

.dm-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* 自定义滚动条 */
.dm-result-body::-webkit-scrollbar,
.dm-input-body::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 5px;
}

.dm-result-body::-webkit-scrollbar-track,
.dm-input-body::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.dm-result-body::-webkit-scrollbar-thumb,
.dm-input-body::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.dm-result-body::-webkit-scrollbar-thumb:hover,
.dm-input-body::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* 占位区域 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 40px 20px;
    text-align: center;
    min-height: 260px;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 18px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 辩题输入框空提交抖动 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-7px); }
    40%       { transform: translateX(7px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.dm-textarea.shake {
    animation: shake 0.42s ease-in-out;
    border-color: #e53935 !important;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.18) !important;
}

.placeholder-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 4px 0;
}

.placeholder-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
}

.debate-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    cursor: default;
}

.debate-tag:hover {
    background: #fef2f2;
    border-color: #e53935;
    color: #e53935;
}

/* 错误状态 */
.result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 40px 20px;
    text-align: center;
    min-height: 260px;
}

.result-error-icon {
    font-size: 44px;
    margin-bottom: 14px;
    line-height: 1;
}

.result-error-msg {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 7px;
}

.result-error-hint {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.6;
}

.result-error-retry {
    padding: 8px 20px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s;
    box-shadow: 0 3px 10px rgba(229, 57, 53, 0.28);
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(229, 57, 53, 0.38);
}

/* 加载动画 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 40px 20px;
    min-height: 260px;
}

.loading-arena {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.loading-sword-left,
.loading-shield-right {
    font-size: 36px;
    animation: sway 1.5s ease-in-out infinite;
}

.loading-sword-left {
    animation-direction: alternate;
}

.loading-shield-right {
    animation-direction: alternate-reverse;
}

@keyframes sway {
    0% { transform: translateX(-6px) rotate(-8deg); }
    100% { transform: translateX(6px) rotate(8deg); }
}

/* AI加载指示器（三点弹跳） */
.ai-loading-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-loading-indicator span {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
    animation: bounce 1.2s infinite ease-in-out;
}

.ai-loading-indicator span:nth-child(2) {
    animation-delay: 0.2s;
    background: #6366f1;
}

.ai-loading-indicator span:nth-child(3) {
    animation-delay: 0.4s;
    background: #1e88e5;
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
    40% { transform: translateY(-14px); opacity: 1; }
}

.loading-text {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    animation: pulse-text 1.8s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========== 论点卡片 ========== */
.point-cards-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-self: flex-start;
    width: 100%;
}

.point-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: cardSlideIn 0.3s ease-out;
    transition: all 0.2s;
}

.point-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.point-card.pro-card {
    border-left: 4px solid #e53935;
}

.point-card.con-card {
    border-left: 4px solid #1e88e5;
}

.point-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to right, #fef2f2 0%, #fafafa 100%);
    border-bottom: 1px solid #f0f4f8;
}

.point-card.con-card .point-card-header {
    background: linear-gradient(to right, #eff6ff 0%, #fafafa 100%);
}

.point-card-number {
    font-size: 13px;
    font-weight: 700;
    color: #e53935;
    display: flex;
    align-items: center;
    gap: 6px;
}

.point-card.con-card .point-card-number {
    color: #1e88e5;
}

.point-card-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e53935;
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.point-card.con-card .point-card-num-badge {
    background: #1e88e5;
}

.point-card-actions {
    display: flex;
    gap: 6px;
}

.point-action-btn {
    padding: 4px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.point-action-btn:hover {
    border-color: #e53935;
    color: #e53935;
    background: #fef2f2;
}

.point-card.con-card .point-action-btn:hover {
    border-color: #1e88e5;
    color: #1e88e5;
    background: #eff6ff;
}

.point-card-body {
    padding: 14px 16px;
}

/* 核心论断 */
.point-claim {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.6;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

/* 论据列表 */
.point-evidences {
    margin-bottom: 10px;
}

.point-evidences-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.point-evidence-item {
    font-size: 13px;
    color: #334155;
    line-height: 1.65;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: #f8fafc;
    border-radius: 5px;
    border-left: 3px solid #e2e8f0;
}

/* 应对反驳 */
.point-rebuttal {
    font-size: 12px;
    color: #64748b;
    padding: 7px 11px;
    background: #fffbeb;
    border-radius: 5px;
    border-left: 3px solid #f59e0b;
    line-height: 1.6;
    margin-top: 10px;
}

.point-rebuttal-label {
    font-weight: 600;
    color: #d97706;
    font-size: 11px;
    margin-right: 4px;
}

/* 原始内容展示（解析失败降级） */
.point-raw-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== 示例模态框 ========== */
.dm-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100001;
    backdrop-filter: blur(2px);
}

.dm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100002;
    width: 640px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    animation: modalIn 0.2s ease-out;
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -54%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.dm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a2035 0%, #263050 100%);
    color: white;
}

.dm-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.dm-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.dm-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
    align-content: start;
}

.example-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.example-card:hover {
    border-color: #e53935;
    background: #fef2f2;
    box-shadow: 0 3px 12px rgba(229, 57, 53, 0.1);
    transform: translateY(-2px);
}

.example-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.example-card-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.example-card-badge.pro {
    background: #fef2f2;
    color: #e53935;
}

.example-card-badge.con {
    background: #eff6ff;
    color: #1e88e5;
}

.example-card-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.example-card-import {
    padding: 5px 10px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    transform: translateY(-1px);
}

/* ========== 暗黑模式 ========== */
body.dark .dm-container {
    background: #0f172a;
}

body.dark .dm-toolbar {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

body.dark .dm-main-content {
    background: #0f172a;
}

body.dark .dm-history-panel,
body.dark .dm-input-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .history-panel-header {
    background: #263244;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .history-panel-header h3 {
    color: #cbd5e1;
}

body.dark .history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .history-search input::placeholder {
    color: #94a3b8;
}

body.dark .history-search input:focus {
    border-color: #e53935;
    background: #1e293b;
}

body.dark .history-empty {
    color: #94a3b8;
}

body.dark .history-item {
    background: #263244;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .history-item:hover {
    background: #2d3a50;
}

body.dark .history-item.active {
    background: #3b1f1f;
    border-color: #e53935;
}

body.dark .history-item.active-con {
    background: #1a2a40;
    border-color: #1e88e5;
}

body.dark .history-item-topic {
    color: #e2e8f0;
}

body.dark .panel-header {
    background: #263244;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .panel-header h3 {
    color: #e2e8f0;
}

body.dark .panel-tip {
    color: #94a3b8;
}

body.dark .form-group label {
    color: #94a3b8;
}

body.dark .dm-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .dm-textarea:focus {
    border-color: #e53935;
    background: #1e293b;
}

body.dark .dm-textarea::placeholder {
    color: #94a3b8;
}

body.dark .position-btn {
    background: #263244;
    border-color: #334155;
}

body.dark .position-btn:hover {
    border-color: #475569;
    background: #2d3a50;
}

body.dark .position-btn.pro.active {
    background: linear-gradient(135deg, #3b1f1f 0%, #4a2222 100%);
    border-color: #e53935;
}

body.dark .position-btn.con.active {
    background: linear-gradient(135deg, #1a2a40 0%, #1e3352 100%);
    border-color: #1e88e5;
}

body.dark .pos-label {
    color: #e2e8f0;
}

body.dark .pos-desc {
    color: #94a3b8;
}

body.dark .dm-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}

body.dark .dm-select:focus {
    border-color: #e53935;
    background-color: #1e293b;
}

body.dark .depth-btn {
    background: #263244;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .depth-btn:hover {
    background: #2d3a50;
    border-color: #475569;
}

body.dark .depth-btn.active {
    background: linear-gradient(135deg, #3b1f1f 0%, #4a2222 100%);
    border-color: #e53935;
    color: #e57373;
}

body.dark .depth-btn.active .depth-count {
    color: #f28b82;
}

body.dark .hot-topic-btn {
    background: #263244;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .hot-topic-btn:hover {
    border-color: #e53935;
    background: #3b1f1f;
    color: #e57373;
}

body.dark .dm-result-panel,
body.dark .dm-result-body {
    background: #0f172a;
}

/* 暗黑模式滚动条 */
body.dark .dm-result-body::-webkit-scrollbar-thumb,
body.dark .dm-input-body::-webkit-scrollbar-thumb,
body.dark .history-list::-webkit-scrollbar-thumb {
    background: #334155;
}

body.dark .dm-result-body::-webkit-scrollbar-thumb:hover,
body.dark .dm-input-body::-webkit-scrollbar-thumb:hover,
body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

body.dark .dm-result-panel .panel-header {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .dm-result-panel .panel-header h3 {
    color: #e2e8f0;
}

body.dark .result-point-count {
    background: #263244;
    color: #94a3b8;
}

body.dark .result-time {
    color: #94a3b8;
}

body.dark .result-meta-position {
    background: #3b1f1f;
    color: #e57373;
}

body.dark .result-meta-position.con {
    background: #1a2a40;
    color: #60a5fa;
}

body.dark .generate-hint {
    color: #94a3b8;
}

body.dark .placeholder-title {
    color: #e2e8f0;
}

body.dark .placeholder-desc {
    color: #94a3b8;
}

body.dark .debate-tag {
    background: #263244;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .debate-tag:hover {
    background: #3b1f1f;
    border-color: #e53935;
    color: #e57373;
}

body.dark .loading-text {
    color: #94a3b8;
}

body.dark .point-card {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .point-card.pro-card {
    border-left-color: #e53935;
}

body.dark .point-card.con-card {
    border-left-color: #1e88e5;
}

body.dark .point-card-header {
    background: #263244;
    border-color: rgba(148, 163, 184, 0.1);
}

body.dark .point-card.con-card .point-card-header {
    background: #1a2a40;
}

body.dark .point-card.pro-card .point-card-header {
    background: linear-gradient(to right, #2d1e1e 0%, #263244 100%);
}

body.dark .point-claim {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .point-evidences-title {
    color: #94a3b8;
}

body.dark .point-evidence-item {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark .point-rebuttal {
    background: #2a2510;
    color: #94a3b8;
    border-left-color: #f59e0b;
}

body.dark .point-rebuttal-label {
    color: #d97706;
}

body.dark .point-action-btn {
    background: #263244;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .point-action-btn:hover {
    border-color: #e53935;
    color: #e57373;
    background: #3b1f1f;
}

body.dark .point-card.con-card .point-action-btn:hover {
    border-color: #1e88e5;
    color: #60a5fa;
    background: #1a2a40;
}

body.dark .point-raw-text {
    color: #cbd5e1;
}

body.dark .result-error-msg {
    color: #e2e8f0;
}

body.dark .result-error-hint {
    color: #94a3b8;
}

body.dark .result-error-retry {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: #fca5a5;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    color: #fee2e2;
}

body.dark .dm-modal {
    background: #1e293b;
}

body.dark .dm-modal-header {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .dm-modal-body {
    background: #1e293b;
}

body.dark .example-card {
    background: #263244;
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark .example-card:hover {
    background: #3b1f1f;
    border-color: #e53935;
}

body.dark .example-card-title {
    color: #e2e8f0;
}

body.dark .example-card-desc {
    color: #94a3b8;
}

body.dark .example-card-badge.pro {
    background: #3b1f1f;
    color: #e57373;
}

body.dark .example-card-badge.con {
    background: #1a2a40;
    color: #60a5fa;
}

body.dark .char-counter {
    color: #94a3b8;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .dm-main-content {
        flex-direction: column;
    }

    .dm-history-panel {
        width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .dm-input-panel {
        width: 100%;
        height: 320px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .dm-result-panel {
        min-height: 320px;
    }

    .position-selector {
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .dm-toolbar {
        padding: 6px 10px;
    }

    .toolbar-title {
        display: none;
    }

    .dm-modal-body {
        grid-template-columns: 1fr;
    }
}

/* ========== 暗默模式响应式覆盖 ========== */
@media (max-width: 900px) {
    body.dark .dm-history-panel,
    body.dark .dm-input-panel {
        border-bottom-color: rgba(148, 163, 184, 0.15);
    }
}
