/* 智能舆情助手 - 主样式文件 */

:root {
    --primary-color: #3370ff;
    --light-primary-color: #eaf1ff;
    --border-color: #e5e6e8;
    --text-color: #1f2329;
    --secondary-text-color: #5f6670;
    --bg-color: #f7f8fa;
    --card-bg: #ffffff;
    --code-bg: #f2f3f5;
    --hover-color: #f5f6fa;
}

/* 全页面水印背景 */
.watermark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    user-select: none;
}

.watermark-text {
    position: absolute;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: rgba(95, 102, 112, 0.06);
    transform: rotate(-45deg);
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    letter-spacing: 2px;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 12px;
    font-size: 12px;
    color: var(--text-color);
    line-height: 1.5;
    max-width: 100%;
    overflow-x: hidden;
}

/* 用户头部区域 */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-phone {
    font-size: 11px;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    background-color: #ffeaea;
    color: #d63031;
    border: 1px solid #ffb3b3;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: #ffdddd;
    border-color: #ff9999;
}

.logout-btn .icon {
    width: 12px;
    height: 12px;
    margin-right: 4px;
}

/* 舆情处理行动建议模块样式 */
.action-plan-card {
    border-left: 4px solid var(--primary-color);
}

.loading-section {
    text-align: center;
    padding: 24px;
    color: var(--secondary-text-color);
}

.loading-spinner-large {
    font-size: 24px;
    margin-bottom: 12px;
    animation: spin 2s linear infinite;
}

.loading-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.loading-subtext {
    font-size: 10px;
    opacity: 0.8;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.incident-summary {
    background-color: var(--light-primary-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.incident-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.incident-category {
    font-size: 9px;
    padding: 2px 6px;
    background-color: var(--code-bg);
    border-radius: 3px;
    color: var(--secondary-text-color);
}

.incident-severity {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.incident-severity.high {
    background-color: #ffeaea;
    color: #d63031;
}

.incident-severity.medium {
    background-color: #fff5e6;
    color: #e17055;
}

.incident-severity.low {
    background-color: #e6f7ff;
    color: #0984e3;
}

.response-group {
    margin-bottom: 12px;
}

.response-title {
    font-size: 11px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--text-color);
}

.response-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.response-item {
    background-color: var(--code-bg);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--border-color);
}

.response-item.priority-high {
    border-left-color: #d63031;
}

.response-item.priority-medium {
    border-left-color: #e17055;
}

.response-item.priority-low {
    border-left-color: #0984e3;
}

.response-action-type {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.response-priority {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 500;
}

.response-priority.high {
    background-color: #ffeaea;
    color: #d63031;
}

.response-priority.medium {
    background-color: #fff5e6;
    color: #e17055;
}

.response-priority.low {
    background-color: #e6f7ff;
    color: #0984e3;
}

.response-description {
    font-size: 10px;
    line-height: 1.4;
    color: var(--secondary-text-color);
    margin-bottom: 4px;
}

.trigger-condition {
    font-size: 9px;
    background-color: #fff9c4;
    padding: 4px 6px;
    border-radius: 3px;
    color: #875f00;
    margin-top: 4px;
}

.trigger-condition::before {
    content: "触发条件：";
    font-weight: 600;
}

.sop-reference-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.sop-reference {
    font-size: 9px;
    color: var(--secondary-text-color);
    font-style: italic;
}

.sop-reference::before {
    content: "策略依据：";
    font-weight: 500;
}

.error-section {
    text-align: center;
    padding: 24px;
}

.error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.error-text {
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-bottom: 12px;
}

.retry-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.retry-btn:hover {
    background-color: #2b5ce6;
}

/* 动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 卡片组件 */
.card {
    background-color: var(--card-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* 标题样式 */
h2 {
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 刷新按钮样式 */
.refresh-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.refresh-btn:hover {
    background-color: var(--light-primary-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn .icon,
.refresh-btn [data-lucide] {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.refresh-btn:hover .icon,
.refresh-btn:hover [data-lucide] {
    transform: rotate(180deg);
}

h2 .icon,
h2 [data-lucide] {
    margin-right: 6px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Lucide 图标基础样式 */
[data-lucide] {
    display: inline-block;
    color: currentColor;
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* 图标大小变体 */
.icon-xs, [data-lucide].icon-xs { width: 12px; height: 12px; }
.icon-sm, [data-lucide].icon-sm { width: 14px; height: 14px; }
.icon-md, [data-lucide].icon-md { width: 16px; height: 16px; }
.icon-lg, [data-lucide].icon-lg { width: 20px; height: 20px; }
.icon-xl, [data-lucide].icon-xl { width: 24px; height: 24px; }

/* 图标间距 */
.icon-mr-1, [data-lucide].icon-mr-1 { margin-right: 4px; }
.icon-mr-2, [data-lucide].icon-mr-2 { margin-right: 8px; }

/* 图标动画 */
.icon-spin, [data-lucide].icon-spin {
    animation: spin 2s linear infinite;
}

.icon-pulse, [data-lucide].icon-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 案例信息样式 */
.case-info {
    font-size: 11px;
}

.case-info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 3px 0;
    padding: 2px 0;
}

.case-info-label {
    color: var(--secondary-text-color);
    font-weight: 500;
    min-width: 60px;
    margin-right: 8px;
    flex-shrink: 0;
}

.case-info-value {
    color: var(--text-color);
    flex: 1;
    word-break: break-all;
    text-align: right;
}

.case-summary {
    margin-top: 8px;
    padding: 6px;
    background-color: var(--code-bg);
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    word-break: break-word;
}

.case-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 10px;
}

.case-link:hover {
    text-decoration: underline;
}

.tag {
    display: inline-block;
    background-color: var(--light-primary-color);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

/* 快捷操作按钮 */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.quick-action-btn {
    background-color: var(--code-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 0;
    max-width: 100px;
    text-align: center;
}

.quick-action-btn:hover {
    background-color: var(--light-primary-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 话术选项样式 */
.script-options {
    margin-top: 12px;
}

.script-option {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: var(--card-bg);
    transition: all 0.2s;
}

.script-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(51, 112, 255, 0.1);
}

.script-option.selected {
    border-color: var(--primary-color);
    background-color: var(--light-primary-color);
}

.script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;
}

.script-number {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 12px;
}

.script-actions {
    display: flex;
    gap: 6px;
}

.script-content {
    padding: 0 10px 10px 10px;
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 120px;
    overflow-y: auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    text-align: center;
}

.btn:hover {
    background-color: #2859cf;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--light-primary-color);
    color: var(--primary-color);
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    width: auto;
    margin-top: 0;
}

.btn-secondary:hover {
    background-color: #d8e5ff;
}

.select-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.select-btn:hover {
    background-color: #2859cf;
}

.select-btn.selected {
    background-color: #52c41a;
}

/* 反馈区域样式 */
.feedback-section {
    margin-top: 12px;
    padding: 12px;
    background-color: var(--code-bg);
    border-radius: 6px;
    display: none;
}

.feedback-btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.feedback-btn-primary:hover {
    background-color: #2859cf;
}

.feedback-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.feedback-success {
    text-align: center;
    padding: 20px;
    color: #52c41a;
}

.feedback-success .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 模态窗口样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.modal-close {
    cursor: pointer;
    font-size: 18px;
    color: var(--secondary-text-color);
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.selected-script-preview {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 16px;
    font-size: 11px;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
}

/* 表单样式 */
textarea, input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 10px;
    resize: vertical;
}

/* 脚本模板样式 */
.script-template {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 12px;
    position: relative;
}

/* 知识库搜索结果样式 */
.kb-result {
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    cursor: pointer;
}

.kb-result:last-child {
    border-bottom: none;
}

.kb-result:hover {
    background-color: var(--bg-color);
}

.kb-result-title {
    font-weight: 500;
}

.kb-result-meta {
    font-size: 12px;
    color: #8a919f;
}

/* 状态样式 */
.loading {
    opacity: 0.6;
}

.error {
    color: #ff4757;
    background-color: #ffeaea;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}

/* Tab 样式 */
.tab-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-button {
    padding: 8px 12px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--secondary-text-color);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}