/* ========================================================================
   legal.css —— 用户协议 / 隐私政策 共用样式
   与 App 同风格:亮色淡彩渐变底 + 白卡片 + 蓝紫主色,跟官网主页一致
   ======================================================================== */

:root {
    --bg-lavender: #E9E3F7;
    --bg-mint: #E4F5EC;
    --bg-card: #ffffff;
    --bg-card-2: #F4F7FB;
    --accent-blue: #3392FF;
    --accent-purple: #8E7BFF;
    --text-title: #22303F;
    --text-body: #3D4B5C;
    --text-sub: #6B7A90;
    --text-muted: #8A97A8;
    --border-soft: rgba(34, 48, 63, 0.08);
    --border-blue: rgba(51, 146, 255, 0.35);
    --gradient: linear-gradient(135deg, #3392FF 0%, #8E7BFF 100%);
    --shadow-card: 0 4px 12px rgba(30, 41, 59, 0.06);

    --font-zh: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --font-en: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --max-width: 860px;
}

html,
body {
    background: linear-gradient(180deg, var(--bg-lavender) 0%, var(--bg-mint) 100%);
    background-attachment: fixed;
    color: var(--text-body);
    font-family: var(--font-zh), var(--font-en);
    font-size: 16px;
    line-height: 1.8;
    min-height: 100vh;
}

/* ========================================================================
   顶栏(白色玻璃态 + 返回官网)
   ======================================================================== */
.legal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
}

.legal-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.legal-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
}

.legal-header__brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.legal-header__title {
    color: var(--text-title);
}

.legal-header__back {
    font-size: 13px;
    color: var(--text-sub);
    transition: color 0.2s;
}

.legal-header__back:hover {
    color: var(--accent-blue);
}

/* ========================================================================
   主体
   ======================================================================== */
.legal-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.legal-hero {
    text-align: center;
    margin-bottom: 56px;
}

.legal-hero__eyebrow {
    color: var(--accent-blue);
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.legal-hero__title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 14px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.legal-hero__meta {
    color: var(--text-sub);
    font-size: 13px;
}

/* ========================================================================
   章节卡片(App 指标卡同款:白卡 + 圆角 + 柔影 + 渐变左条)
   ======================================================================== */
.legal-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 32px 32px 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.legal-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient);
}

.legal-section__title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-section__title::before {
    content: counter(legal-section);
    counter-increment: legal-section;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.legal-main {
    counter-reset: legal-section;
}

.legal-section__subtitle {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-title);
    margin: 18px 0 8px;
}

.legal-section p {
    color: var(--text-body);
    font-size: 14.5px;
    line-height: 1.85;
    margin-bottom: 10px;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section strong,
.legal-section b {
    color: var(--text-title);
    font-weight: 600;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.legal-section ul li {
    color: var(--text-body);
    font-size: 14.5px;
    line-height: 1.85;
    padding-left: 18px;
    position: relative;
    margin-bottom: 4px;
}

.legal-section ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-blue);
}

.legal-section a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dashed var(--border-blue);
    transition: border-color 0.2s;
}

.legal-section a:hover {
    border-bottom-style: solid;
}

.legal-section code {
    background: var(--bg-card-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent-blue);
}

/* 强调框(用于"特别提示"等)—— 淡蓝底呼应 App 柔彩 */
.legal-callout {
    background: linear-gradient(
        135deg,
        rgba(51, 146, 255, 0.07) 0%,
        rgba(142, 123, 255, 0.07) 100%
    ),
    #ffffff;
    border: 1px solid var(--border-blue);
}

/* 表格(用于第三方 SDK 列表) */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.legal-table th,
.legal-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-body);
    vertical-align: top;
}

.legal-table th {
    color: var(--text-title);
    font-weight: 600;
    font-size: 13px;
    background: var(--bg-card-2);
}

.legal-table a {
    word-break: break-all;
}

/* 落款 */
.legal-signature {
    text-align: right;
    color: var(--text-sub);
    font-size: 13px;
    margin-top: 32px;
    line-height: 2;
}

/* ========================================================================
   响应式
   ======================================================================== */
@media (max-width: 600px) {
    .legal-main {
        padding: 36px 16px 60px;
    }

    .legal-section {
        padding: 24px 20px 22px;
    }

    .legal-section__title {
        font-size: 17px;
    }

    .legal-section p,
    .legal-section ul li {
        font-size: 14px;
    }

    .legal-header__inner {
        padding: 12px 16px;
    }

    .legal-table {
        font-size: 13px;
    }

    .legal-table th,
    .legal-table td {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
