:root{
  --bg-top:#f6fbff;
  --bg-bottom:#e6f0ff;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#4f76ff;
  --primary-2:#3e66f6;
  --danger:#ef4444;
  --ring: rgba(79,118,255,.22);
  --shadow: 0 14px 30px rgba(15, 23, 42, .10);
  --radius: 18px;
  --glass: rgba(255,255,255,.58);
  --glass-strong: rgba(255,255,255,.72);
  --stroke: rgba(255,255,255,.38);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color:var(--text);
  /* 雾蓝磨砂：柔和淡蓝底 + 轻微渐变 */
  background:
    radial-gradient(1200px 900px at 20% 15%, rgba(155, 200, 255, .55), transparent 60%),
    radial-gradient(1000px 750px at 85% 25%, rgba(210, 225, 255, .55), transparent 55%),
    radial-gradient(900px 700px at 55% 90%, rgba(196, 220, 255, .40), transparent 55%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-x:hidden;
}

/* 轻微雾面噪点（非常淡） */
body::before{
  content:"";
  position:fixed;
  inset:-2px;
  pointer-events:none;
  background-image:
    radial-gradient(rgba(255,255,255,.20) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity:.06;
}

h1{font-size:26px;margin:0 0 8px}

.muted{color:var(--muted);line-height:1.6}

.app{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(255,255,255,.50);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom:1px solid rgba(255,255,255,.35);
}

.brand{display:flex;gap:12px;align-items:center}
.brand-icon{
  width:44px;height:44px;border-radius:14px;
  background: rgba(79,118,255,.20);
  color: rgba(15,23,42,.82);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
  border:1px solid rgba(255,255,255,.55);
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
}
.brand-name{font-weight:800;font-size:18px;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted)}

.icon-btn{
  width:40px;height:40px;border-radius:14px;
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor:pointer;
  font-size:18px;
}
.icon-btn:active{transform:scale(.98)}

.main{
  flex:1;
  padding:16px;
  max-width:980px;
  width:100%;
  margin:0 auto;
}

.page{display:none;animation:fade .18s ease}
.page.active{display:block}
@keyframes fade{from{opacity:.4;transform:translateY(2px)}to{opacity:1;transform:none}}

.section{margin-top:18px}
.section-title{font-weight:700;margin-bottom:10px}

.row{display:flex;gap:12px;align-items:center;justify-content:flex-start;margin:12px 0}

.btn-primary,.btn-secondary,.btn-danger{
  border:none;
  border-radius:16px;
  padding:12px 14px;
  font-weight:700;
  cursor:pointer;
}
.btn-primary{background:var(--primary);color:#fff;box-shadow:0 12px 22px rgba(79,118,255,.22)}
.btn-primary:hover{background:var(--primary-2)}
.btn-secondary{background:rgba(255,255,255,.62);border:1px solid rgba(255,255,255,.55);color:var(--text);backdrop-filter: blur(14px);-webkit-backdrop-filter: blur(14px)}
.btn-danger{background:rgba(239,68,68,.10);border:1px solid rgba(239,68,68,.25);color:#b91c1c}

.cards{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media (min-width: 860px){
  .cards{grid-template-columns: repeat(2, minmax(0,1fr));}
}

.card{
  background:var(--glass);
  border:1px solid rgba(255,255,255,.55);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.card-head{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.card-title{font-weight:800}
.card-sub{color:var(--muted);font-size:13px;margin-top:4px;line-height:1.4}
.card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.small-btn{
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.58);
  cursor:pointer;
}
.small-btn.primary{background:rgba(79,118,255,.16);border-color:rgba(79,118,255,.25)}
.small-btn.danger{background:rgba(239,68,68,.10);border-color:rgba(239,68,68,.22)}
.small-btn:active{transform:scale(.98)}

.empty{
  border:1.5px dashed rgba(100,116,139,.35);
  border-radius:var(--radius);
  padding:18px;
  margin:10px 0;
  background: rgba(255,255,255,.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.empty-title{font-weight:800}
.empty-sub{color:var(--muted);margin-top:6px;line-height:1.5}

.tabbar{
  position:sticky;
  bottom:0;
  display:flex;
  justify-content:space-around;
  padding:10px 8px 14px;
  background: rgba(255,255,255,.50);
  border-top:1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-item{
  flex:1;
  margin:0 6px;
  padding:10px 0;
  border-radius:16px;
  border:1px solid transparent;
  background:transparent;
  cursor:pointer;
  font-weight:700;
  color: rgba(15,23,42,.72);
}
.nav-item.active{
  border-color: rgba(79,118,255,.25);
  background: rgba(79,118,255,.12);
  color: var(--primary);
}

.tabs{display:flex;gap:10px;margin:10px 0 14px}
.tab{
  flex:1;
  padding:10px 0;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor:pointer;
  font-weight:800;
  color: rgba(15,23,42,.72);
}
.tab.active{background: rgba(79,118,255,.14);border-color: rgba(79,118,255,.24);color: var(--primary)}

.segmented{
  display:flex;
  gap:10px;
  margin: 8px 0 12px;
}
.seg-btn{
  flex:1;
  padding:10px 0;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor:pointer;
  font-weight:800;
  color: rgba(15,23,42,.72);
}
.seg-btn.active{background: rgba(79,118,255,.14);border-color: rgba(79,118,255,.24);color: var(--primary)}

.account{display:flex;gap:12px;align-items:center}
.avatar{
  width:52px;height:52px;border-radius:18px;
  background: rgba(79,118,255,.16);
  border:1px solid rgba(255,255,255,.55);
  display:flex;align-items:center;justify-content:center;
  font-weight:900;
}

/* Modal */
.modal.hidden{display:none}
.modal{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:18px}
.modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.35);backdrop-filter: blur(2px)}
.modal-card{
  position:relative;
  width:min(860px, 100%);
  max-height: 86vh;
  overflow:hidden;
  border-radius:22px;
  background: rgba(255,255,255,.70);
  border:1px solid rgba(255,255,255,.55);
  box-shadow: 0 20px 60px rgba(15,23,42,.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 14px 10px}
.modal-title{font-weight:900;font-size:18px}
.modal-body{padding:0 14px 14px;overflow:auto;max-height: calc(86vh - 120px)}
.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:12px 14px 14px;border-top:1px solid rgba(255,255,255,.45);background: rgba(255,255,255,.40)}

/* Toast */
.toast.hidden{display:none}
.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:84px;
  background: rgba(15,23,42,.88);
  color:#fff;
  padding:10px 14px;
  border-radius:16px;
  z-index:60;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

/* Form */
.form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.form .hint{font-size:12px;color:var(--muted);line-height:1.5}

.grid-2{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media (min-width: 760px){
  .grid-2{grid-template-columns: 1fr 1fr;}
}

.field{display:flex;flex-direction:column;gap:6px}
.field label{font-weight:800;font-size:13px}
.field label .req{color:#ef4444;margin-left:4px}
.field input,.field textarea,.field select{
  width:100%;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.62);
  outline:none;
}
.field input:focus,.field textarea:focus,.field select:focus{
  box-shadow: 0 0 0 5px var(--ring);
  border-color: rgba(79,118,255,.30);
}
.field textarea{min-height:92px;resize:vertical;line-height:1.5}

.char-count{font-size:12px;color:var(--muted);text-align:right;margin-top:-2px}

.avatar-picker{
  display:flex;
  align-items:center;
  gap:12px;
}
.avatar-preview{
  width:64px;height:64px;border-radius:20px;
  border:1px solid rgba(255,255,255,.55);
  background: rgba(79,118,255,.10);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color: rgba(15,23,42,.65);
}
.avatar-preview img{width:100%;height:100%;object-fit:cover}

.details{
  border:1px solid rgba(255,255,255,.55);
  border-radius:18px;
  background: rgba(255,255,255,.44);
  padding:10px 12px;
}
.details summary{cursor:pointer;font-weight:900;list-style:none}
.details summary::-webkit-details-marker{display:none}
.details summary:after{content:"▾";float:right;color:var(--muted)}
.details[open] summary:after{content:"▴"}
.details .details-body{margin-top:10px;display:flex;flex-direction:column;gap:12px}

.choice-row{display:flex;gap:10px;flex-wrap:wrap}
.chip{
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.55);
  border-radius:999px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:800;
  color: rgba(15,23,42,.72);
}
.chip.active{border-color:rgba(79,118,255,.24);background:rgba(79,118,255,.14);color:var(--primary)}

.checklist{display:flex;flex-direction:column;gap:8px}
.checkitem{display:flex;align-items:center;gap:10px}
.checkitem input{width:18px;height:18px}

/* Loading overlay */
 .loading-overlay{
  position:fixed;
  inset:0;
  z-index:999;
  transition: opacity .25s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(1100px 760px at 20% 20%, rgba(155, 200, 255, .55), transparent 60%),
    radial-gradient(900px 600px at 80% 30%, rgba(210, 225, 255, .55), transparent 55%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}
.loading-overlay.hidden{display:none}
.loading-overlay.fadeout{opacity:0;pointer-events:none}
.loading-card{
  width:min(420px, 100%);
  text-align:center;
  background: rgba(255,255,255,.55);
  border:1px solid rgba(255,255,255,.55);
  border-radius:24px;
  padding:28px 18px 24px;
  box-shadow: 0 20px 70px rgba(15,23,42,.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.loading-icon{display:flex;justify-content:center;align-items:center;animation:iconFloat .6s ease-in-out infinite}
@keyframes iconFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-8px)}
}
.loading-title{
  margin-top:10px;
  font-weight:900;
  font-size:18px;
  letter-spacing:.2px;
  /* 允许自动换行：避免右侧出现省略号/残留文字 */
  padding: 0 8px;
  line-height: 1.2;
}
.loading-bar{
  width: min(360px, 100%);
  height: 12px;
  margin: 16px auto 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.60);
  border:1px solid rgba(255,255,255,.55);
  overflow:hidden;
  position: relative;
}
.loading-bar-fill{
  /* 进度条“胶囊”本体宽度（与原版保持一致） */
  width: 42%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(140,196,255,.35), rgba(140,196,255,.95), rgba(140,196,255,.35));
  /*
    关键点：用 transform 连续平滑地从「右侧完全外面」→「左侧完全外面」
    这样不会出现：到不了边缘 / 突然消失又突然出现。

    解释一下这两个数：
    - 条宽是 42%，translateX(240%) ≈ 移动 2.4 * 42% ≈ 100.8%（整条在右侧外面）
    - translateX(-100%) 刚好整条在左侧外面
  */
  transform: translateX(240%);
  animation: barSlide .6s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes barSlide{
  from{transform: translateX(240%);}
  to{transform: translateX(-100%);}
}
.loading-text{
  font-size: 13px;
  color: rgba(15,23,42,.60);
  letter-spacing: .6px;
}

@media (prefers-reduced-motion: reduce){
  .loading-icon,.loading-bar-fill{animation:none}
}
