/* 前端之神设计系统 - 桌面端专用版本 */
/* Skill 01: 极简静态建模 - 强制约束纯 HTML/CSS 模式 */
/* Skill 02: 智治纸墨环境渲染 - 环境着色与空间重构 */
/* Skill 03: 业务生命周期配色 - M3 Lifecycle Mapping */
/* Skill 04: 适老建筑排版 - Accessible Architecture */
/* Skill 05: 结构化叙事布局 - Sequential Storytelling */
/* Skill 06: 标准化卡片组装协议 - Standardized Card Protocol */

/* v1.0.63 - 移动端选字丢失修复 + Tab标签描边统一 */

:root {
    /* 智治纸墨环境渲染 - 基础色彩 */
    --paper-white: #F8F9FA;
    /* 云峰白 - 禁用纯白 */
    --ink-black: #1F1F1F;
    /* 石墨灰 - 禁用纯黑 */
    --paper-stack-1: #F0F4F8;
    /* 调和浅灰 - 无线化分割 */
    --paper-stack-2: #E8EAED;
    /* 纸张堆叠深度 */

    /* 业务生命周期配色 (M3 Lifecycle Mapping) */
    --text-primary: #5C5853;
    /* 正文深灰 - 符合WCAG AA标准 */
    --lifecycle-audit: #78716C;
    /* 灰色 - 审计、通知、辅助文字 */
    --lifecycle-audit-bg: #F5F5F4;
    --lifecycle-proposal: #D97706;
    /* 黄色 - 联名、协商 */
    --lifecycle-proposal-bg: #FEF7E0;
    --lifecycle-action: #1A73E8;
    /* 蓝色 - 投票、表决 */
    --lifecycle-action-bg: #E8F0FE;
    --lifecycle-complete: #146C2E;
    /* 绿色 - 已通过、已完成 */
    --lifecycle-complete-bg: #E6F4EA;
    --lifecycle-urgent: #B3261E;
    /* 红色 - 异议、紧急、扣款 */
    --lifecycle-urgent-bg: #FCE8E6;

    /* 适老建筑排版 - 视力补偿与触控优化 */
    --font-h1: 28px;
    /* 标题强制 28px */
    --font-body: 16px;
    /* 正文强制 >= 16px */
    --font-caption: 13px;
    /* 辅助文字 >= 13px */
    --touch-target: 44px;
    /* 按钮高度 44px-48px */

    /* 三级圆角系统（v1.0.50重构） */
    --radius-sm: 8px;
    /* 小圆角：标签、提示、小组件 */
    --radius-md: 16px;
    /* 中圆角：卡片主体、表单、容器 */
    --radius-lg: 9999px;
    /* 胶囊圆角：按钮、Tab、交互元素 */
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    /* 弥散投影 */
}

/* 全局重置 - 极简静态建模 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    /* 适老建筑排版 - 系统默认字体堆栈 */
    font-family: ui-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background-color: var(--paper-white);
    /* 确保整个页面背景色统一，避免header上方露出纯白色 */
}

body {
    background-color: var(--paper-white);
    color: var(--ink-black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 结构化叙事布局 - 应用容器 */
.app-container {
    max-width: 896px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background-color: var(--paper-white);
}

/* 身份锚点 - 顶部封面 */
.header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* 底部对齐，图标和"业主阳光码"对齐 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background-color: var(--paper-white);
    max-width: 896px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.header-main-title {
    font-size: var(--font-h1);
    font-weight: 900;
    color: var(--ink-black);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.header-sub-title {
    font-size: var(--font-body);
    font-weight: 400;
    color: var(--lifecycle-audit);
    line-height: 1.5;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-button {
    width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lifecycle-audit);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.header-button:hover {
    background-color: var(--paper-stack-1);
}

/* 效率工具 - 功能标签 */
.tab-bar {
    padding: 12px 16px;
    /* 统一左右padding为16px */
    display: flex;
    gap: 4px;
    /* 从8px缩小到4px，适应更多Tab */
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background-color: var(--paper-white);
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 40;
    max-width: 896px;
    margin: 0 auto;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-button {
    flex-shrink: 0;
    padding: 12px 12px;
    /* 从16px缩小到12px，适应更多Tab；文字对齐到16px+12px=28px */
    font-size: var(--font-body);
    font-weight: 500;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.tab-button.active {
    background: var(--paper-stack-2);
    color: var(--ink-black);
}

.tab-button.active:hover {
    background: #D9DCDF;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.tab-button:not(.active) {
    background: transparent;
    color: var(--lifecycle-audit);
}

.tab-button:not(.active):hover {
    background: var(--paper-stack-1);
}

/* 主内容区域 */
.main-content {
    padding-top: 136px;
    /* 使第一行文字约在152px（136+16），与一级TabBar文字间距约50px */
    padding-bottom: 32px;
    min-height: 100vh;
}

/* 有二级导航的页面，增加padding-top */
.main-content.with-secondary-nav {
    padding-top: 182px;
    /* 二级导航容器136px开始，高度约48px，结束于184px */
    /* 内容从182px开始，page-content padding 16px，第一行文字约198px */
    /* 与二级导航文字center(134px)间距约64px */
}

/* 时间轴 - 事件列表 (红/黄/蓝/绿状态流) */
.timeline {
    padding: 0;
    /* 移除padding，让子元素直接控制对齐 */
}

/* 日期标签 - 分隔符样式 */
.date-label {
    position: relative;
    z-index: 1;
    padding: 0 0 12px 0;
    margin: 4px 0 0 0;
}

.date-label:first-child {
    margin-top: 2px;
}

.date-header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    /* 和其他元素保持一致 */
}

.date-pill {
    /* 分隔符样式 - 通过颜色和字重区分，而非字号 */
    flex-shrink: 0;
    padding: 6px 16px;
    /* 左右16px padding，文字对齐到16px+16px=32px，与卡片内容一致 */
    font-size: var(--font-body);
    /* 使用16px，与正文一致 */
    font-weight: 500;
    /* 加粗字重，更清晰 */
    border-radius: 0;
    border: none;
    transition: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    background: transparent;
    cursor: default;
    position: relative;
    z-index: 1;
}

.date-pill:hover {
    /* 去掉hover效果 */
    background: transparent;
    box-shadow: none;
}

.date-text {
    color: var(--lifecycle-audit);
    /* 灰色文字，更像分隔符 */
    white-space: nowrap;
}

/* 标准化卡片组装协议 - 四步走顺序 */
.archive-card {
    position: relative;
    margin-bottom: 12px;
    padding: 0 16px;
    /* 左右padding与header对齐 */
}

/* 第一步：状态定调 (Header) - 展示状态描述与日期 */
.event-type {
    position: absolute;
    bottom: 100%;
    left: 16px;
    margin: 0;
    display: inline-block;
    padding: 8px 16px;
    font-size: var(--font-caption);
    font-weight: 600;
    color: white;
    border-radius: 8px 8px 0 0;
    z-index: 2;
}

/* 业务生命周期配色 - 降低饱和度的纸墨质感 */
.type-decision {
    background: linear-gradient(135deg, #8B9A8B 0%, #6B7B6B 100%);
    /* 雅致墨绿 */
}

.type-announcement {
    background: linear-gradient(135deg, #7B8BA8 0%, #5B6B88 100%);
    /* 沉静墨蓝 */
}

.type-consultation {
    background: linear-gradient(135deg, #A89B7B 0%, #887B5B 100%);
    /* 温润墨黄 */
}

.type-complaint {
    background: linear-gradient(135deg, #A87B7B 0%, #885B5B 100%);
    /* 克制墨红 */
}

/* 第四步：决策核心 (Content) - 详细描述文本、附件链接、操作按钮 */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    border: none;
    padding: 24px 24px 24px 16px;
    /* 左边16px padding确保文字对齐到32px（16+16），右、上、下24px */
    cursor: pointer;
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
    /* 卡片之间保持12px间距，避免重叠 */
}

/* archive-card中的卡片特殊样式 */
.archive-card .card {
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    /* padding继承父级 .card 的定义 */
    margin-top: 40px;
    /* 为书签腾出空间，并与上一个卡片保持距离 */
}

.card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.event-title {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--ink-black);
    margin-bottom: 8px;
}

/* 卡片标题 - 与event-title保持一致的样式 */
.card-title {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--ink-black);
    margin-bottom: 8px;
}

/* 卡片内图片标准样式 */
.card-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

/* 可缩放图片（可点击查看大图） */
.zoomable-image {
    cursor: pointer;
    transition: opacity 0.2s;
}

.zoomable-image:hover {
    opacity: 0.9;
}

/* 选择模式下禁用图片查看功能 */
body.selection-mode .zoomable-image {
    pointer-events: none;
    /* 禁用图片点击，避免弹出查看器，改为选择卡片 */
}

.event-content {
    font-size: var(--font-body);
    line-height: 1.5;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn-secondary {
    background: var(--paper-stack-1);
    color: var(--lifecycle-audit);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: none;
    transition: all 0.2s ease;
    font-size: var(--font-body);
    /* 从14px升级为16px，符合适老规范 */
    line-height: 1.4;
    cursor: pointer;
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
}

.btn-secondary:hover {
    background: var(--paper-stack-2);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.share-button {
    color: var(--lifecycle-audit);
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-button:hover {
    color: var(--lifecycle-action);
    background: var(--paper-stack-1);
}

.detail-button {
    background: var(--paper-stack-1);
    color: var(--lifecycle-audit);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: none;
    transition: all 0.2s ease;
    font-size: var(--font-body);
    /* 从14px升级为16px，符合适老规范 */
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    min-height: var(--touch-target);
}

.detail-button:hover {
    background: var(--paper-stack-2);
}

/* 浮动操作按钮 - 多按钮容器 */
.floating-action-buttons {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}

.fab-button.fab-add {
    background: var(--lifecycle-action);
    /* 加号按钮使用蓝色 */
}

.fab-button.fab-add svg {
    width: 20px;
    height: 20px;
}

.fab-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--lifecycle-action);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    text-decoration: none;
}

.fab-button svg {
    width: 20px;
    height: 20px;
}

.fab-button.fab-forward {
    background: var(--lifecycle-proposal);
    /* 转发按钮使用橙色/黄色，更醒目 */
}

/* 分享按钮 - 蓝色 */
.fab-button.fab-share {
    background: var(--lifecycle-action);
    /* 分享按钮使用蓝色，表示全局通用功能 */
}

/* 选择模式下隐藏转发按钮 */
body.selection-mode .fab-button.fab-forward {
    display: none;
}

/* 加号菜单 */
.add-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.add-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.add-menu-content {
    position: relative;
    background: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 16px;
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    animation: slideUp 0.3s ease;
}

.add-menu-item {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--paper-stack-1);
    color: var(--ink-black);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.add-menu-item:hover {
    background: var(--paper-stack-2);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 卡片选择样式 */
.card.selected {
    background: var(--lifecycle-proposal-bg) !important;
    box-shadow: 0 0 0 2px var(--lifecycle-proposal);
}

/* 文字选择模式 */
.card.selection-mode {
    cursor: text;
}

/* 文字选取模式 - 卡片恢复正常背景，但添加视觉提示 */
.card.text-selection-mode {
    /* 移除选中样式，恢复白色背景 */
}

/* 选中的文字黄色高亮 */
::selection {
    background: var(--lifecycle-proposal-bg) !important;
    /* 黄色背景 */
    color: var(--ink-black) !important;
    /* 保持黑色文字 */
}

/* 兼容不同浏览器 */
::-moz-selection {
    background: var(--lifecycle-proposal-bg) !important;
    color: var(--ink-black) !important;
}

/* 移除选字手柄相关样式（不再需要） */

/* 列表行选择样式 */
.info-row.selected {
    background: var(--lifecycle-proposal-bg) !important;
}

.fab-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ===== 选择模式样式 ===== */

/* 选择模式 - 顶部操作栏 */
.selection-mode-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--ink-black);
    color: white;
    padding: 12px 16px;
    display: none;
    /* 默认隐藏，激活时显示 */
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.selection-mode-bar.active {
    display: flex;
}

.selection-count {
    font-size: 14px;
    font-weight: 600;
}

.selection-actions {
    display: flex;
    gap: 8px;
}

.btn-cancel-selection,
.btn-confirm-selection {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-selection {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-cancel-selection:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-confirm-selection {
    background: var(--lifecycle-complete);
    color: white;
}

.btn-confirm-selection:hover {
    background: #125a22;
}

/* 选择模式 - 可选择元素 */
body.selection-mode .archive-card {
    position: relative;
    cursor: pointer;
}

/* 选择模式下禁用所有链接跳转，避免误触 */
body.selection-mode .card-link {
    pointer-events: none;
}

/* 选择模式下tab按钮可点击 */
body.selection-mode .tab-bar {
    pointer-events: auto;
    opacity: 1;
}

body.selection-mode .tab-button {
    cursor: pointer;
}

body.selection-mode .tab-button.selected {
    background: var(--lifecycle-proposal-bg);
    color: var(--lifecycle-proposal);
}

/* 选择模式下禁用header按钮 */
body.selection-mode .header-actions {
    pointer-events: none;
    opacity: 0.5;
}

/* 选择模式下隐藏报事按钮 */
body.selection-mode .fab-button:not(.fab-forward) {
    display: none;
}

/* 选中状态 - 卡片 */
body.selection-mode .archive-card.selected .card {
    background: var(--lifecycle-proposal-bg) !important;
    /* 卡片白色背景 → 黄色背景 */
    box-shadow: 0 0 0 2px var(--lifecycle-proposal);
    /* 卡片外圈加黄色描边 */
}

body.selection-mode .archive-card.selected .event-type {
    background: linear-gradient(135deg, #F0AD4E 0%, #D97706 100%);
    /* 标签加深颜色 */
    box-shadow:
        2px 0 0 0 var(--lifecycle-proposal),   /* 右边外描边 */
        -2px 0 0 0 var(--lifecycle-proposal),  /* 左边外描边 */
        0 -2px 0 0 var(--lifecycle-proposal);  /* 上边外描边 */
    /* 下边不描边，与卡片融为一体 */
}

/* 选中状态 - 日期 */
body.selection-mode .date-label.selected .date-pill {
    background: var(--lifecycle-proposal-bg) !important;
    /* 日期胶囊灰色背景 → 黄色背景 */
    box-shadow: 0 0 0 2px var(--lifecycle-proposal);
    /* 用box-shadow做描边 */
    border-radius: 8px;
    /* 适中的圆角，既柔和又不会挤压文字 */
}

/* 选中状态 - tab标签按钮 */
body.selection-mode .tab-button.selected {
    background: var(--lifecycle-proposal-bg) !important;
    color: var(--lifecycle-proposal);
    box-shadow: 0 0 0 2px var(--lifecycle-proposal);
}

body.selection-mode .date-label {
    cursor: pointer;
}

/* 去掉日期右边的提示文字 */
body.selection-mode .date-label::after {
    display: none;
}

/* 选择占位符 */
.selection-placeholder {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ink-black);
    color: white;
    padding: 24px 32px;
    border-radius: 16px;
    text-align: center;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.selection-placeholder.active {
    display: block;
}

.selection-placeholder h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.selection-placeholder p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* 转发按钮 */
.forward-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: var(--paper-stack-2);
    color: var(--lifecycle-audit);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 400;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-body);
    white-space: nowrap;
    z-index: 2;
}

.forward-btn:hover {
    background: #D9DCDF;
    color: var(--ink-black);
}

/* 底部装饰 */
.footer {
    padding: 48px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.3;
}

.footer-line {
    width: 32px;
    height: 1px;
    background: var(--lifecycle-complete);
    margin-bottom: 8px;
}

.footer-text {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.5em;
    color: var(--ink-black);
}

/* 页面内容样式 */
.page-content {
    padding: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--ink-black);
    margin-bottom: 16px;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--lifecycle-audit);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--lifecycle-audit);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: var(--font-body);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-black);
    line-height: 1.2;
}

.stat-value.highlight {
    color: var(--lifecycle-proposal);
}

.stat-value.accent {
    color: var(--lifecycle-action);
}

.stat-label {
    font-size: var(--font-caption);
    color: var(--lifecycle-audit);
}

/* 信息列表 (Facility Details) */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-body);
    color: var(--text-primary);
    line-height: 1.5;
}

.info-row.divider {
    border-bottom: 1px solid var(--paper-stack-2);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.info-value-highlight {
    color: var(--lifecycle-complete);
    font-weight: 500;
}

/* 警告框 */
.alert-box {
    margin-bottom: 8px;
    padding: 12px;
    background: var(--lifecycle-urgent-bg);
    border: 1px solid rgba(179, 38, 30, 0.2);
    border-radius: 8px;
    font-size: var(--font-body);
    color: var(--lifecycle-urgent);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* 通用列表卡片 (Phone, Guide, Trade) */
.list-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.list-card-content {
    flex: 1;
}

.list-card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-black);
    margin-bottom: 4px;
}

.list-card-subtitle {
    font-size: 14px;
    color: var(--lifecycle-audit);
}

.list-card-action {
    text-align: right;
    flex-shrink: 0;
}

.action-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-black);
}

.action-sub {
    font-size: 13px;
    color: var(--lifecycle-action);
}

/* 图标圆形背景 */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.icon-bg-1 {
    background-color: #8B9A8B;
}

/* 类似 type-decision */
.icon-bg-2 {
    background-color: #7B8BA8;
}

/* 类似 type-announcement */
.icon-bg-3 {
    background-color: #A89B7B;
}

/* 类似 type-consultation */
.icon-bg-4 {
    background-color: #A87B7B;
}

/* 类似 type-complaint */
.icon-bg-5 {
    background-color: var(--lifecycle-proposal);
}

/* 图片查看器 - iOS风格全屏查看 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
    touch-action: none;
    /* 允许图片查看器内的手势操作 */
}

.image-viewer.active {
    display: flex;
}

.image-viewer img {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    animation: scaleIn 0.3s ease;
    display: block;
    transform-origin: center center;
    will-change: transform;
    /* 启用GPU加速 */
}

.image-viewer-close {
    position: fixed; /* 改为fixed，不随滚动 */
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001; /* 比图片高一层 */
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 分类标签组 (Category Tabs) - 二级导航固定层 */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    /* 增加上下padding以容纳选中时的box-shadow描边（2px） */
    background-color: var(--paper-white);
    border-bottom: 1px solid var(--paper-stack-1);
    /* 底部边框分隔内容区 */
    position: fixed;
    top: 136px;
    /* 从一级TabBar结束后开始，避免背景重叠 */
    left: 0;
    right: 0;
    z-index: 35;
    /* 在TabBar下方，但在内容上方 */
    max-width: 896px;
    margin: 0 auto;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 0px 16px;
    /* 去掉上下padding，通过line-height控制 */
    margin-top: -2px;
    /* 负margin使文字上移，让center接近134px */
    border-radius: var(--radius-lg);
    /* 使用胶囊圆角，与一级Tab一致 */
    border: 1px solid transparent;
    background: transparent;
    color: var(--lifecycle-audit);
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 32px;
    /* 用line-height控制垂直居中，文字center约在134px */
    height: 32px;
    /* 明确按钮高度 */
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

.category-tab.active {
    background: var(--paper-stack-2);
    /* 与一级Tab保持一致的浅灰背景 */
    color: var(--ink-black);
    /* 与一级Tab保持一致的深黑文字 */
    border-color: transparent;
}

/* 选中状态 - 覆盖active样式 */
.category-tab.selected {
    background: var(--lifecycle-proposal-bg) !important;
    color: var(--lifecycle-proposal) !important;
    box-shadow: 0 0 0 2px var(--lifecycle-proposal) !important;
    /* 使用box-shadow做描边，与主页tab-button保持一致 */
}

/* 选择模式下的Tab选中状态 */
body.selection-mode .category-tab.selected {
    background: var(--lifecycle-proposal-bg) !important;
    color: var(--lifecycle-proposal) !important;
    box-shadow: 0 0 0 2px var(--lifecycle-proposal) !important;
    /* 与主页tab-button保持一致的选中效果 */
}

/* 交易页面特定样式 */
.trade-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--lifecycle-proposal);
    /* 金钱用强调色 */
}

.tag-small {
    font-size: 13px;
    padding: 2px 6px;
    background: var(--paper-stack-1);
    color: var(--lifecycle-audit);
    border-radius: var(--radius-sm);
    margin-right: 6px;
    vertical-align: middle;
}

/* 报事页面 (Report Page) */
.report-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.report-type-btn {
    padding: 16px;
    background: white;
    border: 2px solid var(--paper-stack-2);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    /* Just in case it's an a tag */
}

.report-type-btn:hover {
    border-color: var(--lifecycle-action);
    box-shadow: var(--card-shadow);
}

.report-type-btn.active {
    border-color: var(--lifecycle-action);
    background: var(--lifecycle-action-bg);
    color: var(--lifecycle-action);
}

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

/* 表单样式 (Forms) */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-black);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--paper-stack-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    font-family: inherit;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--lifecycle-action);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-input {
    accent-color: var(--lifecycle-action);
    margin: 0;
}

.upload-box {
    border: 2px dashed var(--paper-stack-2);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-box:hover {
    border-color: var(--lifecycle-action);
    background: var(--paper-stack-1);
}

.form-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    color: var(--lifecycle-audit);
    background: var(--paper-stack-1);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-submit {
    flex: 2;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: var(--lifecycle-action);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* 提示框 */
.tip-box {
    background: var(--lifecycle-action-bg);
    border: 1px solid rgba(26, 115, 232, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tip-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--lifecycle-action);
    margin-bottom: 8px;
}

.tip-list {
    font-size: 13px;
    color: var(--lifecycle-audit);
    line-height: 1.5;
    margin: 0;
    padding-left: 16px;
}

/* 档案页面 (Archive Page) */
.map-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper-stack-1);
    border-radius: 16px;
    color: var(--lifecycle-audit);
}
/* Toast提示 */
.toast-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    /* 默认隐藏，只有添加active类时才显示 */
}

.toast-message.active {
    display: block;
    animation: toast-fade-in 0.3s ease;
}

.toast-message.toast-hiding {
    animation: toast-fade-out 0.3s ease forwards;
}

@keyframes toast-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toast-fade-out {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 底部固定操作栏 */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
}

/* 选择模式下显示分享操作栏 */
body.selection-mode .share-action-bar {
    display: flex;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 第一行：文字 */
.action-bar-content {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.action-bar-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-black);
}

/* 第二行：两个操作按钮 */
.action-bar-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.action-bar-btn {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--lifecycle-proposal);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    /* 防止按钮获得焦点时清除文本选区（修复移动端选字丢失） */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 防止按钮获得高亮 */
    -webkit-tap-highlight-color: transparent;
}

.action-bar-btn:hover {
    background: #D97706;
}

.action-bar-btn:active {
    transform: scale(0.98);
}

/* 分隔线 */
.action-bar-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 12px 0;
}

/* 第三行：取消按钮 */
.action-bar-cancel {
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--lifecycle-audit);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    /* 防止按钮获得焦点时清除文本选区（修复移动端选字丢失） */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 防止按钮获得高亮 */
    -webkit-tap-highlight-color: transparent;
}

.action-bar-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink-black);
}

.action-bar-cancel:active {
    background: rgba(0, 0, 0, 0.08);
}

/* ========== 报事模式样式 ========== */

/* 报事模式下显示操作栏 */
body.request-mode .request-action-bar {
    display: flex;
    animation: slide-up 0.3s ease;
}

/* 报事模式 - 蓝色按钮（只影响报事操作栏） */
.request-action-bar .action-bar-btn {
    background: var(--lifecycle-action);
}

.request-action-bar .action-bar-btn:hover {
    background: #1557B0;
}

/* 按钮标题 */
.action-btn-title {
    font-size: 16px;
    font-weight: 600;
}

/* 说明文字容器 */
.action-bar-description {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 4px;
}

/* 说明文字项 */
.action-bar-desc-item {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: var(--lifecycle-audit);
    line-height: 1.4;
}

/* 报事模式下的交互禁用 */
body.request-mode .card-link {
    pointer-events: none;
}

body.request-mode .tab-bar {
    pointer-events: auto;
    opacity: 1;
}

body.request-mode .header-actions {
    pointer-events: none;
    opacity: 0.5;
}

body.request-mode .fab-button:not(.fab-request) {
    display: none;
}
