/* assets/app.css */
:root{
  --bg: #f5f6fb;
  --card: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: rgba(16,24,40,.10);
  --primary: #2563eb;
  --danger: #dc2626;

  --radius: 18px;
  --shadow: 0 18px 50px rgba(16, 24, 40, .10);

  --tap: 52px;
  --font: 16px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b1220;
    --card: rgba(255,255,255,.06);
    --text: #e5e7eb;
    --muted: rgba(229,231,235,.70);
    --border: rgba(255,255,255,.12);
    --primary: #3b82f6;
    --danger: #ef4444;
    --shadow: 0 18px 60px rgba(0,0,0,.45);
  }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, rgba(37,99,235,.12), transparent 55%),
              var(--bg);
}

/* iPhone 安全区 */
.safe{
  padding: 18px 14px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

/* ✅ 默认：移动端优先（像 App 的居中卡片） */
.page{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ✅ 默认移动端容器：窄 */
.shell{
  width: min(720px, 100%);
  margin: 0 auto;
}

.return{
    display: block;
    width: 50px;
    height: 50px !important;
    text-align: center;
    font-size: 12px !important;
    line-height: 60px;
    background: #fff !important;
    position: fixed;
    right: 20px;
    bottom: 100px;
    padding: 0 !important;
}

/* ✅ PC/大屏：变成正常网页内容区（更宽） */
@media (min-width: 992px){
  .page{
    align-items: flex-start;      /* 不再垂直居中，像正常网页从上开始 */
    justify-content: center;
  }
  .shell{
    width: min(1200px, calc(100% - 80px)); /* 最大1200，左右留白 */
    margin-top: 24px;
  }
}

/* 顶部标题块 */
.brand{
  display:flex;
  flex-direction:column;
  gap: 6px;
  margin-bottom: 14px;
}
.brand h1{
  margin:0;
  font-size: 22px;
  letter-spacing:.2px;
}
.brand p{
  margin:0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

/* 卡片 */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-body{
  padding: 18px;
}

.field{ margin: 12px 0; }
.label{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.input{
  width:100%;
  height: var(--tap);
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.65);
  color: var(--text);
  outline:none;
  -webkit-appearance: none;
}
@media (prefers-color-scheme: dark){
  .input{ background: rgba(255,255,255,.06); }
}
.input:focus{
  border-color: rgba(37,99,235,.75);
  box-shadow: 0 0 0 4px rgba(37,99,235,.18);
}

/* 按钮 */
.btn{
  height: var(--tap);
  border:0;
  border-radius: 14px;
  cursor:pointer;
  font-weight: 700;
  font-size: 15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 0 14px;
  text-decoration:none;
  user-select:none;
}
.btn-primary{
  background: linear-gradient(180deg, rgba(37,99,235,1), rgba(29,78,216,1));
  color:#fff;
}
.btn-ghost{
  background: transparent;
  border:1px solid var(--border);
  color: var(--text);
}
.btn-danger{
  background: rgba(220,38,38,.12);
  border: 1px solid rgba(220,38,38,.25);
  color: var(--danger);
}

/* 提示/错误 */
.note{
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.alert{
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  border:1px solid rgba(220,38,38,.25);
  background: rgba(220,38,38,.08);
  color: var(--danger);
}

/* 顶部栏 */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.topbar .title{
  font-weight: 900;
  letter-spacing:.2px;
}
.topbar .actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* 列表项（像 App） */
.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display:flex;
  gap:12px;
  align-items:flex-start;
  text-decoration:none;
  color: var(--text);
  background: rgba(255,255,255,.35);
}
@media (prefers-color-scheme: dark){
  .item{ background: rgba(255,255,255,.03); }
}
.item:hover{
  border-color: rgba(37,99,235,.35);
}
.item .main{
  flex:1;
  min-width: 0;
}
.item .t{
  font-weight: 900;
  margin:0 0 6px;
  font-size: 16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.item .m{
  margin:0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.badge{
  flex:0 0 auto;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* 编辑器容器 */
.editor-wrap{
  border-radius: 16px;
  overflow:hidden;
  background: rgba(255,255,255,.5);
  margin: 14px;
}
.editor-wrap img{
    display: block;
    width: 90%;
    margin: 0 auto;
}
.editor-wrap p{
    display: block;
    width: 90%;
    margin: 0 auto;
}
.meta-row{
    justify-content: center;
}
.editor-wrap p img{
    width: 100%;
    margin: 10px 0px;
}
@media (prefers-color-scheme: dark){
  .editor-wrap{ background: rgba(255,255,255,.03); }
}
.editor-toolbar{
  border-bottom: 1px solid var(--border);
}
.editor-area{
  min-height: 380px;
}

/* 小屏优化 */
@media (max-width: 520px){
  .shell{ width: 100%; }
  .card-body{ padding: 16px; }
}
