/* 基础重置与移动端优化 */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(43,110,242,0.18), rgba(43,110,242,0) 55%),
    radial-gradient(900px 480px at -10% 0%, rgba(34,197,94,0.15), rgba(34,197,94,0) 50%),
    linear-gradient(180deg, #f7f9ff 0%, #f6f7fb 100%);
  color: #1f2329;
}

:root {
  --primary: #2b6ef2;
  --primary-press: #1f55c0;
  --danger: #f44336;
  --success: #22c55e;
  --warning: #f59e0b;
  --text: #1f2329;
  --subtext: #5a6473;
  --border: #e6e8ee;
  --card: #ffffff;
  --bg: #f6f7fb;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(27, 39, 75, 0.08);
}

.container { max-width: 560px; margin: 0 auto; padding: 16px 16px 32px; }

/* 登录页容器高度最大化 */
body[data-page="login"] .container { min-height: 100svh; display: flex; flex-direction: column; }

.header { padding: 24px 8px 8px; display: flex; align-items: center; justify-content: space-between; }
.header-title { font-size: 22px; font-weight: 700; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  border: 1px solid rgba(27,39,75,0.06);
  backdrop-filter: saturate(110%) blur(2px);
}

/* 登录页美化（上下风格统一） */
.login-hero { padding-top: 22px; padding-bottom: 8px; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-badge { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(100% 100% at 70% 20%, #6aa6ff 0%, #2b6ef2 60%, #1f55c0 100%); box-shadow: 0 8px 18px rgba(43,110,242,0.35), inset 0 0 10px rgba(255,255,255,0.35); }
.login-title { margin-top:30px; font-size: 26px; font-weight: 800; letter-spacing: 0.2px; }
.login-subtitle { margin-top: 12px; color: var(--subtext); font-size: 15px; }

.form { margin-top: 18px; }
.login-card { padding: 20px 16px 16px; }
/* 下半部分应用同款渐变色 */
body[data-page="login"] .login-card {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(43,110,242,0.18), rgba(43,110,242,0) 55%),
    radial-gradient(900px 480px at -10% 0%, rgba(34,197,94,0.15), rgba(34,197,94,0) 50%),
    linear-gradient(180deg, #f7f9ff 0%, #f6f7fb 100%);
  border-color: transparent;
}
.field { margin-bottom: 14px; }
.label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--subtext); }
.input { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px 0 42px; font-size: 16px; background: #fff; outline: none; transition: box-shadow .18s ease, border-color .18s ease, transform .05s ease; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(43,110,242,0.14); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(244,67,54,0.12); }
.input.icon-phone { background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.6 10.8c1.4 2.7 3.9 5.2 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.2 1 .4 2.1.6 3.2.6.4 0 .8.4.8.8V20c0 .9-.7 1.6-1.6 1.6C9.9 21.6 2.4 14.1 2.4 4.8 2.4 3.9 3.1 3.2 4 3.2h3.6c.4 0 .8.4.8.8 0 1.1.2 2.2.6 3.2.2.4.1.9-.2 1.2L6.6 10.8z' fill='%235a6473'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 20px; background-position: 12px center; }
.input.icon-code { background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14M5 7h14M5 17h8' stroke='%235a6473' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 20px; background-position: 12px center; }
.row { display: flex; gap: 10px; }

.btn { height: 48px; padding: 0 16px; border: none; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0.3px; box-shadow: 0 6px 14px rgba(43,110,242,0.28); transition: transform .05s ease, background .15s ease, box-shadow .15s ease; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:active { background: var(--primary-press); transform: translateY(1px); box-shadow: 0 4px 10px rgba(43,110,242,0.22); }
.btn[disabled] { opacity: 0.6; box-shadow: none; }
.btn-secondary { background: #eef2ff; color: var(--primary); box-shadow: none; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid rgba(43,110,242,0.35); box-shadow: none; }
.btn-block { width: 100%; }

.form-tip { margin-top: 10px; color: var(--subtext); font-size: 12px; text-align: center; }
.divider { height: 1px; background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(27,39,75,0.12) 50%, rgba(0,0,0,0) 100%); margin: 14px 0; }

/* 项目卡片（结构与可读性优化） */
.project-list { margin-top: 12px; }
.project-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 12px; margin-bottom: 12px; border: 1px solid rgba(27,39,75,0.06); transition: transform .05s ease, box-shadow .15s ease; }
.project-card:active { transform: translateY(1px); box-shadow: 0 8px 20px rgba(27,39,75,0.09); }
.project-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-name { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.project-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.status { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.done { background: #e8f8ef; color: var(--success); }
.status.todo { background: #fff7e6; color: var(--warning); }

.project-meta { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; color: var(--subtext); font-size: 13px; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item::before { content: ""; width: 14px; height: 14px; background-size: 14px; background-repeat: no-repeat; background-position: center; opacity: .9; }
/* 让时间段一行显示并占满一行 */
.meta-item.date { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-item.date::before { background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' stroke='%235a6473' stroke-width='1.6'/%3E%3Cpath d='M3 9h18' stroke='%235a6473' stroke-width='1.6'/%3E%3Cpath d='M8 3v4M16 3v4' stroke='%235a6473' stroke-width='1.6'/%3E%3C/svg%3E"); }
.meta-item.amount::before { background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4l6 8 6-8' stroke='%235a6473' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 12v8' stroke='%235a6473' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M7 15h10M7 18h10' stroke='%235a6473' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.meta-item.id::before { background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='4' width='16' height='16' rx='2' stroke='%235a6473' stroke-width='1.6'/%3E%3Cpath d='M8 8h8v8H8z' stroke='%235a6473' stroke-width='1.2'/%3E%3C/svg%3E"); }
.meta-item.place::before { background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21s7-6.2 7-11a7 7 0 10-14 0c0 4.8 7 11 7 11z' stroke='%235a6473' stroke-width='1.6'/%3E%3Ccircle cx='12' cy='10' r='2.5' stroke='%235a6473' stroke-width='1.6'/%3E%3C/svg%3E"); }


.project-divider { height: 1px; background: #f0f2f6; margin: 10px 0; }
.card-actions { display: flex; gap: 10px; }
.card-actions .btn { flex: 1 1 0; }

/* 顶部操作区 */
.topbar-actions { display: flex; gap: 10px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); padding: 12px 16px; background: rgba(0,0,0,0.8); color: #fff; font-size: 14px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.toast.show { opacity: 1; }

/* 安全区内边距 */
.safe-area { padding-top: env(safe-area-inset-top); padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }

/* 小屏优化 */
@media (max-width: 380px) { .project-meta { grid-template-columns: 1fr; } }

/* 空状态样式（强化卡片化 + 动画） */
.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--subtext);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(27,39,75,0.06);
  box-shadow: var(--shadow);
  animation: fadeUp .25s ease;
}
.empty-illustration {
  width: 120px; height: 120px; margin: 4px auto 12px; border-radius: 24px;
  position: relative;
  background:
    /* 外层柔光环与淡彩气泡 */
    radial-gradient(60px 60px at 80% 20%, rgba(106,166,255,0.45), rgba(106,166,255,0) 60%),
    radial-gradient(56px 56px at 25% 78%, rgba(34,197,94,0.35), rgba(34,197,94,0) 60%),
    /* 同心淡色环（装饰） */
    repeating-radial-gradient(circle at 50% 50%, rgba(43,110,242,0.10) 0 2px, rgba(43,110,242,0.0) 2px 8px),
    /* 细网格纹理 */
    linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.55)),
    repeating-linear-gradient(0deg, rgba(27,39,75,0.06) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(27,39,75,0.06) 0 1px, transparent 1px 6px),
    /* 背景基底 */
    linear-gradient(180deg, #f5f8ff 0%, #eef2ff 100%);
  border: 1px solid rgba(27,39,75,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 10px 24px rgba(27,39,75,0.08);
}
.empty-illustration::after {
  content: "";
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%;
  background:
    radial-gradient(18px 18px at 65% 30%, rgba(106,166,255,0.35), rgba(106,166,255,0) 60%),
    radial-gradient(18px 18px at 30% 70%, rgba(34,197,94,0.28), rgba(34,197,94,0) 60%),
    linear-gradient(180deg, #f9fbff 0%, #eef2ff 100%);
  border: 1px solid rgba(27,39,75,0.08);
  box-shadow: 0 6px 16px rgba(27,39,75,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
  display: block;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 3c4.97 0 9 3.582 9 8 0 3.386-2.27 6.28-5.5 7.5L13 22l-.5-3.2C7.27 17.28 5 14.386 5 11c0-4.418 4.03-8 7-8z' stroke='%232b6ef2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9.8' cy='10.4' r='0.9' fill='%232b6ef2'/%3E%3Ccircle cx='14.2' cy='10.4' r='0.9' fill='%232b6ef2'/%3E%3Cpath d='M9 13.2c.9.8 2.1 1.2 3 1.2s2.1-.4 3-1.2' stroke='%232b6ef2' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 28px 28px;
}
.empty-title { font-size: 16px; font-weight: 800; color: #1f2329; margin-top: 2px; letter-spacing: .2px; }
.empty-subtitle { margin-top: 6px; font-size: 13px; color: var(--subtext); }

.empty-chips { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.empty-chip { padding: 6px 10px; border-radius: 999px; background: #f3f6ff; color: var(--primary); border: 1px solid rgba(43,110,242,0.18); font-size: 12px; font-weight: 700; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } } 