:root {
  --ink: #251d1a;
  --muted: #786c66;
  --line: rgba(70, 51, 42, 0.12);
  --paper: #f7f4ef;
  --card: rgba(255, 255, 255, 0.9);
  --cream: #efe5d7;
  --brand: #d84a32;
  --brand-dark: #9f2d1e;
  --brand-soft: #f9e3dd;
  --green: #26765a;
  --green-soft: #dff2e9;
  --shadow: 0 24px 60px rgba(74, 48, 37, 0.1);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); }
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
}
.ambient-one { width: 42vw; height: 42vw; right: -18vw; top: -21vw; background: rgba(231, 105, 70, .11); }
.ambient-two { width: 30vw; height: 30vw; left: -16vw; bottom: -18vw; background: rgba(224, 184, 121, .14); }

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .18em;
}
.muted { color: var(--muted); }
.brand-lockup { display: flex; align-items: center; gap: 12px; font-weight: 760; font-size: 19px; letter-spacing: -.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  border-radius: 14px;
  background: linear-gradient(145deg, #f06a4a, #b82e21);
  box-shadow: 0 10px 24px rgba(201, 62, 42, .25);
  font-family: "Songti SC", serif;
  font-weight: 800;
}
.brand-lockup.compact .brand-mark { width: 36px; height: 36px; border-radius: 12px; }

.login-shell {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8vh 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .62fr);
  align-items: center;
  gap: 8vw;
}
.login-copy h1 { margin: 32px 0 22px; font-size: clamp(46px, 6vw, 78px); line-height: 1.03; letter-spacing: -.065em; }
.login-lead { max-width: 600px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.feature-row span { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); font-size: 13px; }
.login-card {
  padding: 40px;
  border: 1px solid rgba(87, 60, 48, .12);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-card h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.04em; }
.login-card label, .brief-field { display: grid; gap: 8px; margin-top: 22px; font-size: 13px; font-weight: 680; }
input, textarea {
  width: 100%;
  border: 1px solid rgba(75, 54, 45, .18);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  padding: 13px 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea { resize: vertical; line-height: 1.7; }
.form-error { min-height: 20px; margin: 14px 0 0; color: var(--brand-dark); font-size: 13px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 13px;
  padding: 11px 17px;
  cursor: pointer;
  font-weight: 720;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { color: white; background: linear-gradient(135deg, #e1553a, #b93224); box-shadow: 0 9px 22px rgba(193, 54, 38, .2); }
.button.wecom { color: white; background: linear-gradient(135deg, #20b26b, #079455); box-shadow: 0 9px 22px rgba(7, 148, 85, .2); text-decoration: none; }
.button.disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button.light { color: var(--ink); background: white; }
.button.danger { color: var(--brand-dark); border: 1px solid #efc8bd; background: #fff7f5; }
.button.wide { width: 100%; margin-top: 24px; }
.text-button { border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer; }
.wecom-mark { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: #079455; background: white; font-size: 12px; font-weight: 850; }
.login-hint { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.admin-login { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-login summary { color: var(--muted); cursor: pointer; font-size: 12px; text-align: center; }
.admin-login[open] summary { color: var(--brand-dark); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(250, 248, 244, .83);
  backdrop-filter: blur(20px);
}
.sidebar nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}
.nav-item.active { color: var(--brand-dark); background: var(--brand-soft); }
.nav-icon { display: grid; width: 22px; place-items: center; font-size: 17px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 18px; }
.service-pill { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.service-pill div { display: grid; gap: 2px; }
.service-pill strong { font-size: 12px; }
.service-pill small { color: var(--muted); font-size: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b5aba5; box-shadow: 0 0 0 5px rgba(181,171,165,.13); }
.status-dot.online { background: #36a477; box-shadow: 0 0 0 5px rgba(54,164,119,.14); }

.workspace { min-width: 0; padding: 0 34px 50px; }
.topbar {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topbar h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: var(--brand-dark); background: var(--brand-soft); font-weight: 800; }
.user-copy { display: grid; min-width: 90px; }
.user-copy strong { font-size: 13px; }
.user-copy small { color: var(--muted); font-size: 11px; }
.global-banner { margin-bottom: 18px; padding: 12px 15px; color: #754b14; border: 1px solid #eed7a7; border-radius: 13px; background: #fff5dd; font-size: 13px; }

.hero-grid { display: grid; grid-template-columns: minmax(360px, 1.5fr) minmax(170px, .5fr) minmax(170px, .5fr); gap: 16px; }
.hero-card, .metric-card, .panel { border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 15px 40px rgba(67, 45, 36, .06); }
.hero-card {
  min-height: 254px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    radial-gradient(circle at 84% 16%, rgba(255,255,255,.18), transparent 27%),
    linear-gradient(140deg, #c83a28 0%, #e65c3e 54%, #b42d21 100%);
  overflow: hidden;
}
.hero-card .eyebrow { color: rgba(255,255,255,.7); }
.hero-card h3 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.12; letter-spacing: -.05em; }
.hero-card p:not(.eyebrow) { max-width: 550px; margin: 16px 0; color: rgba(255,255,255,.76); line-height: 1.65; }
.hero-card .button { align-self: flex-start; }
.metric-card { min-height: 254px; padding: 24px; display: flex; flex-direction: column; }
.metric-card p { margin: 30px 0 8px; color: var(--muted); font-size: 13px; }
.metric-card strong { font-size: 44px; letter-spacing: -.05em; }
.metric-card small { margin-top: auto; color: var(--muted); }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; font-weight: 800; }
.metric-icon.warm { color: #a54e16; background: #f7e8d8; }
.metric-icon.green { color: var(--green); background: var(--green-soft); }

.panel { padding: 25px; }
.task-panel { margin-top: 16px; min-height: 330px; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.panel-head h3, .create-panel h3, .team-panel h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.filters { display: flex; gap: 7px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.chip.active { color: var(--brand-dark); border-color: transparent; background: var(--brand-soft); }
.pending-list { display: grid; gap: 10px; margin-top: 18px; }
.pending-card { padding: 17px; border: 1px solid #eed7a7; border-radius: 16px; background: #fffaf0; }
.pending-card h4 { margin: 0 0 6px; color: #754b14; }
.pending-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.pending-card textarea { background: white; }
.pending-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.pending-tools label { color: var(--brand-dark); cursor: pointer; font-size: 12px; font-weight: 700; }
.pending-tools input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pending-file-names { color: var(--muted); font-size: 11px; }
.empty-state { min-height: 230px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state h4 { margin: 13px 0 4px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--cream); font-size: 24px; }
.task-row {
  width: 100%;
  margin-top: 11px;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, transform .18s ease;
}
.task-row:hover { border-color: rgba(216,74,50,.35); transform: translateY(-1px); }
.task-main { display: grid; gap: 5px; }
.task-main strong { font-size: 14px; }
.task-main small, .task-updated { color: var(--muted); font-size: 11px; }
.state-badge { padding: 6px 10px; border-radius: 999px; color: var(--muted); background: #f0ece7; font-size: 11px; font-weight: 700; }
.state-badge.active { color: #8e541d; background: #faead5; }
.state-badge.review { color: #7354a3; background: #eee6fa; }
.state-badge.success { color: var(--green); background: var(--green-soft); }
.state-badge.failed { color: var(--brand-dark); background: var(--brand-soft); }

.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.create-panel { min-height: 520px; }
.step-head { display: flex; align-items: center; gap: 14px; }
.step-head > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--brand-dark); background: var(--brand-soft); font-weight: 800; }
.drop-zone {
  min-height: 235px;
  margin-top: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1.5px dashed rgba(142, 84, 62, .33);
  border-radius: 19px;
  background: #fcfaf7;
  cursor: pointer;
  text-align: center;
  transition: border-color .18s ease, background .18s ease;
}
.drop-zone.dragging { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone small { color: var(--muted); }
.upload-orb { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 5px; border-radius: 15px; color: var(--brand-dark); background: var(--brand-soft); font-size: 23px; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 13px; }
.preview { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 13px; background: var(--cream); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; color: white; background: rgba(26,18,15,.68); cursor: pointer; }
.brief-field { margin-top: 29px; }
.brief-tips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; }
.brief-tips span { color: var(--muted); font-size: 12px; }
.brief-tips button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; background: white; cursor: pointer; font-size: 11px; }
.submit-card { position: sticky; top: 20px; padding: 25px; border-radius: 22px; color: white; background: #2d2420; box-shadow: var(--shadow); }
.submit-card .eyebrow { color: #f09a81; }
.submit-card h3 { margin: 0; font-size: 22px; }
.submit-card ul { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; color: #cfc5c0; font-size: 13px; }
.submit-card li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.45; }
.submit-card li span { color: #f28b6d; font-weight: 800; }
.submit-status { min-height: 36px; margin: 13px 0 0; color: #a99d96; font-size: 12px; line-height: 1.5; }
.team-panel { max-width: 900px; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 28px; }
.role-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 17px; }
.role-grid span { color: var(--brand); font-size: 12px; font-weight: 760; }
.role-grid strong { display: block; margin-top: 7px; font-size: 18px; }
.role-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.team-admin { display: grid; gap: 24px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.member-form { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fcfaf7; }
.member-form > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.member-form label { margin: 0; }
.member-form select { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.member-form .button { justify-self: start; }
.password-form { margin-top: 24px; }
.member-list { display: grid; gap: 9px; }
.member-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.member-row div { display: grid; gap: 3px; }
.member-row small { color: var(--muted); }
.member-state { padding: 5px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; }
.member-state.disabled { color: var(--brand-dark); background: var(--brand-soft); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 10; display: grid; gap: 10px; }
.toast { max-width: 360px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.error { color: var(--brand-dark); border-color: #efc8bd; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(34, 25, 21, .28);
  backdrop-filter: blur(4px);
}
.task-drawer {
  width: min(570px, 92vw);
  height: 100%;
  padding: 28px;
  overflow-y: auto;
  background: #fbf9f6;
  box-shadow: -24px 0 70px rgba(49,32,25,.16);
  animation: drawer-in .24s ease-out;
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: .6; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { margin: 0; font-size: 25px; }
.drawer-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; font-size: 22px; }
.drawer-status { margin: 22px 0; padding: 17px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.next-action-card { padding: 17px; border: 1px solid #eed7a7; border-radius: 16px; background: #fffaf0; }
.next-action-card h4 { color: #754b14; }
.next-action-card p:last-child { margin: 0; color: #5f514a; line-height: 1.6; }
.task-drawer section { margin-top: 26px; }
.task-drawer h4 { margin: 0 0 12px; font-size: 14px; }
.artifact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.artifact-card { min-height: 120px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 15px; background: white; }
.artifact-card > a { display: block; aspect-ratio: 1; overflow: hidden; background: var(--cream); }
.artifact-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.artifact-card a:hover img { transform: scale(1.015); }
.artifact-copy { padding: 12px; display: grid; gap: 5px; }
.artifact-card strong { font-size: 14px; }
.artifact-card small { color: var(--muted); }
.artifact-card .button { width: calc(100% - 24px); margin: 0 12px 12px; padding: 8px 10px; font-size: 12px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.inline-status { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.revision-panel { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.revision-panel > .muted { margin: -3px 0 13px; font-size: 12px; line-height: 1.6; }
.revision-upload { display: inline-flex; margin: 10px 0; color: var(--brand-dark); cursor: pointer; font-size: 12px; font-weight: 700; }
.revision-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.revision-file-list { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.timeline-list { list-style: none; padding: 0; margin: 0; }
.timeline-list li { position: relative; padding: 0 0 20px 22px; color: var(--muted); font-size: 12px; }
.timeline-list li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-list li::after { content: ""; position: absolute; left: 5px; top: 16px; bottom: 2px; width: 1px; background: var(--line); }
.timeline-list li:last-child::after { display: none; }
.timeline-list strong { display: block; margin-bottom: 3px; color: var(--ink); }

@media (max-width: 1080px) {
  .create-layout { grid-template-columns: 1fr 1fr; }
  .submit-card { position: static; grid-column: 1 / -1; }
  .hero-grid { grid-template-columns: 1.5fr .5fr; }
  .hero-grid .metric-card:last-child { display: none; }
}
@media (max-width: 760px) {
  .login-shell { padding: 35px 20px; grid-template-columns: 1fr; gap: 45px; }
  .login-copy h1 { font-size: 46px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; flex-direction: row; align-items: center; gap: 12px; overflow-x: auto; }
  .sidebar .brand-lockup span:last-child, .sidebar-foot, .nav-item span:last-child { display: none; }
  .sidebar nav { display: flex; margin: 0; }
  .nav-item { width: auto; }
  .workspace { padding: 0 16px 40px; }
  .topbar { min-height: 82px; }
  .topbar .button, .user-copy { display: none; }
  .hero-grid, .create-layout, .role-grid { grid-template-columns: 1fr; }
  .member-form > div { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: 1fr auto; }
  .hero-grid .metric-card { min-height: 170px; }
  .hero-grid .metric-card:last-child { display: flex; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .create-panel { min-height: auto; }
  .submit-card { grid-column: auto; }
  .task-row { grid-template-columns: 1fr auto; }
  .task-updated { display: none; }
}
