:root {
  --ink: #171a18;
  --ink-soft: #5f6561;
  --paper: #f5f3ed;
  --paper-deep: #ebe8df;
  --white: #fffef9;
  --line: #d6d3c9;
  --line-dark: #aaa99f;
  --signal: #ff5b35;
  --signal-dark: #d83a1a;
  --acid: #c9f06b;
  --blue: #4b61e6;
  --blue-soft: #edf0ff;
  --green: #13795b;
  --green-soft: #e4f5ec;
  --shadow: 0 18px 55px rgba(22, 25, 22, 0.12);
  --shadow-small: 0 8px 24px rgba(22, 25, 22, 0.09);
  --radius: 18px;
  --sidebar: 280px;
  --display: "Avenir Next Condensed", "DIN Condensed", "PingFang SC", sans-serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--signal) 65%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--ink);
  color: white;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background:
    linear-gradient(rgba(23,26,24,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,26,24,.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  background: #1c1f1d;
  color: #f5f3ed;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px 38px;
}

.brand-app-icon {
  width: 63px;
  height: 63px;
  flex: 0 0 63px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: .02em;
}
.brand small { display: block; color: #9ba09d; margin-top: 2px; font-size: 10px; letter-spacing: .12em; }

.sidebar-label {
  padding: 0 12px 10px;
  color: #777d79;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sidebar-label-spaced { margin-top: 28px; }

.primary-nav, .link-nav { display: grid; gap: 5px; }

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 12px 12px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  color: #b9bdbb;
  background: transparent;
  cursor: pointer;
  transition: .2s ease;
}
.nav-item:hover { color: white; background: #292d2a; }
.nav-item.active { color: white; background: #323633; box-shadow: inset 3px 0 var(--signal); }
.nav-icon { font-size: 20px; color: #8d9390; }
.nav-count { min-width: 25px; padding: 3px 8px; text-align: center; border-radius: 99px; color: var(--ink); background: var(--acid); font-size: 11px; font-weight: 800; }
.nav-submenu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 3px 4px 7px 44px; }
.nav-subitem { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid #353936; border-radius: 8px; padding: 7px 8px; color: #8f9591; background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.nav-subitem:hover { color: white; border-color: #555b57; background: #292d2a; }
.nav-subitem.active { color: white; border-color: #69706b; background: #383d39; box-shadow: inset 0 -2px var(--signal); }
.nav-subitem b { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 99px; color: #d8ddd9; background: #2b2f2c; font-size: 8px; }
.nav-subitem.active b { color: var(--ink); background: var(--acid); }

.link-item {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  border-radius: 11px;
  color: #aeb3b0;
  transition: .2s ease;
}
.link-item:hover { background: #292d2a; color: white; transform: translateX(2px); }
.link-item strong, .link-item small { display: block; }
.link-item strong { font-size: 12px; font-weight: 650; color: #e6e5df; }
.link-item small { margin-top: 2px; color: #7e8480; font-size: 10px; }
.link-logo { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #4c514e; border-radius: 8px; font-family: var(--display); font-size: 10px; font-weight: 800; }
.jira-logo { color: white; background: var(--blue); border-color: var(--blue); font-size: 14px; }
.sheet-logo { color: #bfe8d8; background: rgba(19,121,91,.25); border-color: rgba(75,188,148,.3); }
.sheet-logo.uiux { color: #ffd4c8; background: rgba(255,91,53,.17); border-color: rgba(255,91,53,.25); }

.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #353936; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sync-status { display: flex; align-items: center; gap: 9px; }
.sync-status strong, .sync-status small { display: block; }
.sync-status strong { font-size: 11px; }
.sync-status small { color: #777d79; font-size: 9px; margin-top: 2px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(201,240,107,.12); }
.sync-status.sync-error .status-dot { background: var(--signal); box-shadow: 0 0 0 4px rgba(255,91,53,.14); }
.sync-status.sync-error strong { color: #ffd6cc; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.sidebar .icon-button { color: #9da29f; border-color: #3f4441; }

.main { grid-column: 2; min-width: 0; }

.topbar {
  height: 82px;
  padding: 0 clamp(24px, 4vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(245,243,237,.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.breadcrumb { display: flex; gap: 9px; align-items: center; font-size: 12px; }
.breadcrumb span { color: var(--ink-soft); }
.breadcrumb b { color: var(--line-dark); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.quiet-button, .filter-button, .secondary-button {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: .2s ease;
}
.quiet-button:hover, .filter-button:hover, .secondary-button:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-small); }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; padding: 4px 8px 4px 4px; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.profile-button:hover { background: var(--paper-deep); }
.profile-button small, .profile-button strong { display: block; }
.profile-button small { color: var(--ink-soft); font-size: 9px; }
.profile-button strong { font-size: 12px; margin-top: 1px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: white; font-family: var(--display); font-size: 11px; letter-spacing: .04em; }
.mobile-menu { display: none; border: 0; background: none; font-size: 22px; }

.milestone-bar {
  position: sticky;
  top: 82px;
  z-index: 9;
  min-height: 70px;
  padding: 12px clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,254,249,.94);
  backdrop-filter: blur(14px);
}
.milestone-track { display: flex; align-items: center; justify-content: center; gap: 14px; }
.milestone { min-width: 132px; display: flex; align-items: center; gap: 9px; color: var(--line-dark); }
.milestone > span:last-child small, .milestone > span:last-child strong { display: block; }
.milestone > span:last-child small { margin-bottom: 2px; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.milestone > span:last-child strong { font-size: 12px; font-weight: 750; white-space: nowrap; }
.milestone-dot { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; font-family: var(--display); font-size: 10px; font-weight: 800; }
.milestone-track > i { width: clamp(22px, 4vw, 70px); height: 1px; background: var(--line); }
.milestone.completed { color: var(--green); }
.milestone.completed .milestone-dot { color: white; border-color: var(--green); background: var(--green); }
.milestone.completed .milestone-dot::before { content: "✓"; }
.milestone.completed .milestone-dot { font-size: 0; }
.milestone.completed .milestone-dot::before { font-size: 11px; }
.milestone.current { color: var(--ink); }
.milestone.current .milestone-dot { color: white; border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 4px rgba(255,91,53,.12); }
.milestone-name-form { max-width: 840px; display: grid; grid-template-columns: auto minmax(260px,1fr) auto auto; align-items: start; gap: 12px; margin: 12px auto 0; padding-top: 12px; border-top: 1px solid var(--line); }
.milestone-name-form[hidden] { display: none; }
.milestone-name-form > label { padding-top: 11px; font-size: 12px; font-weight: 750; }
.name-entry-column { min-width: 0; display: grid; gap: 7px; }
.name-input-list { display: grid; gap: 7px; }
.name-input-row { min-width: 0; min-height: 43px; display: flex; align-items: center; gap: 8px; padding: 7px 9px 7px 11px; border: 1px solid var(--line-dark); border-radius: 8px; background: var(--white); }
.name-input-row:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,26,24,.08); }
.name-input-row input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; font-weight: 600; }
.name-input-row > button { width: 25px; height: 25px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink-soft); background: var(--paper-deep); cursor: pointer; }
.name-input-row > button:hover { color: white; background: var(--signal); }
.add-name-row { justify-self: start; display: flex; align-items: center; gap: 5px; border: 0; padding: 3px 2px; color: var(--blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.add-name-row span { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 13px; }
.add-name-row:hover { color: var(--signal-dark); }
.milestone-name-form > button { display: flex; align-items: center; gap: 14px; border: 0; border-radius: 8px; padding: 12px 16px; color: white; background: var(--ink); cursor: pointer; font-size: 12px; font-weight: 750; }
.milestone-name-form > button:disabled { color: #989d99; background: var(--paper-deep); cursor: not-allowed; }
.milestone-name-form > button:not(:disabled):hover { background: var(--signal); }
.milestone-name-form > small { padding-top: 12px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }

.sub-milestone-bar { position: sticky; top: 152px; z-index: 8; display: grid; grid-template-columns: 190px minmax(0,1fr); align-items: center; gap: 18px; min-height: 66px; padding: 9px clamp(24px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(245,243,237,.96); backdrop-filter: blur(14px); box-shadow: 0 5px 14px rgba(23,26,24,.05); }
.sub-milestone-bar[hidden] { display: none; }
.sub-ticket-info { min-width: 0; padding-right: 16px; border-right: 1px solid var(--line); }
.sub-ticket-info small, .sub-ticket-info strong, .sub-ticket-info span { display: block; }
.sub-ticket-info small { color: var(--ink-soft); font-size: 8px; }
.sub-ticket-info strong { margin-top: 2px; font-size: 11px; }
.sub-ticket-info span { margin-top: 2px; overflow: hidden; color: var(--ink-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.field-milestones { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 5px 2px; scrollbar-width: none; }
.field-milestones::-webkit-scrollbar { display: none; }
.field-milestone { flex: 0 0 auto; min-width: 74px; display: flex; align-items: center; gap: 6px; border: 0; padding: 4px 5px; color: var(--line-dark); background: transparent; cursor: pointer; text-align: left; }
.field-milestone i { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-style: normal; font-size: 8px; font-weight: 750; }
.field-milestone span { font-size: 8px; font-weight: 650; white-space: nowrap; }
.field-milestone.completed { color: var(--green); }
.field-milestone.completed i { color: white; border-color: var(--green); background: var(--green); }
.field-milestone.current { color: var(--signal-dark); }
.field-milestone.current i { color: white; border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 3px rgba(255,91,53,.12); }

.workspace { max-width: 1440px; margin: 0 auto; padding: clamp(40px, 6vw, 78px) clamp(24px, 4vw, 64px) 88px; }
.name-required { min-height: 430px; display: grid; place-content: center; justify-items: center; text-align: center; }
.name-required > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--signal); font-family: var(--display); font-size: 12px; font-weight: 800; }
.name-required h1 { margin: 16px 0 7px; font-family: var(--display); font-size: 30px; }
.name-required p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.app-shell[data-ready="false"] #ticketsView .hero-row,
.app-shell[data-ready="false"] #ticketsView .toolbar,
.app-shell[data-ready="false"] #ticketsView .ticket-list,
.app-shell[data-ready="false"] #ticketsView .empty-state { display: none; }
.app-shell[data-ready="true"] .name-required { display: none; }

.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; margin-bottom: 52px; }
.eyebrow { display: block; font-size: 10px; letter-spacing: .18em; font-weight: 800; color: var(--signal-dark); }
.hero-copy h1, .guide-header h1 { margin: 12px 0 12px; font-family: var(--display); font-size: clamp(40px, 4.4vw, 58px); line-height: 1; letter-spacing: -.035em; font-weight: 650; }
.hero-copy p, .guide-header p { max-width: 660px; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }

.hero-stats { display: flex; align-items: stretch; border: 1px solid var(--line-dark); background: var(--white); box-shadow: 8px 8px 0 var(--paper-deep); }
.stat-block { min-width: 96px; padding: 17px 20px 14px; border-left: 1px solid var(--line); }
.stat-block:first-child { border-left: 0; }
.stat-block strong { display: block; font-family: var(--display); font-size: 33px; line-height: 1; }
.stat-block span { display: block; margin-top: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.stat-block.accent { color: white; background: var(--signal); }
.stat-block.accent span { color: rgba(255,255,255,.78); }

.toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.segmented { display: flex; gap: 5px; }
.segment { border: 0; border-radius: 99px; padding: 10px 15px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; }
.segment span { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 5px; padding: 0 6px; border-radius: 50%; background: var(--paper-deep); font-size: 9px; }
.segment.active { color: white; background: var(--ink); }
.segment.active span { color: var(--ink); background: var(--acid); }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.search-box { min-width: 230px; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }

.ticket-list { display: grid; gap: 16px; padding-top: 20px; }
.ticket-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 3px 0 rgba(23,26,24,.04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: ticket-in .55s both cubic-bezier(.2,.8,.2,1);
  scroll-margin-top: 240px;
}
.ticket-card:nth-child(2) { animation-delay: .06s; }
.ticket-card:nth-child(3) { animation-delay: .12s; }
.ticket-card:nth-child(4) { animation-delay: .18s; }
.ticket-card:hover { transform: translateY(-3px); border-color: var(--line-dark); box-shadow: var(--shadow-small); }
.ticket-card.building { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(23,26,24,.07), var(--shadow-small); }
.ticket-card.building:hover { transform: none; }
@keyframes ticket-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.ticket-head { display: grid; grid-template-columns: 126px minmax(0,1fr) 210px; min-height: 168px; border-bottom: 1px solid var(--line); }
.ticket-code { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 23px 20px; color: white; background: var(--ink); }
.ticket-card[data-type="uiux"] .ticket-code { background: var(--blue); }
.ticket-code small { color: rgba(255,255,255,.58); font-size: 8px; font-weight: 700; letter-spacing: .09em; }
.ticket-code strong { margin-top: 5px; color: rgba(255,255,255,.82); font-family: var(--display); font-size: 14px; font-weight: 650; letter-spacing: .025em; }
.ticket-code span { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; font-size: 9px; }

.ticket-summary { padding: 23px 28px; }
.ticket-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 17px; }
.tag { padding: 5px 8px; border-radius: 4px; background: var(--paper-deep); color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.tag.epic { color: var(--signal-dark); background: #fff0e9; }
.tag.task { color: var(--green); background: var(--green-soft); }
.tag.source { color: var(--blue); background: var(--blue-soft); }
.ticket-summary h2 { margin: 0 0 9px; font-family: var(--body); font-size: 25px; font-weight: 600; line-height: 1.22; letter-spacing: -.015em; }
.ticket-summary p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.ticket-meta { display: flex; gap: 18px; margin-top: 18px; }
.ticket-meta span { color: var(--ink-soft); font-size: 10px; }
.ticket-meta strong { display: block; margin-top: 4px; color: var(--ink); font-size: 12px; font-weight: 600; }

.ticket-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 10px 12px; padding: 22px 28px 28px; }
.ticket-fields.building-fields { display: block; }
.ticket-fields.building-fields .fields-header { margin-bottom: 12px; }
.fields-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.fields-header > span { font-size: 12px; font-weight: 750; }
.fields-header > span strong { margin-left: 4px; color: var(--signal-dark); }
.fields-header > b { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }
.fields-header > b i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.fields-jira-link { color: var(--blue); font-size: 10px; font-weight: 750; white-space: nowrap; }
.field-step-actions { display: flex; align-items: center; gap: 7px; }
.field-guide-button, .field-prev-button, .field-next-button { border-radius: 7px; padding: 7px 10px; cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.field-guide-button { border: 1px solid #9ab9d8; color: var(--blue); background: var(--blue-soft); }
.field-guide-button:hover { border-color: var(--blue); background: #e6f2ff; }
.field-prev-button { border: 1px solid var(--line); color: var(--ink-soft); background: var(--white); }
.field-prev-button:disabled { opacity: .4; cursor: not-allowed; }
.field-next-button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ink); color: white; background: var(--ink); }
.field-next-button:hover { border-color: var(--signal); background: var(--signal); }
.field-pill { position: relative; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f4; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease; }
.field-pill.wide { grid-column: 1 / -1; align-items: flex-start; }
.field-pill > span { min-width: 0; }
.field-pill small, .field-pill strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-pill.wide strong { overflow: visible; white-space: normal; line-height: 1.5; }
.field-pill small { color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: .055em; text-transform: uppercase; }
.field-pill strong { margin-top: 5px; font-size: 13px; font-weight: 600; }
.manual-field { flex: 0 0 auto; border: 0; padding: 4px 7px; border-radius: 5px; color: #7b5a15; background: #fff1bd; font-size: 9px; font-weight: 800; white-space: nowrap; }
.manual-field:not(:disabled) { cursor: pointer; }
.manual-field:disabled { opacity: 1; }
.copy-mini { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; cursor: pointer; }
.copy-mini:hover { color: var(--ink); background: var(--paper-deep); }
.field-pill.current-field { border-color: var(--signal); background: #fff7f1; box-shadow: 0 0 0 3px rgba(255,91,53,.13); }
.field-pill.current-field::before { content: "当前"; position: absolute; top: -8px; left: 10px; padding: 1px 6px; border-radius: 99px; color: white; background: var(--signal); font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.field-pill.current-field .copy-mini { width: 31px; height: 31px; color: white; background: var(--signal); }
.field-pill.current-field .copy-mini:hover { background: var(--signal-dark); }
.field-pill.current-field .manual-field { color: white; background: var(--signal); }
.field-pill.completed-field { border-color: #a9d5c6; background: var(--green-soft); opacity: 1; }
.field-pill.completed-field::after { content: "✓"; position: absolute; top: 5px; right: 38px; color: var(--green); font-size: 10px; font-weight: 900; }
.field-pill.completed-field .copy-mini { color: var(--green); background: rgba(20,128,91,.08); }

.building-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: start; }
.building-field-list { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.building-field-list .field-pill { min-height: 66px; align-items: flex-start; }
.building-field-list .field-pill strong { overflow: visible; white-space: normal; line-height: 1.4; }
.inline-jira-reference { min-width: 0; position: sticky; top: 210px; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 9px; background: #f1f1ef; }
.inline-jira-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--white); }
.inline-jira-head span small, .inline-jira-head span strong { display: block; }
.inline-jira-head span small { color: var(--ink-soft); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.inline-jira-head span strong { margin-top: 3px; font-size: 13px; font-weight: 650; }
.inline-jira-head > div { display: flex; gap: 10px; }
.inline-jira-head a { color: var(--blue); font-size: 9px; font-weight: 750; white-space: nowrap; }
.inline-jira-reference > p { margin: 0; padding: 9px 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line); background: #faf9f4; font-size: 10px; line-height: 1.55; }
.inline-jira-scroll { max-height: 620px; overflow: auto; padding: 9px; }
.inline-jira-canvas { position: relative; min-width: 560px; }
.inline-jira-canvas img { width: 100%; height: auto; display: block; border: 1px solid #c9c9c4; background: white; }

.ticket-actions { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 20px 18px; border-left: 1px solid var(--line); background: #faf9f4; }
.primary-button, .start-ticket {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  padding: 12px 15px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: .2s ease;
}
.primary-button:hover, .start-ticket:hover { background: var(--signal); border-color: var(--signal); transform: translateY(-1px); box-shadow: 4px 4px 0 var(--ink); }
.start-ticket.parent-blocked { color: #715c20; border-color: #ddc98f; background: #fff1bd; }
.start-ticket.parent-blocked:hover { color: #5c4610; border-color: #c8aa54; background: #ffe796; box-shadow: none; transform: none; }
.copy-all, .template-link { display: flex; justify-content: center; align-items: center; gap: 7px; border: 0; padding: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 700; }
.copy-all:hover, .template-link:hover { color: var(--signal-dark); }
.copy-all:disabled { color: #aaa79d; cursor: not-allowed; }
.blocked-link { color: #aaa79d; cursor: default; }
.blocked-link:hover { color: #aaa79d; }

.empty-state { padding: 100px 24px; text-align: center; }
.empty-state > span { width: 58px; height: 58px; display: grid; place-items: center; margin: auto; border-radius: 50%; background: var(--acid); font-size: 22px; }
.empty-state h2 { margin: 20px 0 5px; font-family: var(--display); font-size: 28px; }
.empty-state p { color: var(--ink-soft); font-size: 13px; }

.guide-view { max-width: 1200px; }
.guide-header { max-width: 760px; margin-bottom: 54px; }
.guide-grid { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.guide-grid article { position: relative; min-height: 260px; padding: 28px 22px; border-left: 1px solid var(--line-dark); }
.guide-grid article:first-child { border-left: 0; }
.guide-grid b { font-family: var(--display); font-size: 42px; color: var(--line-dark); }
.guide-grid h2 { margin: 48px 0 10px; font-family: var(--display); font-size: 23px; }
.guide-grid p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.rule-board { margin-top: 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 30px; color: white; background: var(--ink); }
.rule-board div span, .rule-board div strong { display: block; }
.rule-board div span { color: #969c98; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.rule-board div strong { margin-top: 6px; font-family: var(--display); font-size: 21px; }
.rule-board i { color: var(--acid); font-size: 24px; }

.jira-operation-guide { margin-top: 64px; }
.operation-guide-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.operation-guide-head h2 { margin: 8px 0 0; font-family: var(--display); font-size: 31px; }
.operation-guide-head > a { color: var(--blue); font-size: 11px; font-weight: 750; }
.operation-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.operation-lane { min-width: 0; border: 1px solid var(--line); background: var(--white); }
.lane-title { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.lane-title > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ink); font-size: 9px; font-weight: 800; }
.operation-lane:last-child .lane-title > span { background: var(--blue); }
.lane-title strong, .lane-title small { display: block; }
.lane-title strong { font-size: 15px; }
.lane-title small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.operation-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.operation-steps button { min-width: 0; border: 0; padding: 0; overflow: hidden; background: var(--white); cursor: pointer; text-align: left; }
.operation-steps button:hover img { transform: scale(1.025); }
.operation-steps img { width: 100%; aspect-ratio: 16 / 8.7; display: block; object-fit: cover; object-position: top center; transition: transform .2s ease; }
.operation-steps button > span { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 9px 11px; }
.operation-steps b { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--signal); font-size: 8px; }
.operation-steps strong { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.modal-open { overflow: hidden; }
.jira-guide-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(17,22,25,.64); backdrop-filter: blur(3px); }
.jira-guide-modal { position: fixed; z-index: 61; top: 50%; left: 50%; width: min(1180px, calc(100% - 48px)); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid var(--line-dark); background: var(--white); box-shadow: 0 24px 80px rgba(10,15,18,.32); transform: translate(-50%,-50%); }
.jira-guide-modal[hidden], .jira-guide-backdrop[hidden] { display: none; }
.jira-guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 24px 15px; border-bottom: 1px solid var(--line); }
.jira-guide-head h2 { margin: 6px 0 0; font-family: var(--display); font-size: 27px; }
.jira-guide-copy { display: flex; align-items: flex-start; gap: 14px; padding: 11px 24px; background: #f7f6f1; }
.jira-guide-copy > span { flex: 0 0 auto; padding: 4px 8px; border-radius: 5px; color: var(--signal-dark); background: #fff0e9; font-size: 9px; font-weight: 800; }
.jira-guide-copy p { margin: 1px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.65; }
.jira-guide-visual { min-height: 0; overflow: auto; padding: 14px 18px; background: #e9e9e6; }
.jira-guide-canvas { position: relative; min-width: 760px; }
.jira-guide-visual img { width: 100%; height: auto; display: block; border: 1px solid #c9c9c4; background: white; }
.jira-guide-hotspots { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.jira-hotspot { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border: 3px solid #e12d26; background: rgba(225,45,38,.1); box-shadow: 0 0 0 3px rgba(225,45,38,.2), 0 6px 18px rgba(75,12,9,.14); }
.jira-hotspot-label { position: absolute; left: -3px; bottom: calc(100% + 6px); padding: 5px 9px; border-radius: 4px; color: #fff; background: #c91e18; box-shadow: 0 2px 8px rgba(75,12,9,.25); font-size: 10px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.jira-guide-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 12px 20px; border-top: 1px solid var(--line); }
.jira-guide-actions > a:first-child { color: var(--blue); font-size: 10px; font-weight: 750; }
.jira-guide-actions .primary-button { min-width: 170px; padding-block: 9px; }

.drawer-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(18,20,18,.42); backdrop-filter: blur(2px); }
.settings-drawer {
  position: fixed;
  z-index: 50;
  inset: 0 0 0 auto;
  width: min(510px, 100%);
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--white);
  box-shadow: -20px 0 50px rgba(23,26,24,.18);
  transform: translateX(105%);
  transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
.settings-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.drawer-head h2 { margin: 7px 0 0; font-family: var(--display); font-size: 29px; }
.copy-value { position: relative; padding: 22px 48px 22px 20px; border: 1px solid var(--line-dark); background: #f7f5ef; font-size: 15px; font-weight: 650; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.copy-value::after { content: "READY"; position: absolute; top: -8px; right: 12px; padding: 2px 7px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.copy-value.manual { border-color: #ddc98f; background: #fff8df; }
.copy-value.manual::after { content: "手动选择"; color: #7b5a15; background: #fff1bd; }
.field-tip { margin-top: 14px; display: flex; gap: 9px; align-items: flex-start; padding: 12px; color: #7b5a15; background: #fff6d8; font-size: 10px; line-height: 1.5; }

.settings-intro { margin: 25px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.settings-form { display: grid; gap: 16px; overflow: auto; padding: 3px; }
.settings-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.settings-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f4; color: var(--ink); font-size: 11px; }
.settings-form .primary-button { margin-top: 8px; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; padding: 12px 18px; color: white; background: var(--ink); border-left: 4px solid var(--acid); box-shadow: var(--shadow); transform: translate(-50%,120px); opacity: 0; transition: .28s ease; font-size: 11px; font-weight: 650; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

.access-gate {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ecebe6;
  transition: opacity .2s ease, visibility .2s ease;
}
.access-gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.access-card { width: min(440px, 100%); padding: 34px; border: 1px solid var(--line-dark); background: var(--white); box-shadow: var(--shadow); }
.access-brand-icon {
  display: block;
  width: 84px;
  height: 84px;
  margin-bottom: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(20, 24, 22, .24)) drop-shadow(0 6px 11px rgba(20, 24, 22, .30));
}
.access-card > small { color: var(--signal-dark); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.access-card h1 { margin: 10px 0 8px; font: 700 34px/1.1 var(--display); }
.access-card > p { margin: 0 0 24px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.access-card form { display: grid; gap: 10px; }
.access-card label { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.access-card input { width: 100%; padding: 14px; border: 1px solid var(--line-dark); background: #fff; }
.access-card form button { padding: 14px 16px; border: 0; color: #fff; background: var(--ink); font-weight: 750; cursor: pointer; }
.access-card form button:disabled { opacity: .55; cursor: wait; }
.access-error { min-height: 20px; margin: 14px 0 0 !important; color: var(--signal-dark) !important; font-size: 11px !important; }
.queue-state { margin-top: 20px; padding: 18px; border-left: 4px solid var(--acid); background: #f1f7df; }
.queue-state strong { font: 700 21px/1.2 var(--display); }
.queue-state p { margin: 8px 0; color: var(--ink); font-size: 12px; }
.queue-state small { color: var(--ink-soft); }
.session-locked { filter: blur(4px); pointer-events: none; user-select: none; }

.online-status { margin-left: auto; color: #b8bdb9; font-size: 9px; white-space: nowrap; }
.online-status span { color: var(--acid); font-weight: 800; }

.admin-auth-form { display: grid; gap: 12px; }
.admin-auth-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.admin-auth-form input { padding: 12px; border: 1px solid var(--line); background: #faf9f4; }
.admin-auth-form small { min-height: 18px; color: var(--signal-dark); }
.admin-panel { min-height: 0; overflow: auto; padding: 2px; }
.admin-status-card { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; border: 1px solid var(--line); }
.admin-status-card > div { min-width: 0; padding: 12px; border-left: 1px solid var(--line); }
.admin-status-card > div:first-child { border-left: 0; }
.admin-status-card small { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 8px; }
.admin-status-card strong { display: block; font-size: 10px; word-break: break-word; }
.admin-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.admin-action-row button { padding: 11px; border: 1px solid var(--ink); background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.admin-action-row button:first-child { color: white; background: var(--ink); }
.lark-qr-panel { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); background: #faf9f4; }
.lark-qr-panel img { width: 132px; height: 132px; background: white; }
.lark-qr-panel strong { display: block; margin-bottom: 8px; font-size: 12px; }
.lark-qr-panel p { margin: 0 0 12px; color: var(--ink-soft); font-size: 10px; }
.lark-qr-panel a { color: var(--blue); font-size: 9px; font-weight: 700; }

.backfill-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 22px 24px; border-top: 1px solid var(--line); background: #f4f8e8; }
.backfill-panel small { display: block; margin-bottom: 5px; color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.backfill-panel strong { font: 700 20px/1.2 var(--display); }
.backfill-panel p { margin: 7px 0 0; color: var(--ink-soft); font-size: 10px; }
.backfill-actions { display: grid; grid-template-columns: minmax(170px, 1fr) auto; gap: 8px; align-items: center; }
.backfill-actions input { padding: 11px 12px; border: 1px solid var(--line-dark); background: white; font-weight: 700; text-transform: uppercase; }
.backfill-actions button { padding: 11px 13px; border: 0; color: white; background: var(--green); font-size: 10px; font-weight: 750; cursor: pointer; }
.backfill-actions a { grid-column: 1 / -1; justify-self: end; color: var(--blue); font-size: 9px; font-weight: 700; }
.ticket-card.backfilled { box-shadow: inset 5px 0 0 var(--green); }
.filter-button.active { color: white; border-color: var(--green); background: var(--green); }
.restore-ticket { color: var(--ink); background: var(--paper-deep); }

@media (max-width: 1180px) {
  .ticket-head { grid-template-columns: 108px minmax(0,1fr) 190px; }
  .ticket-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .guide-grid { grid-template-columns: repeat(2,1fr); }
  .guide-grid article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-dark); }
  .guide-grid article:nth-child(4) { border-top: 1px solid var(--line-dark); }
}

@media (max-width: 920px) {
  :root { --sidebar: 250px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-105%); transition: transform .28s ease; box-shadow: var(--shadow); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { grid-column: 1; }
  .mobile-menu { display: block; }
  .milestone-bar { top: 82px; }
  .milestone-track { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .milestone-track::-webkit-scrollbar { display: none; }
  .milestone { min-width: max-content; }
  .milestone-name-form { grid-template-columns: auto minmax(180px,1fr) auto; }
  .milestone-name-form > small { display: none; }
  .sub-milestone-bar { grid-template-columns: 150px minmax(0,1fr); }
  .breadcrumb { display: none; }
  .hero-row { grid-template-columns: 1fr; }
  .hero-stats { justify-self: start; }
  .ticket-head { grid-template-columns: 96px minmax(0,1fr); }
  .ticket-actions { grid-column: 1 / -1; flex-direction: row; border-top: 1px solid var(--line); border-left: 0; }
  .ticket-actions > * { flex: 1; }
  .operation-lanes { grid-template-columns: 1fr; }
  .building-workspace { grid-template-columns: 1fr; }
  .inline-jira-reference { position: static; }
}

@media (max-width: 680px) {
  .topbar { height: 68px; padding: 0 16px; }
  .milestone-bar { top: 68px; min-height: 62px; padding: 10px 16px; }
  .milestone-track { justify-content: space-between; overflow: visible; gap: 10px; }
  .milestone { min-width: 0; flex: 1; flex-direction: column; gap: 4px; text-align: center; }
  .milestone > span:last-child small { display: none; }
  .milestone > span:last-child strong { font-size: 9px; }
  .milestone-dot { width: 24px; height: 24px; }
  .milestone-track > i { display: none; }
  .milestone-name-form { grid-template-columns: 1fr auto; gap: 8px; }
  .milestone-name-form > label { grid-column: 1 / -1; }
  .milestone-name-form > button { padding-inline: 11px; }
  .milestone-name-form > button span { display: none; }
  .sub-milestone-bar { top: 130px; grid-template-columns: 1fr; gap: 5px; padding: 7px 16px; }
  .sub-ticket-info { display: flex; align-items: center; gap: 7px; padding: 0; border: 0; }
  .sub-ticket-info small { display: none; }
  .sub-ticket-info strong, .sub-ticket-info span { margin: 0; }
  .sub-ticket-info span { max-width: 210px; }
  .field-milestone { min-width: 60px; }
  .field-milestone span { font-size: 7px; }
  .quiet-button { display: none; }
  .workspace { padding: 38px 16px 68px; }
  .hero-copy h1, .guide-header h1 { font-size: 40px; }
  .hero-stats { width: 100%; }
  .stat-block { flex: 1; min-width: 0; padding: 15px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right { width: 100%; }
  .search-box { min-width: 0; width: auto; flex: 1; }
  .profile-button > span:nth-child(2),
  .profile-button > span:last-child { display: none; }
  .ticket-head { grid-template-columns: 1fr; }
  .ticket-code { flex-direction: row; align-items: center; padding: 11px 16px; }
  .ticket-code strong { font-size: 15px; }
  .ticket-code span { width: 25px; height: 25px; }
  .ticket-summary { padding: 18px; }
  .ticket-fields { grid-template-columns: 1fr; padding: 16px 18px; }
  .building-field-list { grid-template-columns: 1fr; }
  .fields-header { align-items: flex-start; flex-direction: column; }
  .field-step-actions { width: 100%; flex-wrap: wrap; }
  .field-next-button { margin-left: auto; }
  .jira-operation-guide { margin-top: 44px; }
  .operation-guide-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .operation-steps { grid-template-columns: 1fr; }
  .jira-guide-modal { width: calc(100% - 20px); max-height: calc(100vh - 20px); }
  .jira-guide-head { padding: 16px; }
  .jira-guide-copy { padding: 10px 16px; }
  .jira-guide-actions { align-items: stretch; flex-direction: column; gap: 9px; }
  .jira-guide-actions > a { text-align: center; }
  .ticket-actions { flex-direction: column; padding: 15px 18px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-grid article { min-height: 210px; border-left: 0; border-top: 1px solid var(--line-dark); }
  .guide-grid article:first-child { border-top: 0; }
  .guide-grid h2 { margin-top: 30px; }
  .rule-board { align-items: stretch; flex-direction: column; }
  .rule-board i { transform: rotate(90deg); align-self: flex-start; }
  .settings-drawer { padding: 24px 18px; }
  .admin-status-card { grid-template-columns: 1fr; }
  .admin-status-card > div { border-left: 0; border-top: 1px solid var(--line); }
  .admin-status-card > div:first-child { border-top: 0; }
  .admin-action-row { grid-template-columns: 1fr; }
  .lark-qr-panel { grid-template-columns: 1fr; }
  .backfill-panel { grid-template-columns: 1fr; }
  .backfill-actions { grid-template-columns: 1fr; }
  .backfill-actions a { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
