:root {
  --brand: #667eea;
  --brand-strong: #5a67d8;
  --accent: #667eea;
  --accent-soft: #eef0ff;
  --purple-from: #667eea;
  --purple-to: #764ba2;
  --purple: linear-gradient(135deg, var(--purple-from) 0%, var(--purple-to) 100%);
  --bg: #f5f4fb;
  --card: #ffffff;
  --border: #e6e3f0;
  --text: #1f2d3d;
  --muted: #5d6470;
  --sidebar-w: 248px;
  --shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
  --radius: 12px;
  --workspace-radius: 14px;
  --workspace-padding: 24px;
  --workspace-table-head: #f6f4fb;
  --workspace-soft: #faf9fe;
}

* { box-sizing: border-box; }

html { view-transition-name: none; }

@view-transition {
  navigation: auto;
}

.sidebar { view-transition-name: app-sidebar; }
.main-content { view-transition-name: app-main; }

::view-transition-old(app-sidebar),
::view-transition-new(app-sidebar) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-group(app-sidebar) { z-index: 2; }

::view-transition-old(app-main) {
  animation: page-out 180ms ease both;
}
::view-transition-new(app-main) {
  animation: page-in 280ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes page-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-8px); }
}

.main-content.page-enter .workspace-main {
  animation: page-in 320ms cubic-bezier(.22, 1, .36, 1);
}
html.page-leave .main-content {
  animation: page-out 160ms ease-in both;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .main-content.page-enter .workspace-main,
  html.page-leave .main-content,
  ::view-transition-old(app-main),
  ::view-transition-new(app-main) {
    animation: none !important;
  }
}

body {
  margin: 0;
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eee9fb 0%, var(--bg) 180px);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--purple-to); }

.layout {
  display: flex;
  min-height: 100vh;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #faf8ff 0%, #fff 48px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-x: hidden;
}

.logo {
  flex-shrink: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 18px;
  background: var(--purple);
  color: #fff;
  font-weight: 650;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.logo-icon svg { width: 18px; height: 18px; display: block; }

.logo h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap;
}

.side-menu {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
}

.side-menu-group + .side-menu-group {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #f0edf6;
}

.side-menu-heading {
  padding: 0 12px 3px;
  color: #6c647a;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 20px;
}

.side-menu a {
  display: flex;
  align-items: center;
  min-height: 35px;
  margin: 1px 0;
  padding: 6px 12px;
  border-radius: 8px;
  color: #4a4458;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.side-menu a svg {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}

.side-menu a:hover {
  background: #f3f0ff;
  color: var(--purple-to);
}

.side-menu a.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.16), rgba(118, 75, 162, 0.14));
  font-weight: 600;
  color: var(--purple-to);
  box-shadow: inset 3px 0 0 var(--purple-from);
}

.user-info {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.user-name {
  font-weight: 550;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
}

.logout-btn:hover {
  background: #f3f0ff;
  color: var(--purple-to);
}

.main-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: transparent;
  padding: 28px 32px;
  overflow: auto;
}

.workspace-header { margin: 0 0 20px; }
.workspace-header h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--text); }
.workspace-header p { margin: 0; color: var(--muted); }
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 16px 10px 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #4a4458;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.page-back svg { width: 22px; height: 22px; display: block; }
.page-back:hover {
  color: var(--purple-to);
  border-color: #c4b5fd;
  background: #f3f0ff;
}
.workspace-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #909399;
}

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; color: var(--text); font-weight: 700; margin: 22px 0 12px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.card, .panel, .form-section, .toolbar, .group-block, .asset-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
}

.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: 24px; font-weight: 700; margin-top: 6px; color: var(--text); }

.toolbar {
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea,
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
select, textarea {
  padding: 8px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.field .clock { font-size: 16px; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.field .clock .date { font-size: 13px; color: var(--muted); font-weight: 400; }

button, .btn, .btn-secondary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 18px;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #34506f;
  transition: all 0.25s;
}

button:hover, .btn-secondary:hover { background: #f3f0ff; border-color: #c4b5fd; color: var(--purple-to); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn, .login-button {
  background: var(--purple);
  border: none;
  color: #fff;
}

.btn:hover, .login-button:hover {
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4294 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
  color: #fff;
}

.btn-secondary {
  color: var(--purple-to);
  border-color: #c4b5fd;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 13px;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th {
  background: #f8f6ff;
  color: #5d5470;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8f6ff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.high { color: #f56c6c; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.error { color: #f56c6c; font-size: 13px; }

.notice {
  padding: 10px 14px;
  border-radius: 8px;
  margin: 0 0 16px;
  background: var(--accent-soft);
  border: 1px solid #d8d0f5;
  color: #5b21b6;
}
.notice.success, .notice.ok { background: #f0f9eb; border-color: #c2e7b0; color: #67c23a; }
.notice.error, .notice.fail { background: #fef0f0; border-color: #fbc4c4; color: #f56c6c; }
.notice.warning { background: #fdf6ec; border-color: #f5dab1; color: #e6a23c; }

.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.status-ACTIVE { background: #f0f9eb; color: #67c23a; }
.status-ERROR { background: #fef0f0; color: #f56c6c; }
.status-DRAFT, .status-DISABLED { background: #f4f4f5; color: #909399; }

.task-account-complete {
  font-weight: 700;
  color: #67c23a;
  padding: 10px 12px;
  background: #f0f9eb;
  border-left: 3px solid #67c23a;
}
.task-self-check {
  font-weight: 700;
  color: #3b3354;
  padding: 10px 12px;
  background: #f4f0ff;
  border-left: 3px solid #6b5ce7;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--workspace-radius);
  border: 1px solid var(--border);
  padding: 32px 28px 36px;
  animation: page-in 420ms cubic-bezier(.22, 1, .36, 1);
}

.login-header { text-align: center; margin-bottom: 20px; }
.login-header h2 { margin: 0 0 8px; color: var(--text); font-size: 22px; font-weight: 700; }
.login-header p { margin: 0; color: var(--muted); font-size: 14px; }

.login-card label { display: block; font-size: 13px; margin: 14px 0 6px; color: #606266; }
.login-card input {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
}

.login-button {
  width: 100%;
  height: 40px;
  margin-top: 20px;
  font-size: 14px;
  background: var(--brand);
}
.login-button:hover { background: var(--brand-strong); transform: none; box-shadow: none; }

@media (max-width: 700px) {
  .layout { display: block; height: auto; }
  .sidebar { width: 100%; height: auto; box-shadow: none; view-transition-name: none; }
  .side-menu { display: flex; gap: 8px; overflow-x: auto; padding: 8px; }
  .side-menu-group { flex: 0 0 auto; }
  .side-menu-group + .side-menu-group { margin: 0; padding: 0 0 0 8px; border: 0; border-inline-start: 1px solid #f0edf6; }
  .side-menu-links { display: flex; gap: 2px; }
  .side-menu a { white-space: nowrap; flex-shrink: 0; height: 42px; }
  .side-menu a.active { border-bottom: 2px solid var(--purple-to); box-shadow: none; }
  .main-content { padding: 16px; }
}

.gads-progress { margin: 12px 0 16px; }
.gads-progress-step {
  margin: 0 0 10px;
  min-height: 1.6em;
  font-size: 14px;
  font-weight: 650;
  color: var(--purple-to, #764ba2);
  line-height: 1.5;
}
.gads-progress-bar {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: #efeafc;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(76, 29, 149, 0.08);
}
.gads-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: width 0.35s ease;
}
.gads-progress-bar.is-indeterminate .gads-progress-fill {
  width: 36%;
  animation: gads-progress-slide 1.2s ease-in-out infinite;
}
.gads-progress-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #3b3354;
  pointer-events: none;
}
@keyframes gads-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
@media (prefers-reduced-motion: reduce) {
  .gads-progress-fill { transition: none; }
  .gads-progress-bar.is-indeterminate .gads-progress-fill { animation: none; width: 50%; }
}
