/* ============================================
   ATACAJUNTO APP - 法律文档页面样式
   css/pages/legal.css
   用于隐私政策和使用条款页面
   ============================================ */

/* ===========================
   法律页面容器
   =========================== */
.legal-page {
    background: var(--bg-white);
    min-height: 100vh;
}

/* 页面头部 */
.legal-header {
    background: var(--primary);
    color: var(--text-white);
    padding: 20px 16px;
    padding-top: calc(20px + var(--safe-area-top));
    position: sticky;
    top: 0;
    z-index: 100;
}

.legal-header__container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.legal-header__back {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 18px;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.legal-header__back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.legal-header__title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

/* 语言切换按钮 */
.lang-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}

.lang-switch__btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.lang-switch__btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
}

.lang-switch__btn.active {
    background: var(--bg-white);
    color: var(--primary);
}

/* 语言内容切换 */
.lang-content {
    display: none;
}

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

.legal-header__date {
    font-size: 12px;
    opacity: 0.8;
}

/* ===========================
   内容区域
   =========================== */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
    padding-bottom: calc(24px + var(--nav-bottom-height) + var(--safe-area-bottom));
}

/* 公司信息卡片 */
.legal-company-info {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 32px;
}

.legal-company-info__name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.legal-company-info__item {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.legal-company-info__item i {
    color: var(--primary);
    width: 16px;
    margin-top: 2px;
}

/* ===========================
   目录导航
   =========================== */
.legal-toc {
    background: var(--primary-alpha);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 32px;
}

.legal-toc__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-toc__title i {
    color: var(--primary);
}

.legal-toc__list {
    display: grid;
    gap: 8px;
}

.legal-toc__item {
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-fast);
}

.legal-toc__item:hover {
    color: var(--primary-dark);
}

.legal-toc__number {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
}

/* ===========================
   章节样式
   =========================== */
.legal-section {
    margin-bottom: 32px;
    scroll-margin-top: 80px;
}

.legal-section__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-section__number {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    min-width: 28px;
}

.legal-section__content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-section__content p {
    margin-bottom: 12px;
}

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

.legal-section__content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 列表样式 */
.legal-list {
    margin: 16px 0;
    padding-left: 0;
}

.legal-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* 嵌套列表 */
.legal-list--nested {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.legal-list--nested li::before {
    background: var(--text-muted);
    width: 4px;
    height: 4px;
    top: 11px;
}

/* 强调框 */
.legal-highlight {
    background: #FFF8E1;
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
}

.legal-highlight p {
    margin: 0;
    color: #E65100;
    font-weight: 500;
}

/* 联系信息框 */
.legal-contact {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 16px 0;
}

.legal-contact__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-contact__title i {
    color: var(--primary);
}

.legal-contact__item {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.legal-contact__item i {
    color: var(--primary);
    width: 16px;
}

.legal-contact__item a {
    color: var(--primary);
}

/* ===========================
   数据表格
   =========================== */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.legal-table th,
.legal-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.legal-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-primary);
}

.legal-table td {
    color: var(--text-secondary);
}

.legal-table tr:last-child td {
    border-bottom: none;
}

/* 响应式表格 */
@media (max-width: 600px) {
    .legal-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ===========================
   页脚
   =========================== */
.legal-footer {
    text-align: center;
    padding: 24px 16px;
    border-top: 1px solid var(--border-light);
    margin-top: 32px;
}

.legal-footer__text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.legal-footer__links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legal-footer__link {
    font-size: 13px;
    color: var(--primary);
}

/* ===========================
   响应式调整
   =========================== */
@media (min-width: 769px) {
    .legal-header {
        padding: 24px;
    }
    
    .legal-header__title {
        font-size: 22px;
    }
    
    .legal-content {
        padding: 40px 24px;
    }
    
    .legal-section__title {
        font-size: 20px;
    }
    
    .legal-toc__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================
   打印样式
   =========================== */
@media print {
    .legal-header {
        position: static;
        background: none;
        color: var(--text-primary);
        border-bottom: 2px solid var(--text-primary);
    }
    
    .legal-header__back {
        display: none;
    }
    
    .legal-toc {
        break-inside: avoid;
    }
    
    .legal-section {
        break-inside: avoid;
    }
}
