/**
 * tgskin 用户端基础样式
 * 风格：Corporate Premium（藏蓝 + 橙），参考 example 设计规范
 * 含：设计 Token / 基础组件 / 表单 / Toast / 自定义弹窗
 */

:root {
  /* 主色 */
  --navy:        #0f172a;
  --navy-2:      #1e293b;
  --navy-3:      #334155;
  /* 强调橙 */
  --brand:       #ea580c;
  --brand-dark:  #c2410c;
  --brand-soft:  #fff7ed;
  /* 背景 / 文字 */
  --bg:          #f8fafc;
  --card:        #ffffff;
  --raise:       #f1f5f9;
  --text:        #0f172a;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  /* 边框 / 阴影 */
  --border:      #e2e8f0;
  --border-2:    #cbd5e1;
  --shadow:      0 4px 6px -1px rgba(15, 23, 42, 0.07);
  --shadow-lg:   0 20px 40px -12px rgba(15, 23, 42, 0.22);
  --glow:        0 0 0 3px rgba(234, 88, 12, 0.15);
  /* 状态色 */
  --success:     #16a34a;
  --warning:     #d97706;
  --danger:      #dc2626;
  /* 尺寸 */
  --radius:      12px;
  --radius-sm:   8px;
  --ease:        0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---------------- 顶部导航 ---------------- */
.app-topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.app-brand .logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
}
.app-nav { display: flex; gap: 6px; }
.app-nav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: var(--ease);
}
.app-nav a:hover { background: var(--raise); color: var(--text); }
.app-nav a.active { background: var(--brand-soft); color: var(--brand); }

/* ---------------- 布局容器 ---------------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.page-head { text-align: center; margin-bottom: 28px; }
.page-head h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); margin: 0; font-size: 14px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card + .card { margin-top: 20px; }
.card-title { font-size: 20px; font-weight: 700; margin: 0 0 20px; letter-spacing: -0.02em; }

/* ---------------- 表单 ---------------- */
.form-item { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-label .req { color: var(--brand); margin-left: 3px; }
.form-control {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--ease);
  font-family: inherit;
}
textarea.form-control { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; }
.form-control::placeholder { color: var(--text-3); }
.form-control:focus { border-color: var(--brand); background: var(--card); box-shadow: var(--glow); }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* 单选组 */
.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  transition: var(--ease);
}
.radio-chip input { display: none; }
.radio-chip.checked { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 图片上传 */
.upload-box {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--ease);
  background: var(--bg);
}
.upload-box:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-box .up-icon { font-size: 30px; color: var(--text-3); }
.upload-box .up-text { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.upload-preview { max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); margin-top: 8px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 16px -4px rgba(234,88,12,0.4); }
.btn-ghost { background: var(--card); color: var(--text-2); border-color: var(--border-2); }
.btn-ghost:hover:not(:disabled) { background: var(--raise); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; transform: translateY(-1px); }

/* ---------------- 徽章 / 状态 ---------------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending  { background: #fef3c7; color: #b45309; }
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

/* ---------------- 查询结果列表 ---------------- */
.result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.result-item:last-child { border-bottom: none; }
.result-thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--raise); flex-shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-info .t { font-weight: 600; font-size: 15px; }
.result-info .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 14px; }

/* ---------------- Toast ---------------- */
.toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 99999; display: flex; flex-direction: column; align-items: center;
  gap: 8px; pointer-events: none;
}
.toast-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 7px;
  font-size: 13px; line-height: 1.5; color: #2A3547;
  background: #fff; border: 1px solid #ebf1f6;
  box-shadow: rgba(145,158,171,0.2) 0 0 2px 0, rgba(145,158,171,0.12) 0 12px 24px -4px;
  pointer-events: auto; animation: toastIn 0.2s ease; transition: opacity 0.2s ease;
  max-width: 420px; min-width: 160px; word-break: break-word;
}
.toast-item.toast-out { opacity: 0; }
.toast-success .toast-icon { color: #16a34a; }
.toast-error   .toast-icon { color: #ef4444; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info    .toast-icon { color: #64748b; }
.toast-loading .toast-icon { color: #2A3547; }
.toast-icon { flex-shrink: 0; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.toast-icon svg { width: 15px; height: 15px; }
.toast-loading .toast-icon svg { animation: toastSpin 0.8s linear infinite; }
.toast-close { flex-shrink: 0; width: 14px; height: 14px; margin-left: 6px; cursor: pointer; color: #7C8FAC; display: flex; align-items: center; justify-content: center; transition: color 0.12s; }
.toast-close:hover { color: #2A3547; }
.toast-close svg { width: 12px; height: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---------------- 自定义弹窗 Modal ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity 0.2s ease;
}
.modal-mask.is-open { opacity: 1; }
.modal-box {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
}
.modal-mask.is-open .modal-box { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-icon { width: 22px; height: 22px; flex-shrink: 0; }
.modal-icon svg { width: 22px; height: 22px; }
.modal-icon-danger  { color: var(--danger); }
.modal-icon-warning { color: var(--warning); }
.modal-icon-success { color: var(--success); }
.modal-icon-default { color: var(--brand); }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-content { color: var(--text-2); font-size: 14px; line-height: 1.6; margin-bottom: 22px; padding-left: 32px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .btn { height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .container { padding: 20px 14px 48px; }
  .card { padding: 20px; }
  .page-head h1 { font-size: 22px; }
}
