/* ============================================================
   奥越新能源 OhYeahSolar 管理系统样式
   ============================================================ */
:root {
  --green: #1f9d57;
  --green-dark: #177a43;
  --green-soft: #e7f6ee;
  --orange: #f59e0b;
  --orange-soft: #fef3e2;
  --blue: #2563eb;
  --red: #dc2626;
  --red-soft: #fdecec;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f6f5;
  --sidebar: #102a1e;
  --sidebar-2: #163d2b;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(16, 42, 30, .08);
  --shadow-lg: 0 20px 50px rgba(16, 42, 30, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
}
a { color: var(--green); text-decoration: none; }
img { max-width: 100%; }
h1,h2,h3,h4 { margin: 0 0 .5em; font-weight: 700; }
p { margin: .35em 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c4cfc9; border-radius: 8px; }

/* ---------- 启动加载 ---------- */
.boot-loading { min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.boot-spinner { width: 42px; height: 42px; border: 4px solid var(--green-soft);
  border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(135deg, #0f3d28, #14532d 55%, #b45309); }
.login-card { width: 410px; max-width: 100%; background: #fff; border-radius: 18px;
  padding: 38px 34px; box-shadow: var(--shadow-lg); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; }
.login-logo img { height: 74px; object-fit: contain; }
.login-logo .brand { font-weight: 800; color: var(--green-dark); letter-spacing: 1px; }
.login-card .field { margin-bottom: 16px; }
.login-card .field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login-card .field input { width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; }
.login-card .field input:focus { outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft); }
.login-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; background: #fff; color: var(--ink); transition: .15s;
  white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(90deg, var(--green), #2bb36a); color: #fff; }
.btn-orange { background: linear-gradient(90deg, var(--orange), #f97316); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f7faf8; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- 主布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 238px; flex-shrink: 0; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #cfe3d8; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 40; overflow-y: auto; transition: transform .25s; }
.sidebar .sb-logo { display: flex; align-items: center; gap: 10px; padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .sb-logo img { width: 40px; height: 40px; border-radius: 9px; background: #fff; padding: 3px; }
.sidebar .sb-logo .t { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.sb-nav { padding: 12px 10px; flex: 1; }
.sb-group { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6f9c83;
  padding: 14px 12px 6px; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #cfe3d8; cursor: pointer; font-size: 13.5px; margin-bottom: 2px; }
.sb-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-link.active { background: linear-gradient(90deg, var(--green), #2bb36a); color: #fff; font-weight: 600; }
.sb-link .ic { width: 18px; text-align: center; }
.sb-divider { height: 1px; margin: 10px 12px; background: rgba(255,255,255,.12); }
.sb-foot { padding: 12px 16px; font-size: 12px; color: #6f9c83; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; margin-left: 238px; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 30; }
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lang-switch button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.lang-switch button.active { background: var(--green); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; position: relative; }
.user-chip .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green-soft);
  color: var(--green-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-menu { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 160px; padding: 6px; display: none; }
.user-menu.open { display: block; }
.user-menu .item { padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.user-menu .item:hover { background: var(--bg); }
.content { padding: 24px; flex: 1; }

/* ---------- 卡片 / 网格 ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.card-head h3 { margin: 0; font-size: 16px; }

/* v6 负责人指定 */
.assign-info { background: var(--green-soft); border: 1px solid #d3ecdd;
  border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.assign-select { min-width: 240px; width: 100%; }
.assign-row { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 0; border-bottom: 1px dashed #dbe4df; flex-wrap: wrap; }
.assign-row:last-child { border-bottom: 0; }
.assign-name { font-weight: 600; color: var(--green-dark); }
.revenue-box { background: #f7faf8; border-radius: 10px; padding: 14px 16px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; }
.stat-card .ic { width: 52px; height: 52px; border-radius: 13px; display: flex; align-items: center;
  justify-content: center; font-size: 24px; }
.stat-card .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card .lbl { color: var(--muted); font-size: 13px; }
.ic-green { background: var(--green-soft); } .ic-orange { background: var(--orange-soft); }
.ic-blue { background: #e8f0fe; } .ic-red { background: var(--red-soft); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.form-field .req { color: var(--red); }
.form-field input, .form-field select, .form-field textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; }
.form-field textarea { resize: vertical; min-height: 78px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.form-hint { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; padding: 12px 14px; background: #f7faf8; color: var(--muted);
  font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data td { padding: 11px 14px; border-bottom: 1px solid #f0f2f1; vertical-align: middle; }
table.data tr:hover td { background: #fafdfb; }
table.data .cell-strong { font-weight: 700; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.badge-green { background: var(--green-soft); color: var(--green-dark); }
.badge-orange { background: var(--orange-soft); color: #b45309; }
.badge-blue { background: #e8f0fe; color: #1d4ed8; }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: #f1f3f2; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- 时间线 / 流程 ---------- */
.flow-steps { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 22px; }
.flow-step { flex: 1; min-width: 110px; text-align: center; position: relative; padding-top: 26px; font-size: 12.5px; color: var(--muted); }
.flow-step::before { content: ""; position: absolute; top: 8px; left: 50%; width: 16px; height: 16px;
  border-radius: 50%; background: #d7e0db; transform: translateX(-50%); z-index: 2; }
.flow-step::after { content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 2px; background: #d7e0db; }
.flow-step:first-child::after { left: 50%; } .flow-step:last-child::after { right: 50%; }
.flow-step.done { color: var(--green-dark); font-weight: 600; }
.flow-step.done::before { background: var(--green); }
.flow-step.done::after { background: var(--green); }
.flow-step.current::before { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.flow-step.current { color: #b45309; font-weight: 700; }
.flow-step.clickable { cursor: pointer; }
.flow-step.viewing::before { box-shadow: 0 0 0 4px rgba(31, 157, 87, .25); outline: 2px solid var(--green); outline-offset: 1px; }
.flow-step.viewing { color: var(--green-dark); font-weight: 700; }

.history-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; margin-bottom: 16px; background: #f0f7f3; border: 1px solid #d6e8dd;
  border-radius: 10px; flex-wrap: wrap; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px;
  height: 12px; border-radius: 50%; background: var(--green); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--green-soft); }
.tl-item .tl-time { font-size: 12px; color: var(--muted); }

/* ---------- 上传组件 ---------- */
.uploader { border: 1.5px dashed #b9c7c0; border-radius: 11px; padding: 18px; text-align: center;
  color: var(--muted); cursor: pointer; background: #fbfdfc; transition: .15s; position: relative; }
.uploader:hover { border-color: var(--green); background: var(--green-soft); }
.uploader .u-ic { font-size: 28px; }
.uploader input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.upload-thumb { position: relative; width: 104px; }
.upload-thumb .ph { width: 104px; height: 104px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: #f1f5f3;
  display: flex; align-items: center; justify-content: center; font-size: 12px; padding: 6px; word-break: break-all; }
.upload-thumb .rm { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); color: #fff; border: 0; cursor: pointer; font-size: 12px; }
.upload-thumb .fn { font-size: 11px; color: var(--muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 产品选择 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.product-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column; transition: .15s; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card .p-img { height: 150px; background: #f7faf8; display: flex; align-items: center; justify-content: center; padding: 10px; }
.product-card .p-img img { max-height: 130px; object-fit: contain; }
.product-card .p-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.product-card .p-model { font-weight: 700; font-size: 13px; }
.product-card .p-cat { font-size: 11.5px; color: var(--muted); }
.product-card .p-price { margin-top: auto; font-weight: 800; color: var(--green-dark); font-size: 15px; padding-top: 6px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 30, 22, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: 560px; max-width: 100%; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal.lg { width: 860px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { padding: 11px 20px; border-radius: 10px; color: #fff; font-size: 13.5px; box-shadow: var(--shadow);
  animation: toastIn .2s; }
.toast.success { background: var(--green); } .toast.error { background: var(--red); }
.toast.info { background: #374151; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .e-ic { font-size: 44px; opacity: .5; }

/* ---------- 过滤器条 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; }

/* ---------- 方案 PDF 区域 ---------- */
.proposal { background: #fff; padding: 34px; border-radius: 12px; max-width: 820px; margin: 0 auto; }
.proposal .pr-head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 3px solid var(--green); padding-bottom: 16px; margin-bottom: 20px; }
.proposal .pr-head img { height: 64px; object-fit: contain; }
.proposal .pr-title { font-size: 22px; font-weight: 800; color: var(--green-dark); }
.proposal .kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.proposal .kv .k { color: var(--muted); }
.proposal table { margin-top: 8px; }
.proposal .pr-sign { margin-top: 34px; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.tab.active { color: var(--green-dark); border-bottom-color: var(--green); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .mt12 { margin-top: 12px; } .mt20 { margin-top: 20px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 700; }
.text-right { text-align: right; } .nowrap { white-space: nowrap; }

/* AI 智能推荐卡片（规则引擎算数字、千问写说明） */
.ai-card { border: 1px solid #cde9da; overflow: hidden; }
.ai-card .card-head { background: linear-gradient(90deg, var(--green-soft), #f2faf5); }
.ai-card .card-body { padding: 18px 20px; }
.ai-headline { font-size: 16px; color: var(--green-dark); }
.ai-benefits { display: flex; flex-direction: column; gap: 6px; }
.ai-benefit { color: var(--ink); }
.ai-proposal .ai-headline { color: var(--green-dark); }

