/* ============================================================
   织布鸟 WEAVELY 功能原型 - 共享样式表
   版本：V1.0  日期：2026-08-18
   说明：包含品牌色板、Web 端布局、移动端模拟器外壳
   ============================================================ */

/* ---------- 全局重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #1a202c; background: #f7fafc; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------- 品牌色板 ---------- */
:root {
  --brand-primary: #FF6B35;        /* 主品牌色：织布鸟橙 */
  --brand-primary-dark: #E55A2B;
  --brand-primary-light: #FFE4D6;
  --brand-secondary: #2C5282;       /* 副品牌色：深蓝 */
  --brand-accent: #38A169;          /* 强调色：成功绿 */
  --brand-warning: #D69E2E;
  --brand-danger: #E53E3E;
  --brand-info: #3182CE;

  --gray-50: #F7FAFC;
  --gray-100: #EDF2F7;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E0;
  --gray-400: #A0AEC0;
  --gray-500: #718096;
  --gray-600: #4A5568;
  --gray-700: #2D3748;
  --gray-800: #1A202C;
  --gray-900: #171923;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ---------- 通用工具类 ---------- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-bold { font-weight: 600; }
.text-gray { color: var(--gray-500); }
.text-danger { color: var(--brand-danger); }
.text-success { color: var(--brand-accent); }
.text-warning { color: var(--brand-warning); }
.text-primary { color: var(--brand-primary); }
.bg-white { background: #fff; }
.bg-gray { background: var(--gray-50); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-2 { padding: 8px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }

/* ---------- 通用按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: var(--radius-md); font-weight: 500; transition: all .2s; white-space: nowrap; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-dark); }
.btn-secondary { background: var(--brand-secondary); color: #fff; }
.btn-success { background: var(--brand-accent); color: #fff; }
.btn-danger { background: var(--brand-danger); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 通用卡片 ---------- */
.card { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--gray-100); }
.card-title { font-size: 16px; font-weight: 600; }

/* ---------- 通用表格 ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th { background: var(--gray-50); padding: 10px 12px; text-align: left; font-weight: 600; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); font-size: 13px; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.table tr:hover { background: var(--gray-50); }

/* ---------- 通用表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); font-size: 13px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-md); font-size: 14px; transition: border-color .2s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-light); }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.tag-primary { background: var(--brand-primary-light); color: var(--brand-primary-dark); }
.tag-success { background: #C6F6D5; color: #22543D; }
.tag-warning { background: #FEEBC8; color: #7B341E; }
.tag-danger { background: #FED7D7; color: #742A2A; }
.tag-info { background: #BEE3F8; color: #2A4365; }
.tag-gray { background: var(--gray-100); color: var(--gray-600); }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-danger); color: #fff; font-size: 11px; font-weight: 600; }

/* ============================================================
   Web 端布局（OPR 运营后台 + MFR 生产商门户）
   ============================================================ */
.web-app { min-height: 100vh; background: var(--gray-50); }

/* 顶栏 */
.web-topbar { position: sticky; top: 0; z-index: 100; height: 64px; background: #fff; box-shadow: var(--shadow-sm); display: flex; align-items: center; padding: 0 24px; }
.web-logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--brand-primary); }
.web-logo-icon { width: 32px; height: 32px; background: var(--brand-primary); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.web-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.web-topbar-icon { position: relative; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.web-topbar-icon:hover { background: var(--gray-100); }
.web-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-secondary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

/* 侧栏 */
.web-sidebar { position: fixed; left: 0; top: 64px; bottom: 0; width: 240px; background: #fff; box-shadow: var(--shadow-sm); overflow-y: auto; padding: 16px 0; }
.web-sidebar-group-title { padding: 8px 24px; font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; }
.web-sidebar-item { display: flex; align-items: center; gap: 12px; padding: 10px 24px; color: var(--gray-700); font-size: 14px; cursor: pointer; transition: all .2s; border-left: 3px solid transparent; }
.web-sidebar-item:hover { background: var(--gray-50); color: var(--brand-primary); }
.web-sidebar-item.active { background: var(--brand-primary-light); color: var(--brand-primary); border-left-color: var(--brand-primary); font-weight: 500; }
.web-sidebar-icon { width: 20px; text-align: center; font-size: 16px; }

/* 主内容区 */
.web-main { margin-left: 240px; padding: 24px; min-height: calc(100vh - 64px); }
.web-breadcrumb { display: flex; align-items: center; gap: 8px; padding: 12px 0; font-size: 13px; color: var(--gray-500); }
.web-breadcrumb a:hover { color: var(--brand-primary); }
.web-page-title { font-size: 22px; font-weight: 600; margin-bottom: 16px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%); }
.login-card { width: 400px; background: #fff; border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-text { font-size: 24px; font-weight: 700; color: var(--brand-primary); margin-top: 8px; }
.login-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 24px; font-size: 13px; }

/* ============================================================
   移动端模拟器外壳（WKR/CST/LGP App）
   ============================================================ */
.phone-frame { width: 390px; height: 844px; margin: 20px auto; background: #000; border-radius: 48px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; }
.phone-screen { width: 100%; height: 100%; background: #fff; border-radius: 36px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.phone-notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 120px; height: 28px; background: #000; border-radius: 0 0 18px 18px; z-index: 100; }
.phone-status-bar { height: 44px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; background: #fff; flex-shrink: 0; }
.phone-status-bar .status-time { font-size: 14px; }
.phone-status-bar .status-icons { display: flex; align-items: center; gap: 6px; font-size: 12px; }

/* 移动端导航 */
.phone-navbar { height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--gray-100); flex-shrink: 0; }
.phone-navbar-back { font-size: 22px; color: var(--brand-primary); cursor: pointer; }
.phone-navbar-title { font-size: 16px; font-weight: 600; }
.phone-navbar-action { font-size: 18px; color: var(--brand-primary); cursor: pointer; }

/* 移动端内容区 */
.phone-content { flex: 1; overflow-y: auto; padding: 16px; background: var(--gray-50); }
.phone-content-white { background: #fff; }

/* 移动端 TabBar */
.phone-tabbar { height: 64px; background: #fff; border-top: 1px solid var(--gray-100); display: flex; flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom, 0); }
.phone-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--gray-400); cursor: pointer; font-size: 11px; }
.phone-tab.active { color: var(--brand-primary); }
.phone-tab-icon { font-size: 22px; }

/* 移动端卡片 */
.phone-card { background: #fff; border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.phone-card-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.phone-card-row:last-child { border-bottom: none; }
.phone-card-label { color: var(--gray-500); font-size: 13px; }
.phone-card-value { color: var(--gray-800); font-size: 13px; font-weight: 500; }

/* ============================================================
   首页（端切换器）
   ============================================================ */
.portal-page { min-height: 100vh; background: linear-gradient(135deg, #FF6B35 0%, #2C5282 100%); padding: 40px 20px; }
.portal-container { max-width: 1200px; margin: 0 auto; }
.portal-header { text-align: center; color: #fff; margin-bottom: 48px; }
.portal-title { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.portal-subtitle { font-size: 16px; opacity: .9; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.portal-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; text-align: center; cursor: pointer; transition: all .3s; }
.portal-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.portal-card-icon { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; }
.portal-card-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.portal-card-desc { font-size: 13px; color: var(--gray-500); }
.portal-card-tag { margin-top: 12px; }
.portal-footer { text-align: center; color: #fff; margin-top: 48px; font-size: 13px; opacity: .8; }

/* ============================================================
   V1.1 标注模式样式（Ctrl+Hover 显示组件编号 + 需求）
   ============================================================ */

/* 标注模式下所有带 data-comp-id 的组件显示虚线轮廓 */
body.wv-annotate-mode [data-comp-id] {
  outline: 1px dashed rgba(0, 64, 70, 0.45);
  outline-offset: 2px;
  cursor: crosshair;
  transition: outline-color .15s, background-color .15s;
}

/* 当前 hover 的组件高亮（实线 + 浅色背景） */
body.wv-annotate-mode [data-comp-id]:hover,
body.wv-annotate-mode .wv-annotate-active {
  outline: 2px solid var(--brand-primary, #004046);
  outline-offset: 2px;
  background-color: rgba(0, 64, 70, 0.06);
}

/* Tooltip 浮层 */
.wv-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: 360px;
  min-width: 260px;
  background: #fff;
  border-left: 4px solid var(--brand-primary, #004046);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #1f2937;
  pointer-events: none;        /* 不阻挡下层点击 */
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.wv-tooltip-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.wv-tooltip-row:last-of-type { margin-bottom: 0; }

.wv-tooltip-label {
  flex-shrink: 0;
  width: 36px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-align: right;
}

.wv-tooltip-value {
  flex: 1;
  word-break: break-all;
}

.wv-tooltip-value code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  color: var(--brand-primary, #004046);
  background: rgba(0, 64, 70, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

.wv-tooltip-page { font-weight: 600; }
.wv-tooltip-page-desc {
  margin: -2px 0 6px 44px;
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
}
.wv-tooltip-comp { color: #111827; }

.wv-tooltip-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wv-pill {
  pointer-events: auto;        /* pill 可点击 */
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-family: "Cascadia Code", Consolas, monospace;
  color: #fff;
  background: var(--brand-primary, #004046);
  border-radius: 10px;
  text-decoration: none;
  line-height: 1.4;
  transition: background-color .15s;
}
.wv-pill:hover {
  background: var(--brand-dark, #002a30);
  text-decoration: none;
  color: #fff;
}

.wv-tooltip-muted {
  color: #9ca3af;
  font-style: italic;
  font-size: 11px;
}

.wv-tooltip-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.wv-tooltip-link {
  pointer-events: auto;
  color: var(--brand-primary, #004046);
  text-decoration: none;
  font-weight: 500;
}
.wv-tooltip-link:hover { text-decoration: underline; }

.wv-tooltip-hint {
  color: #9ca3af;
  font-size: 10px;
}

