/* WUPENG OS V2.12.1 modern professional design system.
   Visual-only upgrade: no data model or business behavior changes. */

:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --paper: #ffffff;
  --ink: #18201c;
  --muted: #68736d;
  --line: #dde5e0;
  --line-strong: #cbd7d0;
  --accent: #1f6a4a;
  --accent-hover: #18583d;
  --accent-soft: #e9f3ed;
  --accent-softer: #f3f8f5;
  --soft: #edf4f0;
  --green: #1f6a4a;
  --danger: #a4493d;
  --warning: #9a642c;
  --shadow: 0 1px 2px rgba(24, 32, 28, .03), 0 8px 24px rgba(35, 62, 48, .04);
  --shadow-raised: 0 18px 50px rgba(20, 45, 31, .12);
  --focus: 0 0 0 3px rgba(31, 106, 74, .16);
  --font-ui: "Segoe UI Variable", "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  scrollbar-color: #bdc9c2 transparent;
  scrollbar-width: thin;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font-family: var(--font-ui);
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
  box-shadow: var(--focus);
}

::selection {
  color: #fff;
  background: rgba(31, 106, 74, .82);
}

/* Application frame */
.shell {
  width: min(100%, 1540px);
  max-width: none;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.side {
  top: 20px;
  height: calc(100dvh - 40px);
  padding: 18px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfa;
  box-shadow: none;
}

.brand {
  padding: 8px 10px 21px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.brand b {
  color: #153f2d;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.04em;
}

.brand small {
  margin-top: 4px;
  color: #7a8780;
  font-size: 11px;
  letter-spacing: .01em;
}

.nav {
  gap: 3px;
}

.nav button {
  position: relative;
  gap: 11px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #56625b;
  font-size: 13px;
  font-weight: 600;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, transform .1s ease;
}

.nav button:hover {
  color: #244f3b;
  background: #eef4f0;
}

.nav button.active,
.nav button.active:hover {
  border-color: #d7e7dd;
  color: #174c34;
  background: #e7f2eb;
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 10px;
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
}

.nav-icon {
  width: 27px !important;
  height: 27px;
  flex: 0 0 27px;
  border: 1px solid #dce5df;
  border-radius: 8px;
  color: #657169;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.nav button:hover .nav-icon,
.nav button.active .nav-icon {
  border-color: #c7decf;
  color: #1d6547;
  background: #f8fcf9;
}

.side-foot {
  padding: 12px 8px 4px;
  border-top-color: var(--line);
}

.side-system {
  min-height: 36px;
  border-radius: 8px;
  color: #66736c;
  transition: color .14s ease, background-color .14s ease;
}

.side-system:hover {
  color: #1f5d42;
  background: #edf4f0;
}

.status-dot {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--accent);
}

main {
  padding: 0 2px 28px;
}

.top {
  min-height: 72px;
  padding: 7px 2px 17px;
  border-bottom: 1px solid transparent;
}

.top h1 {
  color: #17241d;
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 720;
  letter-spacing: -.04em;
  line-height: 1.25;
}

.top p {
  margin-top: 4px;
  color: #7a857f;
  font-size: 12px;
}

.top-actions {
  gap: 7px;
}

.top-search,
.top-action,
.logout-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4d5a53;
  background: #fff;
  box-shadow: 0 1px 1px rgba(24, 32, 28, .02);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.top-search {
  width: min(288px, 26vw);
  color: #7a857f;
}

.top-search:hover,
.top-action:hover,
.logout-btn:hover {
  border-color: var(--line-strong);
  color: #234c39;
  background: #fbfcfb;
}

.top-action.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(18, 69, 45, .2);
}

.top-action.primary:hover {
  border-color: var(--accent-hover);
  color: #fff;
  background: var(--accent-hover);
}

.account {
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.account-name b {
  color: #34433b;
  font-size: 11px;
}

.account-name small,
.date {
  color: #87918c;
  font-size: 10px;
}

/* Core surfaces and hierarchy */
.panel,
.v212-cycle,
.v211-card,
.v211-preview-card,
.v211-advanced,
.v29-block,
.review-card,
.knowledge-card,
.goal-card,
.system {
  border-color: var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel h3,
.section-head h3 {
  color: #1d2b24;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.section-head {
  align-items: flex-start;
  margin-bottom: 15px;
}

.section-head > div > .meta,
.section-head small,
.meta {
  color: #7a857f;
}

.grid,
.dashboard,
.assistant-grid {
  gap: 16px;
  margin-top: 16px;
}

.hero {
  min-height: 222px;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr);
  gap: 24px;
  padding: 30px 32px;
  border: 1px solid #245f45;
  border-radius: 16px;
  color: #f7fbf8;
  background: #174b35;
  box-shadow: 0 18px 42px rgba(22, 72, 50, .13);
}

.hero .tag {
  color: #b9d7c6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.hero h2 {
  max-width: 700px;
  margin: 8px 0 14px;
  font-size: clamp(29px, 3.1vw, 38px);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.22;
}

.hero p {
  color: #c8d9d0;
  font-size: 13px;
  line-height: 1.7;
}

.progress-box {
  border: 1px solid rgba(226, 240, 232, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.ring {
  background: conic-gradient(#a9d3bb 0 0%, rgba(255, 255, 255, .12) 0%);
}

.ring::after {
  color: #fff;
  background: #255b43;
}

.assistant-home {
  border-color: #dbe6df;
  background: #fff;
}

.assistant-home-row b,
.risk-item b {
  color: var(--accent);
}

.risk-item,
.note,
.draft-hint,
.v29-note {
  border-color: transparent;
  border-radius: 10px;
  color: #526058;
  background: #f4f7f5;
}

.risk-item {
  border-left: 3px solid #739983;
}

.systems {
  gap: 10px;
}

.system {
  min-height: 122px;
}

.system .num,
.v211-kicker {
  color: var(--accent);
}

.metric div,
.mini-stat,
.review-stat,
.v210-evidence-grid > div,
.v212-outcomes,
.v212-cycle-metric,
.v29-fact-group {
  border: 1px solid #e4ebe7;
  border-radius: 10px;
  background: #f7f9f8;
}

.metric b,
.mini-stat b,
.review-stat b,
.v210-week-pulse b,
.v212-cycle-metric b {
  color: #213d2f;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

/* Buttons */
.btn,
.goal-actions button,
.report-item-actions button,
.workspace-tabs button,
.review-tabs button,
.domain-tabs button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #284c3a;
  border-radius: 8px;
  color: #fff;
  background: #284c3a;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  transition: transform .1s ease, border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.btn:hover,
.goal-actions button:hover,
.report-item-actions button:hover {
  border-color: #193c2b;
  background: #193c2b;
}

.btn.accent {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(18, 69, 45, .18);
}

.btn.accent:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.btn.ghost,
.goal-actions button,
.report-item-actions button,
.workspace-tabs button,
.review-tabs button,
.domain-tabs button {
  border-color: var(--line);
  color: #4f5d55;
  background: #fff;
}

.btn.ghost:hover,
.goal-actions button:hover,
.report-item-actions button:hover,
.workspace-tabs button:hover,
.review-tabs button:hover,
.domain-tabs button:hover {
  border-color: #c3d2ca;
  color: #1e5a40;
  background: #f3f8f5;
}

.btn.danger,
#batchDelete {
  border-color: #ecd6d1;
  color: var(--danger);
  background: #fff8f6;
}

.btn.danger:hover,
#batchDelete:hover {
  border-color: #dfbcb5;
  color: #84392f;
  background: #fcefeb;
}

.btn:active,
.top-action:active,
.top-search:active,
.logout-btn:active,
.nav button:active {
  transform: translateY(1px) scale(.99);
}

.btn:disabled,
button:disabled {
  opacity: .48;
  box-shadow: none;
}

.icon-btn,
.modal-close {
  border: 1px solid transparent;
  border-radius: 7px;
  color: #78847e;
  background: transparent;
}

.icon-btn:hover,
.modal-close:hover {
  border-color: var(--line);
  color: #24553e;
  background: #f0f5f2;
}

.link-button,
.v212-cycle-metric button {
  color: var(--accent);
  font-weight: 650;
}

.workspace-tabs,
.review-tabs,
.domain-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f6f4;
}

.workspace-tabs button,
.review-tabs button,
.domain-tabs button {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
}

.workspace-tabs button.active,
.review-tabs button.active,
.domain-tabs button.active {
  border-color: var(--line);
  color: #174c34;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 32, 28, .05);
}

/* Forms */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.v211-business textarea,
.v211-collaboration textarea,
.v211-focus textarea,
.v29-fact-row textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #25332c;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(24, 32, 28, .018);
  transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 40px;
}

textarea {
  line-height: 1.65;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c9d5ce;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  background: #fff;
  box-shadow: var(--focus);
  outline: 0;
}

input::placeholder,
textarea::placeholder {
  color: #909a95;
  opacity: 1;
}

.field label,
.v211-business label {
  margin-bottom: 6px;
  color: #58655e;
  font-size: 11px;
  font-weight: 650;
}

.check,
.v211-check {
  border-color: #acbbb3;
  border-radius: 5px;
}

.task-select,
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

/* Lists, calendar and report workbench */
.item,
.assistant-task,
.focus-slot,
.v210-history-card,
.v210-weekend-grid > section,
.v212-carry-item,
.v211-flow-step,
.v211-focus,
.v29-quality-item,
.v29-compare-item,
.v29-knowledge-item {
  border-color: #e1e8e4;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.item:hover,
.assistant-task:hover,
.goal-card:hover,
.knowledge-card:hover,
.review-card:hover {
  border-color: #cbd9d1;
}

.item.selected,
.task-item.selected,
.v211-focus.selected,
.v211-flow-step.ready,
.v29-step.ready {
  border-color: #bad4c5;
  background: var(--accent-softer);
}

.focus-num,
.assistant-rank,
.v212-outcome-row span,
.v211-flow-step.ready i {
  color: #fff;
  background: var(--accent);
}

.task-tag,
.pill,
.today-chip,
.knowledge-status,
.v29-source-count,
.v211-optional,
.v210-history-tags span {
  border: 1px solid #dce7e0;
  border-radius: 999px;
  color: #3f6652;
  background: #eef5f1;
}

.bar {
  height: 6px;
  background: #e6ece8;
}

.bar > i {
  background: var(--accent);
}

.week-board,
.calendar-board {
  gap: 8px;
}

.week-col,
.calendar-day {
  border-color: var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.week-nav {
  gap: 5px;
  border-right-color: var(--line);
}

.v210-week-pulse {
  gap: 7px;
}

.v210-week-pulse > div {
  border-color: #e1e8e4;
  border-radius: 10px;
  background: #f7f9f8;
}

.v210-history-card {
  background: #f8faf9;
}

.v210-history-card.done {
  border-color: #cce0d3;
  background: #f1f8f4;
}

.v212-cycle {
  padding: 18px 20px;
}

.v212-cycle-grid,
.v212-quick-form {
  gap: 9px;
}

.v212-carry {
  border-color: #eadbc7;
  border-radius: 10px;
  background: #fffaf3;
}

.v211-mounted {
  padding: 20px;
}

.v211-quick {
  gap: 13px;
}

.v211-head h3 {
  color: #1e3027;
  font-size: 19px;
  font-weight: 720;
}

.v211-kicker {
  letter-spacing: .08em;
}

.v211-flow {
  gap: 7px;
}

.v211-flow-step {
  min-height: 60px;
  background: #f8faf9;
}

.v211-layout {
  gap: 13px;
}

.v211-card,
.v211-preview-card {
  padding: 15px;
}

.v211-focus {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  background: #f9fbfa;
}

.v211-focus textarea {
  min-height: 58px;
  color: #26362d;
  background: #fff;
}

#v211Preview,
.v29-preview,
.report-preview {
  border: 1px solid #2b5641;
  border-radius: 10px;
  color: #dce9e1;
  background: #173b2b;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.75;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.v211-advanced {
  box-shadow: none;
}

.v211-advanced summary {
  min-height: 48px;
  padding: 13px 15px;
  color: #44534b;
}

.v211-advanced summary:hover {
  background: #f7faf8;
}

.v211-pending,
.v29-quality-item.warn,
.goal-warning {
  color: #865634;
  background: #fff6ec;
}

.v29-quality-item.ok {
  color: #226143;
  background: #eef7f1;
}

/* Dialogs, feedback and authentication */
.modal {
  padding: 24px;
  background: rgba(17, 31, 24, .48);
}

.modal-card {
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-raised);
}

.modal-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  color: #1b2a22;
  font-size: 16px;
}

.modal-close {
  width: 34px;
  height: 34px;
}

.toast {
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  border: 1px solid #305c46;
  border-radius: 9px;
  color: #f4faf6;
  background: #183d2d;
  box-shadow: 0 16px 38px rgba(15, 48, 31, .2);
  font-size: 12px;
}

.auth-screen {
  background: #f3f6f4;
}

.auth-story {
  color: #f7fbf8;
  background: #174b35;
}

.auth-mark,
.auth-quote {
  color: #b8d6c5;
}

.auth-story p {
  color: #c8d9d0;
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-raised);
}

.login-card h2 {
  color: #182a21;
}

.login-submit {
  min-height: 42px;
}

.login-safe,
.login-error {
  font-size: 11px;
  line-height: 1.65;
}

.spinner {
  border-color: #d8e5dd;
  border-top-color: var(--accent);
}

/* Responsive layout */
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 216px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .side {
    top: 14px;
    height: calc(100dvh - 28px);
  }

  .top-search {
    width: 210px;
  }

  .account-name {
    display: none;
  }
}

@media (max-width: 980px) {
  .shell {
    display: block;
    padding: 12px;
  }

  .side {
    position: static;
    width: 100%;
    height: auto;
    padding: 10px;
    margin-bottom: 12px;
    overflow: visible;
  }

  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px 11px;
  }

  .brand small {
    margin: 0;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .nav button {
    justify-content: center;
    min-width: 0;
    padding: 7px 5px;
  }

  .nav button.active::before {
    display: none;
  }

  .side-foot {
    display: none;
  }

  .top {
    min-height: 64px;
  }

  .top-search {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .top-search .search-label,
  .top-search kbd,
  .top-system {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .shell {
    padding: 8px;
  }

  .side {
    border-radius: 12px;
  }

  .brand small {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(64px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav button {
    flex-direction: column;
    gap: 3px;
    min-height: 56px;
    font-size: 10px;
  }

  .nav-icon {
    width: 24px !important;
    height: 24px;
    flex-basis: 24px;
  }

  .top {
    align-items: flex-start;
    padding: 5px 2px 13px;
  }

  .top p {
    display: none;
  }

  .top-actions {
    gap: 5px;
  }

  .top-action,
  .top-search,
  .logout-btn {
    min-height: 36px;
  }

  .account {
    padding-left: 5px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 20px;
    border-radius: 14px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .progress-box {
    min-height: 128px;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 14px;
  }

  .ring {
    width: 72px;
    height: 72px;
    margin: 0;
  }

  .ring::after {
    width: 54px;
    height: 54px;
  }

  .panel,
  .v211-mounted,
  .v212-cycle {
    padding: 15px;
  }

  .section-head,
  .v212-cycle-head,
  .v212-quick-head,
  .v212-carry-head,
  .v211-card-head,
  .v211-preview-head {
    gap: 9px;
  }

  .btn {
    min-height: 36px;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar .btn {
    flex: 1 1 auto;
  }

  .v212-cycle-grid,
  .v210-week-pulse,
  .v210-evidence-grid {
    grid-template-columns: 1fr 1fr;
  }

  .v211-business,
  .v29-business-grid,
  .v29-input-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .modal {
    align-items: end;
    padding: 8px;
  }

  .modal-card {
    width: 100%;
    max-height: 88dvh;
    padding: 18px;
    border-radius: 14px 14px 8px 8px;
  }
}

@media (max-width: 480px) {
  .top h1 {
    font-size: 21px;
  }

  .top-system,
  .logout-btn {
    display: none;
  }

  .hero h2 {
    font-size: 25px;
  }

  .v212-cycle-grid,
  .v210-week-pulse,
  .v210-evidence-grid {
    grid-template-columns: 1fr;
  }
}

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