:root {
  color-scheme: light;
  --ink: #402b22;
  --ink-soft: #765b4e;
  --paper: #fffaf0;
  --cream: #fff5df;
  --line: #eadcc9;
  --pink: #f47fa2;
  --pink-dark: #d8567c;
  --yellow: #ffe39a;
  --green: #cfeeb5;
  --green-strong: #68b84d;
  --blue: #cceeff;
  --red: #ffd1d4;
  --red-strong: #d94b56;
  --shadow: 0 22px 60px rgba(75, 48, 30, .16);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 227, 154, .75), transparent 23rem),
    radial-gradient(circle at 92% 90%, rgba(204, 238, 255, .75), transparent 27rem),
    #f8f3e9;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card {
  width: min(520px, 100%);
  padding: 34px;
  border-radius: 32px;
  background: rgba(255, 250, 240, .96);
  border: 1px solid rgba(224, 207, 182, .8);
  box-shadow: var(--shadow);
}
.compact-card { text-align: center; width: 360px; }
.brand-row { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.brand-row h1, .auth-card h1 { margin: 0 0 6px; font-size: 27px; }
.brand-row p, .auth-card p { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.brand-mark {
  width: 72px; height: 72px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 26px 26px 30px 30px; color: white; font-weight: 900; font-size: 30px;
  background: linear-gradient(145deg, #f6a64d, #f0799c); box-shadow: inset 0 -4px 0 rgba(101, 52, 32, .12);
  transform: rotate(-3deg);
}
.brand-mark.small { width: 48px; height: 48px; border-radius: 17px; font-size: 21px; }
.muted { color: var(--ink-soft); }

.form-stack { display: grid; gap: 17px; }
.form-stack label { display: grid; gap: 8px; font-weight: 750; }
input, select {
  width: 100%; min-height: 46px; border: 1.5px solid #dac9b4; border-radius: 14px;
  padding: 10px 13px; background: white; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(244, 127, 162, .14); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-message { min-height: 20px; margin: -3px 0 0 !important; color: var(--red-strong) !important; font-weight: 700; }
.form-message.success { color: #32852f !important; }
.form-hint, .security-note { font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.security-note { margin-top: 18px !important; text-align: center; }

.primary-button, .secondary-button, .ghost-button, .icon-text-button {
  border: 0; border-radius: 14px; min-height: 42px; padding: 9px 17px; font-weight: 800;
  transition: transform .12s, filter .12s, background .12s;
}
.primary-button { color: #3d251b; background: linear-gradient(180deg, #ffdd85, #ffc65f); box-shadow: 0 4px 0 #dda443; }
.primary-button:hover { filter: brightness(1.025); transform: translateY(-1px); }
.primary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #dda443; }
.large-button { min-height: 50px; font-size: 16px; }
.secondary-button { background: #e8f7df; color: #39752c; border: 1px solid #bddda9; }
.ghost-button { background: #f3eadc; color: var(--ink); }
.icon-text-button { background: transparent; padding-inline: 11px; }
.icon-text-button:hover, .ghost-button:hover { background: #eadfce; }
button:disabled { cursor: wait; opacity: .62; transform: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px;
  background: #fff4d7; border-right: 1px solid #ead6aa;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 7px 24px; }
.sidebar-brand strong { display: block; font-size: 20px; }
.sidebar-brand span { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; }
.nav-button { border: 0; border-radius: 16px; padding: 13px 15px; background: transparent; text-align: left; font-weight: 800; }
.nav-button span { margin-right: 9px; }
.nav-button:hover { background: rgba(255,255,255,.55); }
.nav-button.active { background: white; box-shadow: 0 5px 16px rgba(80, 55, 29, .08); }
.sidebar-foot { margin-top: auto; padding: 17px 10px 4px; border-top: 1px dashed #d9bd85; }
.sidebar-foot p { color: var(--ink-soft); font-size: 12px; line-height: 1.55; margin-bottom: 0; }
.health-pill { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 13px; }
.health-pill i { width: 10px; height: 10px; background: var(--green-strong); border-radius: 50%; box-shadow: 0 0 0 4px rgba(104,184,77,.15); }
.health-pill.bad i { background: var(--red-strong); box-shadow: 0 0 0 4px rgba(217,75,86,.15); }

.workspace { min-width: 0; padding: 0 30px 40px; }
.topbar {
  min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  position: sticky; top: 0; z-index: 8; background: rgba(248, 243, 233, .91); backdrop-filter: blur(12px);
}
.eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 900; color: var(--pink-dark); margin: 0 0 4px; }
.topbar h1 { margin: 0; font-size: 28px; }
.admin-area { display: flex; align-items: center; gap: 10px; }
.admin-chip { display: flex; align-items: center; gap: 9px; background: white; border: 1px solid var(--line); padding: 6px 12px 6px 7px; border-radius: 16px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: var(--blue); border-radius: 12px; font-weight: 900; }
.admin-chip strong, .admin-chip small { display: block; }
.admin-chip small { color: var(--ink-soft); font-size: 11px; margin-top: 1px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; margin-bottom: 18px; }
.summary-card { min-height: 140px; border-radius: 25px; padding: 20px; border: 1px solid rgba(94,67,44,.08); box-shadow: 0 10px 30px rgba(77,51,31,.06); }
.summary-card.yellow { background: var(--yellow); }.summary-card.green { background: var(--green); }.summary-card.blue { background: var(--blue); }.summary-card.red { background: var(--red); }
.summary-card span, .summary-card small { display: block; font-weight: 700; }
.summary-card strong { display: block; font-size: 38px; margin: 8px 0 4px; line-height: 1; }
.summary-card small { color: var(--ink-soft); }

.content-card { background: rgba(255, 250, 240, .97); border: 1px solid var(--line); border-radius: 28px; padding: 23px; box-shadow: 0 12px 40px rgba(75,48,30,.07); }
.tall-card { min-height: calc(100vh - 135px); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head h2 { margin: 0 0 5px; font-size: 21px; }
.section-head p { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px; border-radius: 18px; background: #f6eddf; margin-bottom: 13px; }
.search-box { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 360px; background: white; border: 1px solid #e2d4c3; border-radius: 13px; padding-left: 12px; }
.search-box input { min-height: 40px; border: 0; padding-left: 0; box-shadow: none; }
.filter-tabs { display: flex; gap: 5px; }
.filter-button { border: 0; border-radius: 11px; padding: 8px 12px; background: transparent; font-size: 13px; font-weight: 800; }
.filter-button.active { background: white; color: var(--pink-dark); box-shadow: 0 2px 8px rgba(72,45,29,.08); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; min-width: 880px; }
.data-table th { padding: 3px 12px; color: var(--ink-soft); font-size: 12px; text-align: left; white-space: nowrap; }
.data-table td { padding: 13px 12px; background: white; border-top: 1px solid #eadfce; border-bottom: 1px solid #eadfce; vertical-align: middle; }
.data-table td:first-child { border-left: 1px solid #eadfce; border-radius: 15px 0 0 15px; }
.data-table td:last-child { border-right: 1px solid #eadfce; border-radius: 0 15px 15px 0; }
.data-table .right { text-align: right; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 14px; background: var(--yellow); font-weight: 900; }
.user-cell strong, .user-cell small { display: block; }.user-cell small { color: var(--ink-soft); margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.badge.role-admin, .badge.role-administrator { background: #e8e0ff; color: #6650a4; }
.badge.role-member, .badge.role-presales { background: #fff0d1; color: #9a651f; }
.badge.role-aftersales { background: #e8f4ff; color: #3377a7; }
.badge.status-active { background: #e4f5db; color: #387b2d; }.badge.status-disabled { background: #eeeae5; color: #726a62; }.badge.status-blacklisted { background: #ffe0e2; color: #ad3440; }
.online-dot, .offline-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.online-dot { background: var(--green-strong); box-shadow: 0 0 0 3px rgba(104,184,77,.13); }.offline-dot { background: #b8aea5; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.mini-button { border: 1px solid #dfd0bd; background: #fffaf3; border-radius: 10px; padding: 7px 9px; font-size: 12px; font-weight: 800; }
.mini-button:hover { border-color: #c8ad8d; background: #fff4df; }
.mini-button.danger { color: #b33945; border-color: #edc4c8; background: #fff4f5; }
.more-wrap { position: relative; display: inline-block; }
.more-menu { position: absolute; right: 0; top: calc(100% + 7px); z-index: 10; width: 170px; padding: 7px; border-radius: 14px; background: white; border: 1px solid var(--line); box-shadow: 0 14px 35px rgba(60,40,25,.16); }
.more-menu button { display: block; width: 100%; border: 0; background: transparent; border-radius: 9px; padding: 9px 10px; text-align: left; font-size: 13px; font-weight: 700; }
.more-menu button:hover { background: #f7eee1; }.more-menu button.danger { color: #b33945; }
.empty-state { padding: 55px 20px; text-align: center; color: var(--ink-soft); }
.empty-state div { font-size: 36px; }.empty-state strong { display: block; color: var(--ink); margin: 7px 0; }
.audit-table td { font-size: 13px; }.audit-detail { max-width: 430px; white-space: normal; line-height: 1.45; }

.label-note { margin: -3px 0 18px; padding: 14px 16px; border-radius: 16px; color: var(--ink-soft); background: #f7eddd; line-height: 1.6; }
.label-note strong { color: var(--ink); }
.label-table { min-width: 760px; }
.label-preview { --label-color: #f58eaa; display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; background: color-mix(in srgb, var(--label-color) 18%, white); font-weight: 850; white-space: nowrap; }
.label-preview i { width: 11px; height: 11px; border-radius: 50%; background: var(--label-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--label-color) 18%, transparent); }
.table-subtext { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.badge.label-kind-status { background: #eeeae5; color: #625950; }
.badge.label-kind-category { background: #fff0f4; color: #b34567; }
.badge.label-kind-priority { background: #fff0d1; color: #9a651f; }
.switch-line { grid-template-columns: auto 1fr !important; align-items: center; gap: 10px !important; }
.switch-line input { width: 18px; min-height: 18px; accent-color: var(--pink-dark); }
.label-form input[type="color"] { padding: 5px; cursor: pointer; }

.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.manage-card, .review-card, .feedback-card {
  background: white; border: 1px solid var(--line); border-radius: 22px; padding: 19px;
  box-shadow: 0 7px 24px rgba(75,48,30,.055);
}
.manage-card header, .review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.manage-card h3, .review-card h3, .feedback-card h3 { margin: 9px 0 5px; font-size: 20px; }
.project-count { min-width: 50px; height: 50px; display: grid; place-items: center; border-radius: 17px; background: var(--yellow); font-weight: 900; }
.meta-grid, .environment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.meta-grid div, .environment div { padding: 10px 12px; border-radius: 13px; background: #faf4ea; min-width: 0; }
.meta-grid dt, .environment dt { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.meta-grid dd, .environment dd { margin: 4px 0 0; font-weight: 850; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.card-actions .mini-button, .card-actions .primary-button { text-decoration: none; display: inline-flex; align-items: center; }
.card-actions button:disabled { opacity: .45; cursor: not-allowed; }
.badge.project-beta { background: #fff0d1; color: #8d5b17; }.badge.project-active { background: #e4f5db; color: #387b2d; }
.badge.project-suspended, .badge.project-archived { background: #eeeae5; color: #726a62; }
.review-grid { display: grid; gap: 15px; }
.review-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.ip-preview { width: 180px; height: 180px; border-radius: 20px; object-fit: cover; background: #f3eee7; border: 1px solid var(--line); }
.review-content p, .feedback-kind { color: var(--ink-soft); }
.reason { padding: 10px 12px; background: #fff0f1; border-radius: 12px; }
.badge.ip-pending, .badge.feedback-pending { background: #fff0d1; color: #8d5b17; }
.badge.ip-approved, .badge.feedback-fixed { background: #e4f5db; color: #387b2d; }
.badge.ip-rejected, .badge.feedback-rejected { background: #ffe0e2; color: #ad3440; }
.badge.feedback-in-progress, .badge.feedback-need-details { background: #e8f4ff; color: #3377a7; }
.feedback-description { white-space: pre-wrap; line-height: 1.65; font-size: 15px; }
.feedback-images { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.feedback-images img { width: 130px; height: 90px; object-fit: cover; border-radius: 13px; border: 1px solid var(--line); }
.feedback-card label { max-width: 260px; }
.upload-form { padding: 3px 0 8px; }
.release-list-card { margin-top: 18px; }
.hash-text { font-family: Consolas, monospace; }
.urgency-mandatory { background: #ffe0e2; color: #ad3440; }
.urgency-important { background: #fff0d1; color: #8d5b17; }
.support-table { min-width: 760px; }

.toast { position: fixed; right: 28px; top: 105px; z-index: 30; max-width: 420px; padding: 13px 17px; border-radius: 14px; color: #245b21; background: #e2f5db; border: 1px solid #baddaa; box-shadow: 0 12px 30px rgba(52,85,42,.16); font-weight: 800; }
.toast.error { color: #9e303a; background: #fff0f1; border-color: #edbec3; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(55,40,31,.35); backdrop-filter: blur(5px); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 28px; background: var(--paper); border: 1px solid #e4d4be; box-shadow: var(--shadow); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 23px 25px 16px; position: sticky; top: 0; z-index: 2; background: rgba(255,250,240,.96); }
.modal-head h2 { margin: 0; font-size: 23px; }
.round-icon-button { width: 39px; height: 39px; border-radius: 50%; border: 1px solid #dac8b1; background: white; font-size: 25px; font-weight: 700; line-height: 1; }
.modal-body { padding: 8px 25px 26px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-copy { color: var(--ink-soft); line-height: 1.6; }
.session-list { display: grid; gap: 10px; }
.session-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.session-card strong, .session-card small { display: block; }.session-card small { color: var(--ink-soft); margin-top: 4px; line-height: 1.45; }
.session-card.revoked { opacity: .62; background: #f4f0eb; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 86px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }.sidebar-brand { justify-content: center; }.sidebar-brand > div:last-child, .nav-button:not(.active) { }
  .sidebar-brand strong, .sidebar-brand span, .nav-button { font-size: 0; }.nav-button span { font-size: 20px; margin: 0; }.nav-button { text-align: center; }
  .sidebar-foot p, .health-pill span { display: none; }.health-pill { justify-content: center; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .app-shell { display: block; }.sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; border-right: 0; border-bottom: 1px solid #ead6aa; }
  .sidebar-brand { padding: 0; margin-right: auto; }.sidebar-brand strong { font-size: 17px; }.sidebar-brand span { display: none; }
  .brand-mark.small { width: 38px; height: 38px; border-radius: 13px; font-size: 17px; }
  .nav-list { display: flex; }.nav-button { padding: 9px 12px; }.sidebar-foot { display: none; }
  .workspace { padding: 0 14px 25px; }.topbar { min-height: 82px; }.topbar .eyebrow, .admin-chip, .icon-text-button span { display: none; }
  .topbar h1 { font-size: 22px; }.summary-grid { gap: 10px; }.summary-card { min-height: 118px; padding: 16px; }.summary-card strong { font-size: 32px; }
  .content-card { padding: 16px; border-radius: 22px; }.section-head, .toolbar { align-items: stretch; flex-direction: column; }.search-box { max-width: none; }
  .filter-tabs { overflow-x: auto; }.form-grid { grid-template-columns: 1fr; }.auth-card { padding: 24px; border-radius: 25px; }
  .form-grid.three, .meta-grid, .environment { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }.review-card { grid-template-columns: 1fr; }.ip-preview { width: 150px; height: 150px; }
}
