/* 客户门户**组件**样式（阶段 5.2；任务 7.2 起只保留组件部分）。
   头部/页脚/容器/配色一律由 website.css 承担（官网与客户门户共用一套布局，
   业务方 2026-10-28 定「官网风格为准」），这里只留门户独有的组件：
   卡片、表格、表单、徽标、角标、提示条、消息列表。
   不参与后台（BootstrapBlazor）样式，因此这里不需要任何框架 reset。
   任务 5.2 原计划用 Tailwind + npm 构建；为满足「dotnet build 不依赖 npm」的门禁，
   改为手写这一份（决议见 doc/08 阶段 5 的 D 记录）：功能等价、无需构建链。 */

:root {
    --portal-primary: #0b57a4;
    --portal-primary-dark: #08427c;
    --portal-danger: #dc3545;
    --portal-success: #198754;
    --portal-warning: #b58105;
    --portal-text: #1c2733;
    --portal-muted: #5b6b7c;
    --portal-border: #e2e8ef;
    --portal-bg: #f5f8fb;
}

* { box-sizing: border-box; }

.portal-page-title { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.portal-page-subtitle { margin: 0 0 20px; color: var(--portal-muted); font-size: 13px; }

.portal-card {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.portal-card-title { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.portal-stat { background: #fff; border: 1px solid var(--portal-border); border-radius: 8px; padding: 16px; }
.portal-stat-label { color: var(--portal-muted); font-size: 13px; }
.portal-stat-value { font-size: 26px; font-weight: 600; margin-top: 4px; }

.portal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.portal-actions form { margin: 0; display: inline-block; }

.portal-btn {
    display: inline-block;
    border: 1px solid var(--portal-border);
    background: #fff;
    color: var(--portal-text);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}
.portal-btn:hover { background: #f3f4f6; text-decoration: none; }
.portal-btn-primary { background: var(--portal-primary); border-color: var(--portal-primary); color: #fff; }
.portal-btn-primary:hover { background: var(--portal-primary-dark); }
.portal-btn-danger { background: var(--portal-danger); border-color: var(--portal-danger); color: #fff; }
.portal-btn-danger:hover { background: #bb2d3b; }
.portal-btn-sm { padding: 4px 10px; font-size: 12px; }

.portal-table { width: 100%; border-collapse: collapse; background: #fff; }
.portal-table th, .portal-table td {
    border-bottom: 1px solid var(--portal-border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}
.portal-table th { background: #fafbfc; font-weight: 600; font-size: 13px; color: var(--portal-muted); }
.portal-table tr:last-child td { border-bottom: none; }
.portal-table-wrap { background: #fff; border: 1px solid var(--portal-border); border-radius: 8px; overflow: hidden; }

.portal-empty { padding: 40px 16px; text-align: center; color: var(--portal-muted); }

.portal-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #eef2f7;
    color: var(--portal-muted);
    white-space: nowrap;
}
.portal-badge-success { background: #e7f5ee; color: var(--portal-success); }
.portal-badge-warning { background: #fdf3e2; color: var(--portal-warning); }
.portal-badge-danger { background: #fdecee; color: var(--portal-danger); }
.portal-badge-info { background: #e8f1fe; color: var(--portal-primary); }

.portal-alert { border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.portal-alert-success { background: #e7f5ee; color: var(--portal-success); }
.portal-alert-error { background: #fdecee; color: var(--portal-danger); }
.portal-alert-info { background: #e8f1fe; color: var(--portal-primary); }

.portal-form { max-width: 420px; }
.portal-field { margin-bottom: 14px; }
.portal-label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--portal-muted); }
.portal-input, .portal-select, .portal-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--portal-text);
}
.portal-input:focus, .portal-select:focus, .portal-textarea:focus {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}
.portal-hint { color: var(--portal-muted); font-size: 12px; margin-top: 4px; }
.portal-error { color: var(--portal-danger); font-size: 13px; margin: 0 0 12px; }

.portal-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.portal-dl dt { color: var(--portal-muted); }
.portal-dl dd { margin: 0; }

.portal-muted { color: var(--portal-muted); }
.portal-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-right { text-align: right; }
.portal-mt { margin-top: 16px; }

.portal-auth {
    max-width: 420px;
    margin: 48px auto;
}
.portal-auth .portal-card { padding: 28px; }
.portal-auth-title { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.portal-auth-sub { margin: 0 0 20px; color: var(--portal-muted); font-size: 13px; }

.portal-lines-table td, .portal-lines-table th { font-size: 13px; }

.portal-nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: var(--portal-danger);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.portal-message-filter { margin-bottom: 14px; }
.portal-message { border-left: 3px solid transparent; }
.portal-message-unread { border-left-color: var(--portal-primary); }
.portal-message-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.portal-message-title { font-size: 15px; font-weight: 600; }
.portal-message-unread .portal-message-title::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--portal-primary);
    vertical-align: middle;
}
.portal-message-time { color: var(--portal-muted); font-size: 12px; white-space: nowrap; }
.portal-message-body { margin-top: 8px; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.portal-message-actions { margin-top: 12px; justify-content: flex-end; }
.portal-muted-text { color: var(--portal-muted); font-size: 12px; margin-right: auto; }

/* 订单进度的「全程进度」（任务 13.2）：一行一个事件，最新在上 */
.portal-timeline { list-style: none; margin: 0; padding: 0; }
.portal-timeline-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid #eef1f4;
}
.portal-timeline-item:last-child { border-bottom: none; }
.portal-timeline-time { color: var(--portal-muted); font-size: 12px; white-space: nowrap; }
.portal-timeline-kind {
    flex: none;
    padding: 1px 8px;
    border-radius: 10px;
    background: #f1f4f7;
    color: var(--portal-muted);
    font-size: 12px;
}
.portal-timeline-title { font-size: 14px; font-weight: 600; }
.portal-timeline-detail { flex-basis: 100%; margin-left: 82px; color: var(--portal-muted); font-size: 13px; }

@media (max-width: 640px) {
    .portal-timeline-detail { margin-left: 0; }
}

@media (max-width: 640px) {
    .portal-dl { grid-template-columns: 1fr; gap: 2px; }
    .portal-dl dd { margin-bottom: 8px; }
}

/* ---------- 本项目补充（V1 原文件没有的部分） ----------
   价档单选：门户询价页选「价格档」用，一行一个可点的档位。 */
.portal-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-radio {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--portal-border);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}
.portal-radio input { accent-color: var(--portal-primary); }
.portal-radio em { color: var(--portal-muted); font-size: 12px; font-style: normal; }
.portal-radio:has(input:disabled) { background: #f5f8fb; color: #9aa5b1; cursor: not-allowed; }

/* 在线算价面板（§20.15 第 2 条）：一行一个箱型（档名 + 单价 + 数量输入），V1 的公开页没有这种控件。 */
.portal-calc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.portal-calc-name { min-width: 76px; font-size: 14px; }
.portal-calc-price { color: var(--portal-muted); font-size: 13px; margin-right: auto; }
.portal-calc-qty { width: 92px; }
.portal-calc-inputs { display: flex; gap: 10px; }
.portal-calc-total { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; margin-top: 8px; }
.portal-calc-values { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* ---------- 定舱单（前台申请订舱页） ----------
   照老系统定舱单的分区：发货人 / 收货人 / 通知方三栏一块，航线一块，委托条款与其它要求各一块。 */
.portal-form-wide { max-width: 100%; }
.portal-block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.portal-block { border: 1px solid var(--portal-border); border-radius: 8px; padding: 14px 16px; background: #fcfdfe; }
.portal-block-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.portal-block-title em { color: var(--portal-muted); font-size: 12px; font-style: normal; font-weight: 400; margin-left: 6px; }
.portal-required { color: var(--portal-danger); }
.portal-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 12px; cursor: pointer; }
.portal-check input { accent-color: var(--portal-primary); }
.portal-check-row { display: flex; flex-wrap: wrap; gap: 12px; }
.portal-choice { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.portal-choice input { accent-color: var(--portal-primary); }
/* 勾了 To Order / 同收货人 时整块收起来（脚本只切 hidden 属性，这里保证不会被 display 顶掉） */
.portal-form [hidden] { display: none !important; }
/* jQuery Validate 的提示（前端那道校验） */
.portal-validate-error { display: block; color: var(--portal-danger); font-size: 12px; margin-top: 4px; }
