{% extends "base.html" %}
{% load static %}

{% block title %}分享页风险提示配置 - AgomTradePro{% endblock %}

{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/admin-shell.css' %}">
<link rel="stylesheet" href="{% static 'css/share.css' %}">
<style>
.share-disclaimer-manage-container { max-width: 920px; margin: 0 auto; padding: 24px; }
.share-disclaimer-manage-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.share-disclaimer-manage-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 24px; }
.share-disclaimer-form { display: grid; gap: 16px; }
.share-disclaimer-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.share-disclaimer-form input[type="text"], .share-disclaimer-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; }
.share-disclaimer-form textarea { min-height: 220px; resize: vertical; }
.share-disclaimer-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.share-disclaimer-check { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.share-disclaimer-check input { margin-top: 3px; }
.share-disclaimer-help { color: #64748b; font-size: 13px; line-height: 1.6; }
@media (max-width: 720px) { .share-disclaimer-checks { grid-template-columns: 1fr; } .share-disclaimer-manage-header { flex-direction: column; } }
</style>
{% endblock %}

{% block content %}
<div class="admin-shell admin-shell--narrow">
    <div class="admin-shell__hero">
        <div class="admin-shell__lead">
            <h1 class="admin-shell__title">分享页风险提示配置</h1>
            <p class="admin-shell__subtitle">公开分享页的统一风险提示配置页，用于维护底部提示区块和首屏弹窗文案。</p>
        </div>
        <div class="admin-shell__actions">
            <a href="{% url 'settings-center' %}" class="btn btn-secondary admin-shell__action-link">返回设置中心</a>
            <a href="{% url 'share:manage' %}" class="btn btn-secondary admin-shell__action-link">返回账户分享管理</a>
        </div>
    </div>

    <div class="admin-shell__banner">
        <strong>入口说明：</strong>
        当前页属于公开分享链路的系统文案配置入口；
        链接创建与运营仍在账户分享管理页；
        全局系统配置请回设置中心。
    </div>

<div class="share-disclaimer-manage-container">
    <section class="share-disclaimer-manage-panel admin-shell__surface">
        <form method="post" class="share-disclaimer-form">
            {% csrf_token %}
            <div class="share-disclaimer-checks">
                <label class="share-disclaimer-check">
                    <input type="checkbox" name="is_enabled" {% if config.is_enabled %}checked{% endif %}>
                    <span>
                        <strong>显示页面底部风险提示</strong><br>
                        <span class="share-disclaimer-help">关闭后，公开页底部将不再展示风险提示区块。</span>
                    </span>
                </label>
                <label class="share-disclaimer-check">
                    <input type="checkbox" name="modal_enabled" {% if config.modal_enabled %}checked{% endif %}>
                    <span>
                        <strong>启用首屏风险提示弹窗</strong><br>
                        <span class="share-disclaimer-help">关闭后，公开页不再弹出风险提示模态窗。</span>
                    </span>
                </label>
            </div>

            <div>
                <label for="modal_title">提示标题</label>
                <input id="modal_title" type="text" name="modal_title" maxlength="120" value="{{ config.modal_title }}">
            </div>

            <div>
                <label for="modal_confirm_text">弹窗确认按钮文案</label>
                <input id="modal_confirm_text" type="text" name="modal_confirm_text" maxlength="40" value="{{ config.modal_confirm_text }}">
            </div>

            <div>
                <label for="lines">风险提示内容</label>
                <textarea id="lines" name="lines" placeholder="每行一条风险提示">{{ lines_text }}</textarea>
                <p class="share-disclaimer-help">每行会作为一条独立提示显示。模拟盘公开页会自动额外插入“本账户为模拟交易账户”这一条。</p>
            </div>

            <div class="share-link-actions">
                <button type="submit" class="btn btn-primary">保存配置</button>
                <a href="{% url 'share:manage' %}" class="btn btn-secondary">取消</a>
            </div>
        </form>
    </section>
</div>
</div>
{% endblock %}
