/* ==========================================================================
   通用页面组件样式（迁移自源项目 styles/common.scss）
   --------------------------------------------------------------------------
   源项目所有页面通过 `@import '@/styles/common.scss'` 共享这批全局类，
   本文件是其在 Web 端的等价实现，对 every 页面的作用范围与源保持一致。
   尺寸换算：源rpx -> calc(N * var(--rpx))；源 px 保持 px 不动。

   注意：这里的类名与源 common.scss 同名同作用（全局）。
   页面自身的私有样式一律写在 pages/<module>/css/<name>.css 中，
   并以 `.xxx-page` 根节点限定作用域（如 `.xyzs-page .grid`），避免全局污染。
   ========================================================================== */

/* --------------------------- 通用容器 --------------------------- */

.container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(20 * var(--rpx));
  background-color: #f8f8f8;
  box-sizing: border-box;
}

.main-container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(20 * var(--rpx));
  box-sizing: border-box;
}

.content {
  max-width: var(--page-max-width);
  margin: 0 auto;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
}

.profile-container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  min-height: 100vh;
  box-sizing: border-box;
}

/* --------------------------- 标题区 --------------------------- */

.title-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.title {
  background-color: #fff;
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  text-align: center;
}

.title-info {
  display: block;
  text-align: center;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

.info-container {
  display: none;
}

/* --------------------------- 子页导航条（公共） --------------------------- */
/* PWA 无小程序原生导航栏，各模块子页统一用这一组类自建顶部导航条：
   返回键 + 居中标题 + 右侧占位（保持标题居中），常驻视口顶部。

   定位：position: fixed（等效小程序原生导航栏常驻），与页面滚动容器无关，
   任何滚动上下文下都固定在顶部；宽度与页面列（--page-max-width 居中）对齐。
   脱离文档流后由宿主元素（.app-navbar-slot）占位等高，内容不会被遮挡。
   --app-navbar-h 为导航条实测总高，供页面内其它吸顶元素（列表表头等）作 top 偏移。 */

.app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: calc(20 * var(--rpx) + env(safe-area-inset-top, 0px)) calc(16 * var(--rpx)) calc(16 * var(--rpx));
  background: linear-gradient(135deg, var(--theme-from) 0%, var(--theme-to) 100%);
  /* 主题变量缺失时的底色兜底（否则渐变声明整条失效 -> 背景透明） */
  background-color: var(--theme-from, #667eea);
  /* 常驻视口顶部：z-index 低于底部提交条与弹层（9000），避免遮挡浮层 */
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--page-max-width);
  box-sizing: border-box;
  z-index: 100;
}

/* 导航条宿主（模板里的挂载点）：fixed 后仅作等高占位，高度由组件按实测写入 */
.app-navbar-slot {
  display: block;
}

.app-navbar__back {
  flex: 0 0 calc(60 * var(--rpx));
  font-size: calc(56 * var(--rpx));
  color: #fff;
  line-height: 1;
  cursor: pointer;
  font-weight: 300;
}

.app-navbar__title {
  flex: 1;
  text-align: center;
  font-size: calc(32 * var(--rpx));
  font-weight: 500;
  color: #fff;
}

.app-navbar__placeholder {
  flex: 0 0 calc(60 * var(--rpx));
}

/* --------------------------- 宫格入口 --------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 120px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.grid-item:active {
  opacity: 0.85;
}

.icon {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
}

/* --------------------------- 列表卡片 --------------------------- */

.evaluation-list {
  width: 100%;
}

.evaluation-item {
  background: #fff;
  padding: calc(30 * var(--rpx));
  margin-bottom: calc(24 * var(--rpx));
  border-radius: calc(12 * var(--rpx));
  box-shadow: 0 calc(4 * var(--rpx)) calc(16 * var(--rpx)) rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.evaluation-item:active {
  transform: scale(0.98);
  box-shadow: 0 calc(2 * var(--rpx)) calc(8 * var(--rpx)) rgba(0, 0, 0, 0.06);
}

.item-title {
  font-size: calc(24 * var(--rpx));
  font-weight: bold;
  margin-bottom: calc(12 * var(--rpx));
  color: var(--color-text);
}

.item-info {
  display: flex;
  align-items: center;
  font-size: calc(20 * var(--rpx));
  color: var(--color-text-light);
}

.item-info .text {
  margin-right: calc(20 * var(--rpx));
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.status-text {
  display: flex;
  align-items: center;
  margin-left: auto;
  color: var(--color-text-sub);
}

/* --------------------------- 通知 / 公告列表 --------------------------- */

.notice-list {
  padding: calc(10 * var(--rpx)) 0;
}

.notice-item {
  background-color: #fff;
  border-radius: calc(16 * var(--rpx));
  padding: calc(24 * var(--rpx));
  margin-bottom: calc(20 * var(--rpx));
  box-shadow: 0 calc(2 * var(--rpx)) calc(12 * var(--rpx)) rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.notice-item:active {
  transform: scale(0.99);
}

/* --------------------------- 状态位 --------------------------- */

.loading,
.empty {
  padding: calc(80 * var(--rpx)) calc(20 * var(--rpx));
  color: var(--color-text-light);
  font-size: calc(28 * var(--rpx));
  text-align: center;
}

.load-more,
.no-more {
  text-align: center;
  padding: calc(40 * var(--rpx)) calc(20 * var(--rpx));
  color: var(--color-text-light);
  font-size: calc(28 * var(--rpx));
  background-color: #fff;
  margin: calc(20 * var(--rpx)) 0;
  border-radius: calc(16 * var(--rpx));
}

.load-more {
  cursor: pointer;
}

.load-more:active {
  background-color: #f5f7fa;
}

.no-more {
  cursor: default;
}

/* --------------------------- 区块小标题 --------------------------- */

.section-title {
  font-size: calc(28 * var(--rpx));
  font-weight: bold;
  color: var(--color-text);
  margin-bottom: calc(16 * var(--rpx));
}

/* ==========================================================================
   通用组件外观（js/page-kit.js 的配套样式）
   对应 u-popup(mode="bottom") 与 uni-datetime-picker 的视觉表现
   ========================================================================== */

/* --------------------------- 底部弹层 --------------------------- */

.kit-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.kit-sheet {
  width: 100%;
  max-width: var(--page-max-width);
  max-height: 70vh;
  background: #fff;
  border-radius: calc(20 * var(--rpx)) calc(20 * var(--rpx)) 0 0;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.kit-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(24 * var(--rpx)) calc(30 * var(--rpx));
  border-bottom: calc(1 * var(--rpx)) solid #f0f0f0;
}

.kit-sheet-title {
  font-size: calc(30 * var(--rpx));
  font-weight: bold;
  color: var(--color-text);
}

.kit-sheet-close {
  font-size: calc(26 * var(--rpx));
  color: #409eff;
  padding: calc(6 * var(--rpx)) calc(16 * var(--rpx));
  cursor: pointer;
}

.kit-sheet-body {
  overflow-y: auto;
  padding: calc(16 * var(--rpx)) calc(24 * var(--rpx));
  display: flex;
  flex-wrap: wrap;
  gap: calc(12 * var(--rpx));
  align-content: flex-start;
  max-height: 55vh;
}

.kit-sheet-item {
  padding: calc(14 * var(--rpx)) calc(24 * var(--rpx));
  background-color: #f5f7fa;
  border-radius: calc(8 * var(--rpx));
  font-size: calc(28 * var(--rpx));
  color: var(--color-text-sub);
  cursor: pointer;
  user-select: none;
}

.kit-sheet-item.selected {
  background-color: #2979ff;
  color: #fff;
}

/* --------------------------- 日期选择字段 --------------------------- */

.kit-date-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(60 * var(--rpx));
  padding: calc(8 * var(--rpx)) calc(12 * var(--rpx));
  border: calc(1 * var(--rpx)) solid #e5e5e5;
  border-radius: calc(8 * var(--rpx));
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
}

.kit-date-text {
  flex: 1;
  min-width: 0;
  font-size: calc(26 * var(--rpx));
  line-height: 1.2;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kit-date-text.placeholder {
  color: #c0c4cc;
}

.kit-date-arrow {
  margin-left: calc(8 * var(--rpx));
  color: #999;
  font-size: calc(18 * var(--rpx));
}

/* 透明的原生日期控件，铺满整个字段用于唤起系统日期选择器 */
.kit-date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}

/* --------------------------- 表单行（u-form-item 等价） --------------------------- */

.kit-form-item {
  display: flex;
  align-items: center;
  padding: calc(12 * var(--rpx)) 0;
  border-bottom: calc(1 * var(--rpx)) solid #f5f5f5;
}

.kit-form-item--column {
  display: block;
  border-bottom: none;
}

.kit-form-label {
  flex: 0 0 calc(160 * var(--rpx));
  font-size: calc(28 * var(--rpx));
  color: var(--color-text-sub);
}

.kit-form-control {
  flex: 1;
  min-width: 0;
}

.kit-input,
.kit-textarea {
  width: 100%;
  padding: calc(8 * var(--rpx));
  border: calc(1 * var(--rpx)) solid #e5e5e5;
  border-radius: calc(8 * var(--rpx));
  font-size: calc(26 * var(--rpx));
  color: var(--color-text);
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
}

.kit-textarea {
  min-height: calc(140 * var(--rpx));
  resize: vertical;
}

/* --------------------------- 结果表格（common.scss） --------------------------- */

.result-table {
  border: calc(1 * var(--rpx)) solid #e5e5e5;
  border-radius: calc(8 * var(--rpx));
  overflow: hidden;
}

.result-header {
  display: flex;
  background-color: #f5f7fa;
  border-bottom: calc(1 * var(--rpx)) solid #e5e5e5;
}

.header-cell {
  flex: 1;
  padding: calc(15 * var(--rpx)) calc(10 * var(--rpx));
  text-align: center;
  font-size: calc(26 * var(--rpx));
  font-weight: bold;
  color: var(--color-text-sub);
  border-right: calc(1 * var(--rpx)) solid #e5e5e5;
}

.header-cell:last-child {
  border-right: none;
}

.result-row {
  display: flex;
  border-bottom: calc(1 * var(--rpx)) solid #e5e5e5;
}

.result-row:last-child {
  border-bottom: none;
}

.cell {
  flex: 1;
  padding: calc(15 * var(--rpx)) calc(10 * var(--rpx));
  text-align: center;
  font-size: calc(24 * var(--rpx));
  color: var(--color-text);
  border-right: calc(1 * var(--rpx)) solid #e5e5e5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell:last-child {
  border-right: none;
}

/* --------------------------- 按钮组（common.scss） --------------------------- */

.button-group {
  display: flex;
  gap: calc(15 * var(--rpx));
  margin-top: calc(15 * var(--rpx));
}

/* --------------------------- 空提示（common.scss） --------------------------- */

.empty-tip {
  padding: calc(40 * var(--rpx));
  text-align: center;
  color: #999;
}

/* --------------------------- 主按钮（u-button primary circle） --------------------------- */

.kit-btn {
  border: none;
  border-radius: calc(999 * var(--rpx));
  padding: calc(18 * var(--rpx)) 0;
  font-size: calc(30 * var(--rpx));
  color: #fff;
  background: #2979ff;
  cursor: pointer;
  width: 100%;
}

.kit-btn:active {
  opacity: 0.85;
}
