/* ============================================================
   social_practice_report.css — 社会实践报告生成工具样式
   ============================================================ */

/* ── 动态背景（工作日冷色 / 周末暖色）── */
.spr-weekday-bg { background: linear-gradient(135deg, #eaf4fd 0%, #d4e8f7 100%); }
.spr-weekend-bg { background: linear-gradient(135deg, #fff4e6 0%, #fde7c5 100%); }

/* ── 整体容器 ── */
.spr-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 0 28px;
}

/* ── 复制兜底用隐藏 textarea ── */
.spr-clipboard-helper {
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* ══════════════════════ 区块 Section ══════════════════════ */
.spr-section {
    background: #fff;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    padding: 18px 20px 14px;
    margin-bottom: 14px;
    transition: border-color 0.22s, box-shadow 0.22s;
}

/* 当区块内有元素获得焦点时，提示活跃区域 */
.spr-section:focus-within {
    border-color: #a8ccec;
    box-shadow: 0 0 0 3px rgba(74, 143, 217, 0.07);
}

.spr-section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #2d5fa3;
    border-left: 3px solid #4a8fd9;
    padding-left: 10px;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.spr-section-hint {
    font-size: 12px;
    font-weight: 400;
    color: #9aabbc;
    margin-left: 4px;
}

/* ── 网格布局 ── */
.spr-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.spr-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* ══════════════════════ 字段 Field ══════════════════════ */
.spr-field {
    margin-bottom: 14px;
}

.spr-field:last-child {
    margin-bottom: 0;
}

.spr-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.spr-label {
    font-size: 13px;
    font-weight: 600;
    color: #3a4a5c;
    display: block;
    margin-bottom: 6px;
}

/* label 在 label-row 内不需要额外 margin-bottom，避免与外层 margin-bottom 叠加 */
.spr-label-row .spr-label {
    margin-bottom: 0;
}

.spr-required {
    color: #e05050;
    font-size: 14px;
    margin-left: 3px;
    cursor: help;
}

/* ── 字符计数 ── */
.spr-char-count {
    font-size: 12px;
    color: #a0aab5;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s, font-weight 0.2s;
}

.spr-char-count.warn   { color: #d97706; }
.spr-char-count.danger { color: #c0392b; font-weight: bold; }

/* ── 单行输入 ── */
.spr-input {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid #cdd7e5;
    border-radius: 5px;
    font-size: 14px;
    color: #2c3e50;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    outline: none;
}

.spr-input:focus {
    border-color: #4a8fd9;
    box-shadow: 0 0 0 3px rgba(74, 143, 217, 0.14);
    background: #fff;
}

/* ── 多行文本域 ── */
.spr-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cdd7e5;
    border-radius: 5px;
    font-size: 14px;
    color: #2c3e50;
    background: #f8fafc;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    line-height: 1.7;
    font-family: inherit;
    outline: none;
    min-height: 72px;
}

.spr-textarea:focus {
    border-color: #4a8fd9;
    box-shadow: 0 0 0 3px rgba(74, 143, 217, 0.14);
    background: #fff;
}

/* ══════════════════════ 操作行 ══════════════════════ */
.spr-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.spr-submit-btn {
    height: 38px;
    padding: 0 24px;
    background: linear-gradient(135deg, #4a8fd9 0%, #3069b0 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(58, 116, 185, 0.25);
}

.spr-submit-btn:hover {
    background: linear-gradient(135deg, #3878c5 0%, #255b9e 100%);
    box-shadow: 0 3px 10px rgba(58, 116, 185, 0.35);
}

.spr-submit-btn:active { transform: scale(0.97); }

.spr-ai-btn {
    height: 38px;
    padding: 0 22px;
    background: linear-gradient(135deg, #7c4dff 0%, #5e35b1 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(124, 77, 255, 0.25);
}

.spr-ai-btn:hover { background: linear-gradient(135deg, #6739e8 0%, #4d2aab 100%); }

.spr-ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.spr-clear-btn {
    height: 38px;
    padding: 0 16px;
    background: #fff;
    color: #7a8898;
    border: 1px solid #cdd7e5;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin-left: auto;
}

.spr-clear-btn:hover {
    background: #fff5f5;
    color: #c0392b;
    border-color: #f5c6c6;
}

/* ── 快捷键提示 ── */
.ael-shortcut-tip {
    font-size: 12px;
    color: #9aabbc;
    margin: 2px 0 16px;
    padding-left: 1px;
}

/* ══════════════════════ 错误提示 ══════════════════════ */
.spr-error-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 7px;
    padding: 11px 15px;
    font-size: 13px;
    color: #c0392b;
    margin-bottom: 16px;
}

.spr-error-icon { font-size: 15px; flex-shrink: 0; }

/* ══════════════════════ 格式化报告展示 ══════════════════════ */
.spr-report {
    display: none;
    background: #fff;
    border: 1px solid #b8d6f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.spr-report.visible { display: block; }

.spr-report.visible:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.spr-report-header {
    background: linear-gradient(90deg, #e6f2fb, #d2e8f6);
    padding: 12px 16px;
    border-bottom: 1px solid #bcd5ec;
}

.spr-report-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spr-report-label {
    font-size: 14px;
    font-weight: 700;
    color: #2467a6;
}

.spr-report-stat {
    font-size: 12px;
    font-weight: 500;
    color: #4a8fd9;
    background: #deeef9;
    border-radius: 10px;
    padding: 2px 9px;
    margin-right: 4px;
    flex-shrink: 0;
}

/* 清空后隐藏徽标 */
.spr-report-stat.spr-stat-empty { display: none; }

.spr-report-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* AI 区头部右侧操作容器 */
.spr-ai-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spr-copy-btn {
    height: 30px;
    padding: 0 14px;
    background: #4a8fd9;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.18s;
    font-weight: 500;
}

.spr-copy-btn:hover { background: #3069b0; }

.spr-copy-ai-btn { background: #7c4dff; }
.spr-copy-ai-btn:hover { background: #5e35b1; }

.spr-report-body {
    padding: 20px 24px;
    font-size: 14.5px;
    color: #222e3a;
    line-height: 2;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'PingFang SC', 'Microsoft YaHei', '微软雅黑', sans-serif;
    margin: 0;
    cursor: pointer;
    transition: background 0.18s;
}

.spr-report-body:hover { background: #f7fbff; }

.spr-copy-hint {
    font-size: 11px;
    color: #b0bccc;
    text-align: right;
    padding: 6px 16px 8px;
    background: #f8fbff;
    border-top: 1px solid #e4eef8;
}

/* ══════════════════════ AI 生成区 ══════════════════════ */
.spr-ai-section {
    background: #fff;
    border: 1px solid #d8caff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.spr-ai-section:not(.spr-ai-hidden):hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.spr-ai-hidden { display: none; }

.spr-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #ede8ff, #dfd5ff);
    padding: 12px 16px;
    border-bottom: 1px solid #cec0ff;
    font-size: 14px;
    font-weight: 700;
    color: #4a1fa8;
}

.spr-ai-body {
    padding: 20px 24px;
    font-size: 14.5px;
    color: #222e3a;
    line-height: 2;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'PingFang SC', 'Microsoft YaHei', '微软雅黑', sans-serif;
    margin: 0;
    cursor: pointer;
    min-height: 80px;
    transition: background 0.18s;
}

.spr-ai-body:hover { background: #fbf9ff; }

/* AI 加载动画 */
.spr-ai-loading {
    padding: 32px 20px;
    text-align: center;
    color: #7c4dff;
    font-size: 14px;
}

.spr-ai-loading-dots::after {
    content: '';
    animation: spr-dots 1.5s infinite;
}

@keyframes spr-dots {
    0%,  19% { content: '.';   }
    20%, 49% { content: '..';  }
    50%, 79% { content: '...'; }
    80%,100% { content: '';    }
}

/* ══════════════════════ 快速示例区 ══════════════════════ */
.spr-samples-section {
    background: #fff;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    padding: 16px 20px 14px;
}

.spr-samples-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.spr-samples-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #3a4a5c;
}

.spr-samples-hint {
    font-size: 12px;
    color: #9aabbc;
}

.spr-sample-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spr-sample-btn {
    height: 32px;
    padding: 0 16px;
    background: #f0f6ff;
    color: #2d5fa3;
    border: 1px solid #c5daf5;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
    white-space: nowrap;
}

.spr-sample-btn:hover {
    background: #4a8fd9;
    color: #fff;
    border-color: #4a8fd9;
    transform: translateY(-1px);
}

.spr-sample-btn:active { transform: translateY(0); }

/* ══════════════════════ Toast ══════════════════════ */
.spr-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(18px);
    background: rgba(22, 32, 48, 0.9);
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.spr-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    cursor: pointer;
}

/* Toast 语义颜色：error=红 / warning=橙 / success=绿 */
.spr-toast.error   { background: rgba(180, 30,  30,  0.93); }
.spr-toast.warning { background: rgba(155, 90,   0,  0.93); }
.spr-toast.success { background: rgba( 20, 100, 60,  0.90); }

/* ══════════════════════ 响应式 ══════════════════════ */
/* 平板端：缩减间距 */
@media (max-width: 768px) {
    .spr-section {
        padding: 14px 14px 10px;
    }

    .spr-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .spr-report-body,
    .spr-ai-body {
        padding: 16px 16px;
    }
}

/* 手机端：强制单列 */
@media (max-width: 640px) {
    .spr-row-2,
    .spr-row-3 {
        grid-template-columns: 1fr;
    }

    .spr-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .spr-submit-btn,
    .spr-ai-btn,
    .spr-clear-btn {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .spr-report-body,
    .spr-ai-body {
        font-size: 13.5px;
        padding: 14px 12px;
    }

    .spr-report-header-row {
        flex-wrap: wrap;
        gap: 8px;
    }
}
