/* ============================================================
   尘豹机器人 · OKR 管理系统 —— 样式
   视觉取自品牌参考图：深炭底 + 金属金 + 斜切工业造型
   ========================================================== */
:root {
  /* —— 品牌金（取自参考图 UI 面板） —— */
  --gold: #CC9517;
  --gold-lit: #EBBA4B;      /* 亮金（logo 内耳同色） */
  --gold-deep: #9C7009;
  --gold-dim: rgba(204, 149, 23, .14);
  --gold-line: rgba(204, 149, 23, .34);

  --brand: var(--gold);
  --brand-soft: var(--gold-dim);
  --brand-deep: var(--gold-deep);

  /* —— 辅助色 —— */
  --cyan: #00E5E5;          /* 参考图中的青色指示灯 */
  --green: #35C46A;
  --green-soft: rgba(53, 196, 106, .14);
  --amber: #EBBA4B;
  --orange: #F0834A;
  --red: #E60012;           /* logo 三角红 */
  --red-soft: rgba(230, 0, 18, .15);

  /* —— 中性色 —— */
  --ink: #F1F1F3;
  --ink-2: #B0B4BB;
  --ink-3: #787D86;
  --ink-4: #4A4D54;
  --line: #26272B;
  --line-2: #1F2023;
  --bg: #0D0D0F;
  --card: #17181B;
  --soft: #202124;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .34);
  /* 工业斜切：右上 / 左下各切一刀 */
  --chamfer: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  --chamfer-r: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 380px at 50% -180px, rgba(204, 149, 23, .13), transparent 72%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--gold-lit); text-decoration: none; }

.app { max-width: 720px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: calc(70px + var(--safe-b)); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 13, 15, .9);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: inset 0 2px 0 var(--gold), inset 0 -1px 0 var(--line);
  padding: 12px 16px 12px;
}
.topbar-row { display: flex; align-items: center; gap: 10px; }
.topbar-title { flex: 1; min-width: 0; }
.tb-brand { display: flex; align-items: center; gap: 7px; min-width: 0; }
.brand-mark { width: 22px; height: 22px; object-fit: contain; flex: none; opacity: .95; }
.tb-name { font-size: 16.5px; font-weight: 750; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .2px; margin-left: 29px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.cycle-pick {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-dim); color: var(--gold-lit);
  border: 1px solid var(--gold-line);
  border-radius: 4px; padding: 5px 10px; font-size: 12.5px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.cycle-pick svg { width: 11px; height: 11px; }

.avatar {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--gold); color: #16171A;
  font-size: 13px; font-weight: 750; flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; border-radius: 6px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

.cycle-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.progress-track { flex: 1; height: 5px; border-radius: 2px; background: #2B2C31; overflow: hidden; }
.progress-track > i { display: block; height: 100%; border-radius: 2px; background: var(--gold); }
.cycle-bar span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------- 视图 ---------------- */
.view { padding: 14px 16px 24px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-3);
  margin: 22px 0 10px; letter-spacing: .6px;
}
.section-title::before {
  content: ""; width: 3px; height: 12px; background: var(--gold); flex: none;
}
.section-title:first-child { margin-top: 4px; }
.section-title .count { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px;
  border: 1px solid var(--line);
  position: relative;
}
.card.compact { padding: 12px; }

.obj-head { display: flex; gap: 12px; align-items: flex-start; }
.obj-main { flex: 1; min-width: 0; }
.obj-title { font-size: 15.5px; font-weight: 700; line-height: 1.4; margin: 0 0 6px; letter-spacing: -.1px; }
.obj-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin: 0 0 8px; }
.obj-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-3); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700;
  background: var(--soft); color: var(--ink-2); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; }
.tag.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-3); font-weight: 500; }

.ring { flex: none; }
.ring text { font-family: inherit; }

/* ---------------- KR ---------------- */
.kr-list { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.kr { padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.kr:last-child { border-bottom: none; padding-bottom: 2px; }
.kr-head { display: flex; align-items: flex-start; gap: 8px; }
.kr-title { flex: 1; font-size: 13.5px; line-height: 1.45; min-width: 0; color: var(--ink); }
.kr-val { font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kr-val b { color: var(--gold-lit); font-size: 13.5px; font-weight: 750; }
.kr-bar { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.kr-bar .progress-track { height: 6px; }
.kr-bar .pct { font-size: 11.5px; font-weight: 700; color: var(--ink-3); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.kr-note { margin-top: 7px; font-size: 12px; color: var(--ink-2); background: var(--soft); border-left: 2px solid var(--gold-line); border-radius: 0 6px 6px 0; padding: 7px 10px; line-height: 1.5; }
.kr-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kr-owner { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.btn-mini {
  margin-left: auto; padding: 5px 12px; border-radius: 4px;
  background: var(--gold-dim); color: var(--gold-lit); font-size: 12px; font-weight: 700;
  border: 1px solid var(--gold-line);
}
.btn-mini:active { background: rgba(204, 149, 23, .26); }

/* ---------------- 对齐视图 ---------------- */
.tree-node { position: relative; padding-left: 18px; }
.tree-node::before {
  content: ""; position: absolute; left: 6px; top: 0; bottom: 14px;
  width: 2px; background: linear-gradient(180deg, var(--gold-line), var(--line-2)); border-radius: 1px;
}
.tree-node:last-child::before { bottom: 50%; }
.tree-node > .card { margin-bottom: 10px; }
.tree-node .tree-node { margin-top: 0; }
.tree-level { font-size: 11.5px; font-weight: 750; letter-spacing: .4px; }
.align-line { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.align-line svg { width: 12px; height: 12px; opacity: .7; }

/* ---------------- 统计 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--gold); opacity: .85;
}
.stat .k { font-size: 11.5px; color: var(--ink-3); font-weight: 550; letter-spacing: .3px; }
.stat .v { font-size: 27px; font-weight: 800; letter-spacing: -.8px; margin-top: 3px; font-variant-numeric: tabular-nums; color: var(--gold-lit); }
.stat .v small { font-size: 13px; font-weight: 650; color: var(--ink-3); margin-left: 2px; }

.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.dist-row .label { width: 86px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex: none; }
.dist-row .label i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dist-row .progress-track { height: 8px; }
.dist-row .num { width: 28px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------------- 时间线 ---------------- */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px;
  border-radius: 2px; background: var(--gold); box-shadow: 0 0 0 3px var(--card);
}
.tl-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.tl-head b { color: var(--ink); font-weight: 650; }
.tl-body { font-size: 13px; margin-top: 4px; line-height: 1.5; }
.tl-note { font-size: 12.5px; color: var(--ink-2); background: var(--soft); border-radius: 6px; padding: 8px 10px; margin-top: 6px; line-height: 1.55; }
.tl-delta { font-size: 11.5px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

/* ---------------- 表单 / 列表行 ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #131417; color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--gold); background: #17181B; }
.textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.seg { display: flex; background: var(--soft); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button {
  flex: 1; padding: 7px 4px; border-radius: 4px; font-size: 12.5px;
  color: var(--ink-3); font-weight: 650; transition: all .15s;
}
.seg button.on { background: var(--gold); color: #16171A; box-shadow: 0 2px 8px rgba(204, 149, 23, .28); }

.list-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-size: 13.5px; font-weight: 650; }
.list-row .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.chev { color: var(--ink-4); flex: none; }
.chev svg { width: 16px; height: 16px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 13px; border-radius: 4px; background: var(--card);
  border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.chip.on { background: var(--gold); border-color: var(--gold); color: #16171A; font-weight: 750; }

.search {
  display: flex; align-items: center; gap: 8px; background: #131417;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 10px;
}
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; border: none; outline: none; background: none; }
.search input::placeholder { color: var(--ink-4); }
.search svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }

/* ---------------- 底栏 ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 720px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(15, 15, 17, .96); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; font-size: 10.5px; color: var(--ink-3); font-weight: 550;
  transition: color .15s;
}
.tabbar button.on { color: var(--gold-lit); font-weight: 750; }
.tabbar button.on::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 2px; background: var(--gold);
}
.tabbar svg { width: 22px; height: 22px; }

.fab {
  position: fixed; right: 16px; bottom: calc(78px + var(--safe-b)); z-index: 31;
  width: 54px; height: 54px; border-radius: 0;
  background: linear-gradient(145deg, var(--gold-lit), var(--gold) 45%, var(--gold-deep));
  color: #141518;
  font-size: 28px; font-weight: 400; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(204, 149, 23, .38);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}
.fab:active { transform: scale(.94); }

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .68);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
.sheet {
  width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 0;
  box-shadow: 0 -1px 0 var(--line), 0 -18px 40px rgba(0, 0, 0, .5);
  padding: 8px 16px calc(20px + var(--safe-b));
  animation: up .24s cubic-bezier(.2,.9,.3,1);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet-grab { width: 38px; height: 3px; border-radius: 0; background: var(--ink-4); margin: 6px auto 12px; }
.sheet-title { font-size: 16.5px; font-weight: 750; margin: 0 0 4px; letter-spacing: -.2px; }
.sheet-sub { font-size: 12.5px; color: var(--ink-3); margin: 0 0 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn {
  flex: 1; padding: 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14.5px;
  background: var(--soft); color: var(--ink-2);
}
.btn.primary {
  background: linear-gradient(145deg, var(--gold-lit), var(--gold) 60%);
  color: #141518; border-radius: 0;
  clip-path: var(--chamfer-r);
}
.btn.primary:active { background: var(--gold-deep); }
.btn.danger { background: var(--red-soft); color: #FF5A66; }
.btn[disabled] { opacity: .45; }

.slider-row { display: flex; align-items: center; gap: 10px; }
input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 26px; background: none;
}
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 2px; background: #2B2C31; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 3px;
  background: var(--gold-lit); border: none; margin-top: -7px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}
input[type=range]::-moz-range-track { height: 6px; border-radius: 2px; background: #2B2C31; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 3px; background: var(--gold-lit); border: none; }

/* ---------------- 空态 / 登录 / toast ---------------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.empty .t { font-size: 14px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.empty .s { font-size: 12.5px; line-height: 1.6; }

.login-hero { padding: 26px 16px 20px; text-align: center; }

/* 品牌面板：复刻参考图「两侧金色斜板 + 中央深色 + 标志」的构成 */
.hero-panel {
  position: relative; height: 186px; overflow: hidden;
  background: linear-gradient(180deg, #16171A, #101113);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6);
  margin-bottom: 20px;
}
.hero-panel .plate { position: absolute; top: -6%; height: 112%; width: 34%; display: block; }
.hero-panel .plate-l {
  left: 0;
  background: linear-gradient(150deg, var(--gold-lit) 0%, var(--gold) 42%, var(--gold-deep) 100%);
  clip-path: polygon(0 0, 88% 14%, 62% 34%, 84% 52%, 60% 70%, 88% 88%, 0 100%);
}
.hero-panel .plate-r {
  right: 0;
  background: linear-gradient(210deg, var(--gold-lit) 0%, var(--gold) 42%, var(--gold-deep) 100%);
  clip-path: polygon(100% 0, 12% 14%, 38% 34%, 16% 52%, 40% 70%, 12% 88%, 100% 100%);
}
.hero-panel::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 28%, var(--gold-line) 72%, transparent);
}
.hero-core {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 10px;
  grid-auto-flow: row; align-content: center;
}
.hero-core img { width: 62%; max-width: 260px; height: auto; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .7)); }
.hero-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 229, .9), 0 0 22px rgba(0, 229, 229, .45);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

.login-hero .logo {
  width: 66px; height: 66px; border-radius: 0; margin: 0 auto 16px;
  background: linear-gradient(145deg, var(--gold-lit), var(--gold) 45%, var(--gold-deep));
  display: grid; place-items: center; overflow: hidden;
  clip-path: var(--chamfer);
}
.login-hero .logo img { width: 66%; height: auto; }
.login-hero h1 { font-size: 21px; margin: 0 0 8px; letter-spacing: -.3px; font-weight: 750; }
.login-hero p { font-size: 13.5px; color: var(--ink-3); margin: 0 0 4px; line-height: 1.6; }
.pick-list { padding: 0 16px 24px; }
.pick-list .who {
  display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); margin-bottom: 9px; background: var(--card); width: 100%; text-align: left;
}
.pick-list .who:active { background: #202124; border-color: var(--gold-line); }
.pick-list .who .n { font-size: 14.5px; font-weight: 650; }
.pick-list .who .d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  z-index: 90; background: var(--gold); color: #141518;
  padding: 10px 18px; border-radius: 4px; font-size: 13.5px; font-weight: 700; max-width: 82vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  animation: fade .16s ease; pointer-events: none;
}

.note-box {
  background: var(--gold-dim); border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0; padding: 11px 13px;
  font-size: 12.5px; color: var(--gold-lit); line-height: 1.6; margin-bottom: 14px;
}
.note-box.warn { background: var(--red-soft); border-left-color: var(--red); color: #FF7B84; }

/* ---------------- 品牌页脚 ---------------- */
.brand-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 6px; opacity: .5; }
.brand-foot img { width: 86px; height: auto; }
.brand-foot span { font-size: 11px; color: var(--ink-3); letter-spacing: .3px; }

@media (min-width: 620px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .view { padding: 18px 20px 30px; }
  .hero-panel { height: 206px; }
}
