/* ==========================================================================
   TrustInTrust.Rcl 的**宿主无关共享全局样式**
   路径：_content/TrustInTrust.Rcl/rcl.css

   为什么放在 RCL：RCL 的页面/组件只写"页面级"样式，像 .tnt-card 这种**通用卡片**是全局的。
   以前这份规则被抄进各宿主自己的 wwwroot/app.css（Server 一份、WindowsApp 一份，后者的注释还写着
   "改 web 那份时记得同步这一份"）—— AndroidStaffApp 从来没抄到，于是真机上所有 tnt-card 卡片
   没有底色/左侧色条/圆角/阴影，body 底色也不对（用户反馈的"根 css 没引入"）。

   现在：**单一来源就是本文件**。每个宿主壳只引一次：
     Web（Server / 瘦 Web / WASM） : <link rel="stylesheet" href="_content/TrustInTrust.Rcl/rcl.css" />
     Blazor Hybrid（Windows/Android）: 同上（静态资源管道同样提供 _content/...）
   宿主自己的 app.css 只留"宿主专属"规则（安全区、导航栏占位、Mud 兜底等），别再抄这里的内容。
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

/* ===== 全局页面边距（各宿主统一口径，单一来源）=====
   为什么需要：web 宿主的 MainLayout 把内容套在 `.content.px-4` 里（左右各 24px），
   而 Blazor Hybrid 宿主（AndroidStaffApp / WindowsApp）的 MainLayout 是**裸 @Body** ——
   于是同一个 RCL 页面在小程序里两边有 24px、在 App 里**贴边**（现场："需要采用全局的边距"）。

   用法：宿主布局把 @Body 套一层 `<div class="tnt-page-pad">`（Android 已套）。
   页面若要自己控制边距（例如按 vmin 排版的工作台），**不要**再套这个类，
   或者把自己那层横向 padding 去掉、交给这里统一管。
   改这里 = 改所有宿主的页面边距。 */
:root {
    /* ===== 全局内边距（padding）配置：**单一来源** =====
       背景（需求）：页面 / 卡片 / 小控件的上下左右内边距过去散落在各自的 <style> 里
       （同级元素有的 0.6vmin、有的 1.2vmin），现场反馈"上下左右的 padding 应该用全局配置"。

       约定：页面与组件只写 `padding: var(--tnt-xxx-pad-y) var(--tnt-xxx-pad-x)`，
       不要再写死数值；要整体调松/调紧只改这一段。
       下面每个变量的默认值 = 各处**既有值**，所以换用变量前后观感不变；
       要改外观就先改这里（一改全宿主生效）。

         --tnt-page-pad / --tnt-page-pad-y : 页面级（宿主布局 .tnt-page-pad 管左右；页面根容器管上下）
         --tnt-card-pad-y/-x              : 纵向卡片（.tnt-card）
         --tnt-bar-pad-y/-x               : 横向卡片 / 头（通道头 .ch-root 等）
         --tnt-box-pad-y/-x               : 内嵌框（清册框、关联票框）
         --tnt-btn-pad-y/-x               : 胶囊按钮（返回列表、筛选按钮…）
         --tnt-chip-pad-y/-x              : 小控件（复制id、小标记）
         --tnt-tag-pad-y/-x               : 角标 / 标签（清册、投、预）
         --tnt-row-pad-y/-x               : 列表行 / 切片行 */
    --tnt-page-pad: 12px;        /* 页面左右（宿主布局用；名字沿用既有） */
    --tnt-page-pad-y: 2vmin;     /* 页面上下（页面根容器用） */
    --tnt-card-pad-y: 1.5vmin;
    --tnt-card-pad-x: 1vmin;
    --tnt-bar-pad-y: 1vmin;
    --tnt-bar-pad-x: 1.6vmin;
    --tnt-box-pad-y: 1vmin;
    --tnt-box-pad-x: 1.4vmin;
    --tnt-btn-pad-y: .6vmin;
    --tnt-btn-pad-x: 2vmin;
    --tnt-chip-pad-y: .4vmin;
    --tnt-chip-pad-x: .8vmin;
    --tnt-tag-pad-y: .5vmin;
    --tnt-tag-pad-x: 1vmin;
    --tnt-row-pad-y: .6vmin;
    --tnt-row-pad-x: 1.2vmin;

    /* ===== 字体与卡片外观：finance / matters / meetings / basics 统一从这里取 =====
       以前各模块自己写 font-family/字号、卡片底色/左侧色条/圆角/阴影，导致四套观感。 */
    --tnt-font-family: Roboto, "Microsoft YaHei", "PingFang SC", sans-serif;
    --tnt-font-size: 3.4vmin;
    --tnt-card-bg: #F9FAFA;
    --tnt-card-bar: #FF5203;
    --tnt-card-radius: 3vmin;
    --tnt-card-shadow: var(--mud-elevation-1);
    --tnt-gap: 1vmin;

    /* 字号阶梯：页面标题 / 区块标题 / 正文 / 辅助信息 */
    --tnt-title-size: 4.2vmin;
    --tnt-section-title-size: 3.6vmin;
    --tnt-text-size: 3.4vmin;
    --tnt-meta-size: 3vmin;
    /* 小字号阶梯（表格、标签、辅助行） */
    --tnt-font-2xs: 2vmin;
    --tnt-font-xs: 2.4vmin;
    --tnt-font-sm: 2.6vmin;
    --tnt-font-md: 2.8vmin;
    --tnt-font-lg: 3vmin;
    --tnt-font-xl: 3.2vmin;
}

.tnt-page-pad {
    padding-left: var(--tnt-page-pad);
    padding-right: var(--tnt-page-pad);
    /* ⚠ 底色必须跟着铺：这层只加左右 padding，页面自己的背景（.wb-page 等）会被"缩"进去，
       左右两条和底部就露出宿主/body 的另一种底色（现场：工作台两侧各一条 #F1F5F8 的边，
       页面区是 #F3EEEA —— 同屏两种底色）。这里把它铺满并撑到整屏高。 */
    background: #F3EEEA;
    min-height: 100vh;
    box-sizing: border-box;
}

/* 页面统一底色 #F3EEEA。
   ⚠ 必须写成 `html body`（两个元素选择器）：MudBlazor 的 CSS 里有一条
   `body{…;background-color:var(--mud-palette-background)}`，而主题的
   --mud-palette-background 是白色，且 MudBlazor.min.css 常在宿主 app.css **之后**加载 ——
   同优先级时后者胜出，白底就是这么露出来的。提高一级优先级才能稳定盖住。 */
html body {
    background: #F3EEEA;
    font-family: var(--tnt-font-family);
}

/* 通用卡片（由 Basic .bd-card 提升为全局并更名 tnt-card） */
.tnt-card {
    background: var(--tnt-card-bg);
    display: flex;
    flex-direction: column;
    width: 100%;
    border-left: .65vmin solid var(--tnt-card-bar);
    padding: var(--tnt-card-pad-y) var(--tnt-card-pad-x);
    gap: .5vmin;
    border-top-left-radius: var(--tnt-card-radius);
    border-bottom-left-radius: var(--tnt-card-radius);
    box-shadow: var(--tnt-card-shadow);
}

/* 通用按钮（由 PartVotesPage 的 .pv-btn 提升为全局并更名 tnt-btn）
   —— 与 .tnt-card 同一套思路：**单一来源**，各宿主/各页面共用一份，别再各写一遍。

   为什么提升：旧的页内按钮写的是 `padding: 0 4vmin` —— 纵向内边距为 0，
   按钮高度只剩行高（真机上 ≈13px），文字被压扁、左右留白也不协调（用户反馈
   "查看详情按钮要用全局统一样式，圆角、上下左右 padding 都要合适"）。
   现在：圆角 + 四周内边距 + 最小高度/宽度，触屏可点区域足够。 */
.tnt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8vmin;
    background: #AD2D24;
    color: #fff;
    font-size: 3.4vmin;
    line-height: 1.2;
    /* 上下左右都要有内边距：纵向 1.5vmin 保证文字不贴边，横向 5vmin 保证不显拥挤 */
    padding: 1.5vmin 5vmin;
    border: none;
    border-radius: 2.5vmin;
    min-height: 10vmin;
    min-width: 22vmin;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tnt-btn:hover { filter: brightness(.94); }
.tnt-btn:active { filter: brightness(.88); }

/* ===== 页面根容器：统一**上下**页边距 =====
   左右由宿主布局的 .tnt-page-pad 管（见上面的约定），页面自己只补上下 ——
   以前 channel-detail / clip-detail 的根容器没加，表现为"上面贴边、下面留一大块空"。
   用法：页面最外层 `<div class="tnt-page-root">`（页内自己的高度/布局写在 style 上）。 */
.tnt-page-root {
    padding: var(--tnt-page-pad-y) 0;
    box-sizing: border-box;
}

/* ===== 统一字号阶梯 =====
   页面标题、区块标题、正文、辅助信息都从这里取，页面里不要再写 4.2vmin / 3.6vmin / 3vmin。 */
.tnt-title {
    font-size: var(--tnt-title-size);
    font-weight: 700;
    line-height: 1.25;
}

.tnt-section-title {
    font-size: var(--tnt-section-title-size);
    font-weight: 700;
    line-height: 1.3;
}

.tnt-text {
    font-size: var(--tnt-text-size);
}

.tnt-meta {
    font-size: var(--tnt-meta-size);
    color: #6B7280;
}

/* 次要按钮（灰底）：与主按钮同尺寸，只换底色 */
.tnt-btn-ghost { background: #979797; }

/* ===== 统一 Tab 样式（meeting / basics 共用）=====
   一级：.tnt-tabs + .tnt-tab；二级：.tnt-subtabs + .tnt-subtab。
   字号、颜色、行高、下划线、间距只在这里维护，页面/组件不要再写自己的 tab 样式。 */
.tnt-tabs {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2vmin;
    border-bottom: .1vmin solid rgba(0, 0, 0, .12);
    padding: 0 1vmin;
    width: 100%;
    overflow-x: auto;
}

/* tab 行里的刷新按钮：做成正方形并与 tab 文本垂直居中，图标水平/垂直都在正中 */
.tnt-tabs .tnt-nav-btn {
    align-self: center;
    padding: .6vmin;
    width: 4.6vmin;
    height: 4.6vmin;
    min-width: 4.6vmin;
    box-sizing: border-box;
}

.tnt-tabs .tnt-nav-btn svg {
    display: block;
    margin: 0;
}

.tnt-tab {
    font-size: var(--tnt-section-title-size);
    font-weight: 500;
    color: #979797;
    text-decoration: none;
    line-height: 4.8vmin;
    border-bottom: .4vmin solid #979797;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}

.tnt-tab.active {
    color: #AD2D24;
    border-bottom-color: #AD2D24;
}

.tnt-subtabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.6vmin 2.6vmin;
    border-bottom: .1vmin solid rgba(0, 0, 0, .12);
    padding: .4vmin 1vmin 0;
    width: 100%;
}

.tnt-subtab {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--tnt-text-size);
    font-weight: 500;
    color: #979797;
    text-decoration: none;
    line-height: 4.4vmin;
    white-space: nowrap;
    border-bottom: .4vmin solid transparent;
}

.tnt-subtab.active {
    color: #AD2D24;
    font-weight: 700;
    border-bottom-color: #AD2D24;
}

/* ===== 详情页顶部导航条（回列表 / 返回 / 首页）=====
   与 .tnt-card / .tnt-btn 同一套思路：**单一来源**，各页不要自己再写一份。
   按钮本身用 Views/Nav 下的 BackButton / ListButton / HomeButton（会议域与基础数据域共用同一套），
   本类只负责"把它们排成一行"：
       <div class="tnt-navbar">
           <ListButton Text="回列表" Href="/basics/person-list" />
           <BackButton Href="/basics/person-list" />
       </div>
   —— 按钮按内容宽度排列（与会议头部一致），窄屏自动换行。 */
.tnt-navbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2vmin;
    width: 100%;
}

/* ===== 导航按钮（HomeButton / CopyButton / RefreshButton 共用一套外观）=====
   需求：复制、刷新、回家三颗按钮**样式统一**（红底白图标、圆角、可收起成只有图标），
   所以样式只在这里定义一份，组件里不要再各写一份。 */
.tnt-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6vmin;
    border: 0;
    border-radius: 1vmin;
    padding: .6vmin 1.4vmin;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.tnt-nav-btn:active { filter: brightness(.9); }
.tnt-nav-text { font-size: 3vmin; }
/* 收起 / 展开按钮（统一一个类：工具行的「全部通道」与每张通道卡右上角那颗**同一套样式**）
   需求：不要底色，只留一个透明点击区；图标颜色/尺寸由使用处的 MudIcon 决定。 */
.tnt-fold-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6vmin;
    background: transparent;
    color: #686095;
    cursor: pointer;
}

/* ===== 赏菊苑车位导航页（Pages/ParkingMap.razor）===== */
.pm-page {
    display: flex;
    flex-direction: row;
    gap: 1vmin;
    width: 100%;
    height: calc(100dvh - 4vmin);
    min-height: 560px;
    color: #2f2a27;
}

.pm-map-pane {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e3deda;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(63, 45, 34, 0.08);
}

.pm-toolbar {
    flex: 0 0 auto;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid #eee8e3;
    background: #fffdfb;
}

.pm-title-wrap {
    min-width: 0;
}

.pm-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #3e2723;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-status {
    margin-top: 3px;
    font-size: 12px;
    color: #8d6e63;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.pm-tool {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #ded7d1;
    border-radius: 8px;
    background: #ffffff;
    color: #4e342e;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pm-tool:hover {
    background: #fff3e0;
    border-color: #ffb74d;
}

.pm-tool:focus-visible,
.pm-tab:focus-visible,
.pm-building:focus-visible,
.pm-unit:focus-visible,
.pm-zone:focus-visible,
.pm-spot:focus-visible {
    outline: 2px solid #c62828;
    outline-offset: 2px;
}

.pm-reset {
    width: auto;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
}

.pm-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.95), transparent 36%),
        linear-gradient(135deg, #f3f1ef 0%, #e9e6e3 100%);
}

.pm-svg-host {
    position: absolute;
    inset: 0;
    touch-action: none;
    cursor: grab;
    user-select: none;
}

.pm-svg-host svg {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    touch-action: none;
}

.pm-svg-host.pm-grabbing {
    cursor: grabbing;
}

.pm-map-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 2;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #6d5b52;
    font-size: 11px;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pm-map-loading,
.pm-map-error {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(80%, 460px);
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #5d4037;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.pm-map-error {
    color: #b71c1c;
    pointer-events: none;
}

.pm-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid #ffccbc;
    border-top-color: #c62828;
    border-radius: 50%;
    animation: pm-spin 0.8s linear infinite;
}

@keyframes pm-spin {
    to {
        transform: rotate(360deg);
    }
}

.pm-nav {
    flex: 0 0 clamp(270px, 27vw, 350px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #d32f2f;
    border-radius: 12px;
    background: #fffdfc;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.07), 0 6px 20px rgba(63, 45, 34, 0.08);
}

.pm-nav-head {
    flex: 0 0 auto;
    padding: 13px 14px 10px;
    border-bottom: 1px solid #ffcdd2;
    background: linear-gradient(180deg, #fff7f5 0%, #fffdfc 100%);
}

.pm-nav-title {
    font-size: 16px;
    font-weight: 800;
    color: #b71c1c;
    letter-spacing: 0.06em;
}

.pm-nav-sub {
    margin-top: 3px;
    font-size: 11px;
    color: #9e786b;
}

.pm-tabs {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 8px 10px;
    border-bottom: 1px solid #ffe0dd;
    background: #fff8f7;
}

.pm-tab {
    padding: 8px 6px;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    background: #ffffff;
    color: #b71c1c;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pm-tab:hover {
    background: #ffebee;
}

.pm-tab.active {
    border-color: #c62828;
    background: #c62828;
    color: #ffffff;
}

.pm-nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ef9a9a transparent;
}

.pm-nav-scroll::-webkit-scrollbar {
    width: 7px;
}

.pm-nav-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #ef9a9a;
}

.pm-section + .pm-section {
    margin-top: 10px;
}

.pm-building,
.pm-zone {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e2dbd6;
    border-radius: 8px;
    background: #faf8f6;
    color: #3e2723;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pm-building:hover,
.pm-zone:hover {
    border-color: #e57373;
    background: #fff5f2;
}

.pm-building.active,
.pm-zone.active {
    border-color: #c62828;
    background: #ffebee;
    color: #b71c1c;
}

.pm-count {
    flex: 0 0 auto;
    color: #9e8e84;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.pm-building.active .pm-count,
.pm-zone.active .pm-count {
    color: #c62828;
}

.pm-units {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 6px 0 0 8px;
}

.pm-unit {
    padding: 5px 10px;
    border: 1px solid #d7ccc8;
    border-radius: 999px;
    background: #ffffff;
    color: #5d4037;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pm-unit:hover {
    border-color: #ffb74d;
    background: #fff8e1;
}

.pm-unit.active {
    border-color: #ef6c00;
    background: #ffe0b2;
    color: #bf360c;
    font-weight: 700;
}

.pm-spots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 0 0 8px;
}

.pm-spot {
    min-width: 0;
    padding: 4px 2px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #ffffff;
    color: #4e4e4e;
    font: inherit;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pm-spot:hover {
    border-color: #ffb74d;
    background: #fff8e1;
}

.pm-spot.active {
    border-color: #c62828;
    background: #ffcdd2;
    color: #8e0000;
    font-weight: 700;
}

/* 定位后让目标图形闪 2 秒（5 次 × 0.4 秒），JS 在 2000ms 时移除类。 */
.pm-svg-host .pm-target-flash {
    animation: pm-target-blink 0.4s ease-in-out 5;
}

.pm-svg-host .pm-target-flash,
.pm-svg-host .pm-target-flash * {
    fill: #ffd54f !important;
    stroke: #ff1744 !important;
    stroke-width: 4px !important;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px rgba(255, 23, 68, 0.9));
}

@keyframes pm-target-blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }
}

@media (max-width: 900px) {
    .pm-page {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    .pm-map-pane {
        height: 62dvh;
        min-height: 410px;
    }

    .pm-nav {
        flex: 0 0 auto;
        height: 42dvh;
        min-height: 320px;
        width: 100%;
    }

    .pm-spots {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* ===== 工具行小胶囊（.tnt-chip）：录票 / 收起展开 / 筛选 共用 =====
   需求：这三个控件样式统一 —— 同一高度、同一配色、同一圆角，只有宽度随内容变化；
   选中态（筛选生效等）用 .on（紫底白字），不要再各自造一套颜色/尺寸。
   用法：<div class="tnt-chip">…</div> / <FoldToggle Chip="true" … /> */
.tnt-chip {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8vmin;
    height: 5vmin;
    padding: 0 2.2vmin;
    background: #F9F9F9;
    border: 0.05vmin solid rgba(0,0,0,0.12);
    border-radius: 2.5vmin;
    color: #5C5A6B;
    font-family: inherit;
    font-size: var(--mts-s5, 3vmin);
    line-height: 1;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.tnt-chip:active { background: #F0EFF4; }
.tnt-chip.on,
.tnt-chip.on:active {
    background: #686095;
    border-color: #686095;
    color: #fff;
}
