/* tips.js 专用样式（2026-11-02 打赏：数据、记录、设置三个页签，docs/tips.md 6.2）。通用组件和设计变量在 app.css；这里只放本页独有的类，
   覆盖通用类时用 [data-view=tips] 限定（对话框同样带 data-view）。布局照为爱发电（cheer.css）。 */

/* 页签（.tips-tabs，role=tablist）：2026-11-24 起由 glass.css 统一画成分段控件，这里不再自带下划线样式 */

/* 筛选：时间段占第一行，搜索、排序（记录页是作品与读者编号）在第二行；控件同高 */
.tips-filters>.tips-period{flex:1 1 100%;margin:0}
[data-view=tips] .period-bar{gap:12px 20px}
/* 时间段预设是 app.css 的分段控件（.period-presets）：格子之间不另加间距；整条和日期框、下一行的输入框同高（2026-11-24） */
[data-view=tips] .period-presets .button{min-height:calc(var(--control-h) - 6px)}
[data-view=tips] .period-dates{gap:8px 10px}
[data-view=tips] .period-dates input{height:var(--control-h);min-height:var(--control-h);padding:8px 10px 8px 12px;font-size:14px}
/* 作品（可选）：标签下一行是当前作品（或“全部作品”）和按钮；查找区（book-picker.css）展开时占整行，排到“查询”之后 */
.tips-book-choice{min-width:0}
.tips-filters>.tips-book-choice{flex:2 1 300px}
.tips-filters>.tips-reader-filter{flex:1 1 220px}
.tips-field-label{display:block;font-size:13px;line-height:var(--label-h);color:var(--text-2);font-weight:600}
.tips-book-shown{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-height:var(--control-h);margin-top:var(--label-gap)}
.tips-book-value{min-width:0;font-size:14px;font-weight:600;color:var(--text);overflow-wrap:anywhere}
.tips-book-value>.table-sub{display:inline;margin-left:8px;font-weight:400}
/* 查找区在页面底色上：和卡片一样白底、无边框（2026-11-24 iOS 风格） */
.tips-book-finder{min-width:0;padding:12px 14px;border:0;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-sm)}
.tips-filters>.tips-book-finder{flex:1 1 100%;order:1}
[data-view=tips] [name=userId]{font-family:var(--mono)}

/* 合计五格 */
.tips-stats{grid-template-columns:repeat(5,minmax(0,1fr))}

/* 表格：数字列右对齐、等宽数字 */
.tips-table table{font-variant-numeric:tabular-nums}
.tips-table :is(th,td):nth-child(n+2){text-align:right;white-space:nowrap}
.tips-table.sticky-actions :is(th,td):last-child{text-align:left}
.tips-table .tips-book,.tips-table .tips-reader{min-width:180px}
/* 弹窗里的小表：细线圈出、圆角同分组列表（2026-11-24，原来是 1px 边框） */
.tips-days .tips-table,.tips-detail .tips-table{border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
.tips-detail .metadata{margin-bottom:16px}

/* 记录：第一列勾选框，作品、读者、礼物、留言、状态左对齐；留言可换行；已作废的行变灰 */
.tips-records :is(th,td):is(:nth-child(1),:nth-child(2),:nth-child(3),:nth-child(4),:nth-child(5),:nth-child(8),:nth-child(9)){text-align:left}
.tips-records td:is(:nth-child(3),:nth-child(4),:nth-child(5)){white-space:normal;overflow-wrap:anywhere}
.tips-records :is(.tips-book,.tips-reader){min-width:160px;max-width:260px}
.tips-records .tips-gift{min-width:110px;max-width:200px}
.tips-records :is(th,td):nth-child(1){width:36px;padding-right:0}
.tips-records .tips-pick input{width:16px;height:16px;margin:0}
/* 留言、状态两列带上 td（2026-11-12）：原来的选择器比上面“数字列不折行”那条弱，折行没生效，留言拉成一长条，
   1440 宽的屏幕上“状态”列被挤到横向滚动区外面 */
.tips-records td.tips-message{min-width:180px;max-width:320px;white-space:normal;overflow-wrap:anywhere;line-height:1.6}
.tips-message-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.tips-records td.tips-state{min-width:150px;white-space:normal}
.tips-records .tips-state .badge+.badge{margin-left:6px}
.tips-records .tips-void-reason{max-width:240px;overflow-wrap:anywhere}
.tips-records tr.tips-voided>td{color:var(--muted)}
.tips-batch{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;padding:12px 20px;border-bottom:1px solid var(--border-soft)}
.tips-batch-count{font-size:13px;color:var(--muted)}

/* 设置：模式、测试账号、比例、门槛是 glass.css 的分组列表（.ios-list，2026-11-24 同为爱发电）；礼物六档是一张小表，排在列表下面，
   “礼物”两个字和 iOS 分组标题一样是灰色小字；只读事实放在表单上面的浅底块里 */
.tips-choice-set{display:flex;flex-wrap:wrap;gap:8px 10px;border:0;margin:0;padding:0}
.tips-choice-set legend{width:100%;margin-bottom:6px;font-size:13px;font-weight:600;color:var(--text-2)}
.tips-gifts{border:0;margin:22px 0 0;padding:0;min-width:0}
.tips-gifts legend{width:100%;margin:0 4px 8px;padding:0;font-size:13px;font-weight:600;color:var(--muted)}
.tips-gifts>.form-hint{margin:0 4px 10px}
.tips-gift-table{border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
/* 上架是开关（tips.js 给勾选框加 role=switch，glass.css 画成 iOS 开关），和“上架”两个字垂直居中 */
.tips-gift-table .check-label{align-items:center}
.tips-gift-table table{min-width:560px}
.tips-gift-table td{vertical-align:middle}
.tips-gift-table .tips-gift-place{white-space:nowrap}
.tips-gift-table .tips-gift-place .table-sub{display:block}
.tips-gift-table input[type=text]{width:100%;min-width:140px}
.tips-gift-table input[type=number]{width:100%;min-width:120px;font-variant-numeric:tabular-nums}
.tips-settings-form>.notice{margin-bottom:16px}
/* 今天的数字和最近保存放在表单上面（2026-11-12，tips.js）：先看现状，再改设置 */
/* 浅灰底的信息块，同弹窗里的键值面板（2026-11-24：去掉边框，圆角加大） */
.tips-readonly{margin-bottom:18px;padding:14px 18px;border:0;border-radius:14px;background:var(--field-bg)}
/* 电脑上礼物表不拉满整行（名称最多 8 个字、价格最多 7 位数），行收紧：输入框用小号，和其他设置表单的表格一样（2026-11-12）。
   手机上每档一块的排法不变 */
@media(min-width:761px){
  .tips-gift-table{max-width:860px}
  .tips-gift-table td{padding-top:8px;padding-bottom:8px}
  .tips-gift-table td input:not([type=checkbox]){min-height:var(--control-h-sm);margin:0;padding:5px 10px;font-size:13px}
}
.tips-settings-locked{margin:16px 0 0}

@media(max-width:1280px) {
  .tips-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px) {
  /* 手机：七个预设排成四列两行，两个日期各占一半；合计两列；作品与读者列收窄，后面的数字露出一部分，看得出表格可以横滑 */
  [data-view=tips] .tips-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
  [data-view=tips] .period-presets .button{min-width:0;padding-left:6px;padding-right:6px}
  [data-view=tips] .period-dates{flex:1 1 100%;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
  [data-view=tips] .period-dates input{width:100%;min-width:0}
  .tips-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tips-table .tips-book,.tips-table .tips-reader{min-width:140px}
  .tips-table :is(.tips-book,.tips-reader) :is(.table-title,.table-sub){max-width:160px}
  .tips-batch{padding:12px 16px}
  /* 礼物六档：手机上每档一块，档位占一行，名称与价格各半，上架在下面，不用横滑 */
  .tips-gift-table table{min-width:0}
  .tips-gift-table thead{display:none}
  .tips-gift-table tbody{display:block}
  [data-view=tips] .tips-gift-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 10px;padding:12px 14px;border-bottom:1px solid var(--border-soft)}
  [data-view=tips] .tips-gift-table tr:last-child{border-bottom:0}
  [data-view=tips] .tips-gift-table td{display:block;padding:0;border:0}
  [data-view=tips] .tips-gift-table td.tips-gift-place{grid-column:1/-1}
  [data-view=tips] .tips-gift-table .tips-gift-place .table-sub{display:inline;margin-left:8px}
  .tips-gift-table input[type=text],.tips-gift-table input[type=number]{min-width:0}
}
