/* ===== 全局基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2f6df6;
  --primary-dark: #1f55d6;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-sub: #8a8f99;
  --line: #ecedf0;
  --ok: #18a058;
  --warn: #f0a020;
  --radius: 12px;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e6e8eb;
  color: var(--text);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== 手机容器 ===== */
.phone {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

/* ===== 顶部标题栏 ===== */
.topbar {
  height: 48px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 16px; font-weight: 600; }

/* ===== 内容区 ===== */
.views {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 64px; /* 给底部 tab 留位 */
}
.view { padding: 16px; }
.placeholder {
  color: var(--text-sub);
  text-align: center;
  padding: 60px 0;
  font-size: 14px;
}

/* ===== 底部 tab ===== */
.tabbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  height: 60px;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
}
.tab {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-sub);
  font-size: 11px;
}
.tab-icon { font-size: 20px; filter: grayscale(1); opacity: 0.5; }
.tab.is-active { color: var(--primary); }
.tab.is-active .tab-icon { filter: none; opacity: 1; }

/* ===== 区块标题 ===== */
.section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 4px 10px;
  color: var(--text);
}
.empty { color: var(--text-sub); font-size: 13px; text-align: center; padding: 24px 0; }

/* ===== 个人介绍 ===== */
.profile {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 18px;
}
.profile-name { font-size: 22px; font-weight: 700; }
.profile-title { font-size: 13px; opacity: 0.9; margin-top: 2px; }
.profile-slogan { font-size: 14px; margin-top: 12px; line-height: 1.5; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: 11px; background: rgba(255, 255, 255, 0.22);
  padding: 3px 9px; border-radius: 20px;
}
.profile-contact { font-size: 12px; margin-top: 12px; opacity: 0.9; }

/* ===== 服务卡片 ===== */
.service-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
}
.service-icon { font-size: 26px; flex-shrink: 0; }
.service-main { flex: 1; min-width: 0; }
.service-name { font-size: 15px; font-weight: 600; }
.service-desc { font-size: 12px; color: var(--text-sub); margin-top: 3px; line-height: 1.4; }
.service-side { text-align: right; flex-shrink: 0; }
.service-price { font-size: 13px; color: var(--warn); font-weight: 600; margin-bottom: 6px; }
.btn-order {
  background: var(--primary); color: #fff; border: none;
  padding: 6px 14px; border-radius: 18px; font-size: 13px; cursor: pointer;
}
.btn-order:active { background: var(--primary-dark); }

/* ===== 作品集网格 ===== */
.portfolio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portfolio-card {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--text); display: block;
}
.portfolio-thumb {
  width: 100%; aspect-ratio: 4 / 3;
  background-size: cover; background-position: center; background-color: var(--line);
}
.portfolio-info { padding: 8px 10px; }
.portfolio-title { font-size: 13px; font-weight: 600; }
.portfolio-desc {
  font-size: 11px; color: var(--text-sub); margin-top: 3px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
/* hidden 属性默认 display:none 会被上面的 display:flex 覆盖,需显式声明 */
.modal-mask[hidden] { display: none; }
.modal {
  width: 100%; max-width: 420px; background: var(--card);
  border-radius: 16px 16px 0 0; max-height: 85vh; overflow-y: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--line); font-weight: 600;
  position: sticky; top: 0; background: var(--card);
}
.modal-close { border: none; background: none; font-size: 16px; color: var(--text-sub); cursor: pointer; }
.modal-body { padding: 16px; }

/* ===== 表单 ===== */
.field { display: block; margin-bottom: 14px; }
.field-label { font-size: 13px; color: var(--text); display: block; margin-bottom: 6px; }
.field-label i { color: #e54d42; font-style: normal; margin-left: 2px; }
.field-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fafbfc;
}
.field-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.btn-primary {
  width: 100%; background: var(--primary); color: #fff; border: none;
  padding: 12px; border-radius: 8px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.btn-primary:active { background: var(--primary-dark); }

/* ===== 订单卡片 ===== */
.order-card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.order-top { display: flex; justify-content: space-between; align-items: center; }
.order-service { font-size: 15px; font-weight: 600; }
.order-note { font-size: 13px; color: var(--text-sub); margin-top: 8px; line-height: 1.5; }
.order-meta { font-size: 11px; color: var(--text-sub); margin-top: 8px; }
.badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; }
.st-wait { background: #fff3e0; color: var(--warn); }
.st-doing { background: #e7f0ff; color: var(--primary); }
.st-done { background: #e6f6ed; color: var(--ok); }

/* ===== toast ===== */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.8); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 后台子 tab ===== */
.subtabs { display: flex; gap: 8px; margin-bottom: 14px; }
.subtabs[hidden] { display: none; }
.subtab {
  flex: 1; border: 1px solid var(--line); background: var(--card);
  padding: 8px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text-sub);
}
.subtab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 状态流转按钮 */
.btn-step {
  width: 100%; margin-top: 10px; background: #fff; color: var(--primary);
  border: 1px solid var(--primary); padding: 8px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
}
.btn-step:active { background: var(--primary); color: #fff; }
.order-done-tip { margin-top: 10px; font-size: 12px; color: var(--ok); }

/* ===== 作品集管理行 ===== */
.work-list { margin-top: 12px; }
.work-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius); padding: 10px; margin-bottom: 8px;
}
.work-thumb {
  width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0;
  background-size: cover; background-position: center; background-color: var(--line);
}
.work-row-main { flex: 1; min-width: 0; }
.work-row-title { font-size: 14px; font-weight: 600; }
.work-row-url {
  font-size: 11px; color: var(--text-sub); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.work-row-ops { display: flex; gap: 6px; flex-shrink: 0; }
.btn-mini {
  border: 1px solid var(--line); background: #fafbfc; color: var(--text);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-del { color: #e54d42; }

/* ===== 后台顶部条 / 登录闸 ===== */
.admin-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); padding: 10px 12px; border-radius: var(--radius);
  margin-bottom: 10px; font-size: 13px;
}
.admin-bar[hidden] { display: none; }
.admin-user { color: var(--text-sub); }

.admin-lock { padding: 20px 0; }
.lock-card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.lock-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.lock-hint { font-size: 12px; color: var(--text-sub); margin-bottom: 14px; }
.lock-foot { font-size: 12px; margin-top: 10px; min-height: 16px; }
