/* ============================================================
   信息 App — iOS 风格界面
   ============================================================ */

:root{
  --blue:#007AFF;
  --green:#34C759;
  --orange:#FF9500;
  --red:#FF3B30;
  --label:#000000;
  --label2:#8E8E93;
  --label3:#C7C7CC;
  --fill:#F2F2F7;
  --fill2:#E9E9EB;
  --sep:#C6C6C8;
  --bg:#FFFFFF;
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{
  margin:0;height:100%;overflow:hidden;
  background:var(--bg);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--label);
  -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
  text-rendering:optimizeLegibility;
}
input,textarea,button{font-family:inherit;color:inherit}
button{border:0;background:none;padding:0;cursor:pointer}

.sprite{position:absolute;width:0;height:0;overflow:hidden}
.ic{width:22px;height:22px;display:block;flex:none;color:currentColor}
.ic-16{width:16px;height:16px}
.ic-18{width:18px;height:18px}
.ic-19{width:19px;height:19px}
.ic-20{width:20px;height:20px}
.ic-22{width:22px;height:22px}
.ic-23{width:23px;height:23px}

/* ---------------- 视图容器 ---------------- */
.app{
  position:fixed;inset:0;
  overflow:hidden;
}
.view{
  position:absolute;inset:0;
  display:flex;flex-direction:column;
  width:100%;
  background:var(--bg);
  overflow:hidden;
  transition:transform .32s cubic-bezier(.32,.72,0,1);
  will-change:transform;
}
.view.is-active{transform:translateX(0)}
.view-push{transform:translateX(100%)}
.view-push.is-active{transform:translateX(0)}
.view-list.pushed{transform:translateX(-26%);opacity:.96}

/* ---------------- 顶部导航 ---------------- */
.nav{
  display:flex;align-items:center;justify-content:space-between;
  padding:calc(var(--top) + 8px) 16px 0;
  height:calc(var(--top) + 52px);
  flex:none;
}
.pill-btn{
  height:34px;padding:0 15px;border-radius:999px;
  background:#fff;
  font-size:15px;font-weight:400;color:#000;
  box-shadow:0 0 0 .5px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.06);
}
.pill-btn:active{background:#f0f0f2}
.circle-btn{
  width:36px;height:36px;border-radius:50%;
  background:#fff;display:flex;align-items:center;justify-content:center;
  color:#000;
  box-shadow:0 0 0 .5px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.07);
}
.circle-btn:active{background:#f0f0f2}
.nav .circle-btn{width:40px;height:40px}

/* 大标题 */
.big-title{
  font-size:34px;line-height:1.1;font-weight:700;letter-spacing:-.6px;
  margin:6px 16px 8px;flex:none;
}

/* ---------------- 列表 ---------------- */
.list{
  flex:1;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;
  padding-bottom:96px;
  scrollbar-width:none;
}
.list::-webkit-scrollbar,.form::-webkit-scrollbar,.thread::-webkit-scrollbar{display:none;width:0;height:0}
.row-item{
  position:relative;
  display:grid;
  grid-template-columns:9px 44px minmax(0,1fr) 12px;
  column-gap:11px;
  align-items:center;
  padding:9px 16px 9px 7px;
  background:#fff;
  cursor:pointer;
  width:100%;
}
.row-item:active{background:#f2f2f7}
.row-item::after{
  content:"";position:absolute;left:76px;right:0;bottom:0;height:.5px;
  background:var(--sep);opacity:.65;transform:scaleY(.9);
}
.row-item:last-child::after{display:none}

.unread{
  width:9px;height:9px;border-radius:50%;background:var(--blue);
  justify-self:center;opacity:0;
}
.row-item.is-unread .unread{opacity:1}

.avatar{
  width:44px;height:44px;border-radius:50%;
  background:radial-gradient(circle at 30% 22%,#AAB3D9 0%,#8B94C0 55%,#767FA9 100%);
  display:flex;align-items:center;justify-content:center;
  color:rgba(255,255,255,.92);
}
.avatar .ic{width:26px;height:26px}
.avatar.is-letter{font-size:19px;font-weight:500;letter-spacing:0}

.row-main{min-width:0;display:flex;flex-direction:column;gap:1px}
.row-line1{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.who{
  font-size:17px;font-weight:600;letter-spacing:-.2px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.when{font-size:15px;color:var(--label2);flex:none;font-weight:400}
.preview{
  font-size:15px;line-height:1.28;color:var(--label2);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;word-break:break-word;
}
.chev{color:#C4C4C6;justify-self:end}

.list-empty{
  padding:60px 24px;text-align:center;color:var(--label2);font-size:15px;
}

/* 编辑模式 */
.row-item.editing{padding-left:16px}
.row-item .del-btn{
  display:none;position:absolute;right:16px;top:50%;transform:translateY(-50%);
  font-size:15px;color:var(--red);padding:8px 4px;
}
.list.is-editing .row-item .del-btn{display:block}
.list.is-editing .row-item .when{opacity:.35}
.list.is-editing .row-item .chev{opacity:0}
.list.is-editing .row-item{padding-right:76px}

/* ---------------- 底部搜索 / 撰写 ---------------- */
.bottom-bar{
  position:absolute;left:0;right:0;bottom:0;
  display:flex;align-items:center;gap:9px;
  padding:8px 16px calc(var(--bot) + 10px);
  background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,#fff 22%);
  pointer-events:none;
}
.bottom-bar > *{pointer-events:auto}
.search{
  flex:1;height:40px;border-radius:999px;background:var(--fill);
  display:flex;align-items:center;gap:7px;padding:0 12px;
  color:var(--label2);
}
.search input{
  flex:1;min-width:0;border:0;background:transparent;outline:none;
  font-size:16px;color:#000;
}
.search input::placeholder{color:#8E8E93}
.search input::-webkit-search-cancel-button{display:none}
.mic{color:#8E8E93}
.compose{
  width:44px;height:44px;border-radius:50%;background:#fff;
  display:flex;align-items:center;justify-content:center;color:#1c1c1e;
  box-shadow:0 0 0 .5px rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.13);
}
.compose:active{transform:scale(.95)}

/* ---------------- 二级页导航 ---------------- */
.nav-bar{
  position:relative;
  padding:calc(var(--top) + 4px) 12px 0;
  height:calc(var(--top) + 48px);
  justify-content:space-between;
}
.nav-title{
  position:absolute;left:0;right:0;top:calc(var(--top) + 4px);
  height:40px;display:flex;align-items:center;justify-content:center;
  font-size:17px;font-weight:600;letter-spacing:-.2px;
  pointer-events:none;
}
.nav-bar .back{width:36px;height:36px}
.text-btn{
  font-size:17px;font-weight:600;color:var(--blue);padding:0 6px;height:36px;
}
.text-btn:active{opacity:.5}

/* ---------------- 表单 ---------------- */
.form{
  flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  background:var(--fill);
  padding:12px 0 calc(var(--bot) + 28px);
}
.card{
  margin:0 16px 18px;background:#fff;border-radius:12px;overflow:hidden;
}
.card-head{
  display:flex;align-items:center;gap:6px;
  padding:7px 16px;
  background:#F6F6F8;
  font-size:13px;color:var(--label2);
}
.card-head .head-ic{width:15px;height:15px}
.head-ic.blue{color:var(--blue)}
.head-ic.orange{color:var(--orange)}
.head-ic.green{color:var(--green)}
.head-ic.red{color:var(--red)}

.row{
  position:relative;
  display:flex;align-items:flex-start;gap:12px;
  padding:9px 16px;min-height:52px;
  --sep-left:16px;
}
.row.with-badge{--sep-left:58px}
.row + .row::before{
  content:"";position:absolute;left:var(--sep-left,16px);right:0;top:0;height:.5px;
  background:var(--sep);opacity:.6;
}
.row.column{flex-direction:column;align-items:stretch;gap:8px}
.row-column{flex-direction:column;align-items:stretch;gap:8px}
.badge{
  width:30px;height:30px;border-radius:7px;flex:none;
  display:flex;align-items:center;justify-content:center;color:#fff;
  margin-top:1px;
}
.badge.green{background:linear-gradient(180deg,#4CD964,#34C759)}
.badge.blue{background:linear-gradient(180deg,#3D9BFF,#0A7CFF)}
.badge.orange{background:linear-gradient(180deg,#FFAE3D,#FF9500)}
.row-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.row-label{font-size:13px;color:#000;letter-spacing:-.1px}
.row-input{
  font-size:17px;color:#000;border:0;outline:none;background:transparent;
  padding:0;margin:0;min-height:23px;width:100%;
}
.row-input::placeholder{color:var(--label3)}
.row-input.placeholder{color:var(--label3)}
.row-input.filled{color:#000}

.ghost-picker{
  position:absolute;inset:0;width:100%;height:100%;
  opacity:0;border:0;background:transparent;
}
.row.tap:active{background:#f7f7f9}
.row .chev{margin-top:6px;color:#C4C4C6}

/* 分段控件 */
.segment{
  display:flex;background:var(--fill2);border-radius:9px;padding:2px;gap:2px;
  height:33px;
}
.seg{
  flex:1;border-radius:7px;font-size:14px;font-weight:400;color:#000;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s ease, box-shadow .15s ease;
}
.seg.on{
  background:#fff;font-weight:500;
  box-shadow:0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.03);
}

.row-textarea{
  width:100%;border:0;outline:none;resize:none;background:transparent;
  font-size:16px;line-height:1.45;color:#000;min-height:92px;padding:0;
}
.row-textarea::placeholder{color:var(--label3)}

/* ---------------- 会话详情 ---------------- */
.thread{
  flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  background:#fff;
  padding:16px 16px 14px;
  display:flex;flex-direction:column;gap:6px;
  scrollbar-width:none;
}
.thread-bar{
  display:flex;align-items:center;gap:9px;
  padding:8px 12px calc(var(--bot) + 8px);
  background:rgba(249,249,249,.96);
  border-top:.5px solid var(--sep);
  backdrop-filter:blur(20px);
}
.thread-input{
  flex:1;min-height:34px;display:flex;align-items:center;
  background:#fff;border:.5px solid #D6D6DB;border-radius:17px;padding:0 12px;
}
.thread-input input{
  flex:1;min-width:0;border:0;outline:none;background:transparent;
  font-size:16px;height:32px;color:#000;
}
.thread-input input::placeholder{color:var(--label3)}
.send-btn{
  width:32px;height:32px;border-radius:50%;flex:none;
  background:var(--blue);color:#fff;
  display:flex;align-items:center;justify-content:center;
  transition:transform .12s ease, opacity .15s ease;
}
.send-btn:active{transform:scale(.92)}
.send-btn.off{opacity:.35}
.bubble{
  max-width:74%;padding:9px 13px;border-radius:18px;
  font-size:16px;line-height:1.35;word-break:break-word;
  white-space:pre-wrap;
}
.bubble.in{align-self:flex-start;background:#E9E9EB;color:#000;border-bottom-left-radius:5px}
.bubble.out{align-self:flex-end;background:linear-gradient(180deg,#40AEFF,#0A84FF);color:#fff;border-bottom-right-radius:5px}
.thread-meta{
  align-self:center;font-size:12px;color:var(--label2);margin:6px 0 12px;
}
.thread-empty{
  margin:auto;color:var(--label2);font-size:15px;
}

/* ---------------- 底部弹层 ---------------- */
.sheet-mask{
  position:fixed;inset:0;background:rgba(0,0,0,.28);
  display:flex;align-items:flex-end;
  opacity:0;pointer-events:none;transition:opacity .22s ease;
  z-index:40;
}
.sheet-mask.on{opacity:1;pointer-events:auto}
.sheet{
  width:100%;padding:8px 8px calc(var(--bot) + 8px);
  display:flex;flex-direction:column;gap:8px;
  transform:translateY(16px);transition:transform .26s cubic-bezier(.32,.72,0,1);
}
.sheet-mask.on .sheet{transform:translateY(0)}
.sheet-item{
  height:54px;border-radius:14px;background:rgba(255,255,255,.96);
  font-size:18px;color:var(--blue);
  backdrop-filter:blur(20px);
}
.sheet-item:active{background:#ececf0}
.sheet-item.cancel{font-weight:600;color:#000;margin-top:2px}
