:root {
  --bg: #eef2f7;
  --ink: #18212f;
  --muted: #8b96a7;
  --line: rgba(255, 255, 255, 0.12);
  --nav: #111827;
  --nav-soft: #1f2937;
  --blue: #2563eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
}

.sidebar {
  min-height: 0;
  background: var(--nav);
  color: #fff;
  padding: 18px 14px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff7d6;
  overflow: hidden;
}

.sun-mark {
  width: 20px;
  height: 20px;
  display: block;
  position: relative;
  border-radius: 50%;
  background: #f7b733;
  box-shadow: 0 0 0 5px rgba(247, 183, 51, 0.22);
}

.sun-mark::before {
  content: "";
  position: absolute;
  inset: -9px;
  background:
    linear-gradient(#f7b733, #f7b733) center 0 / 3px 7px no-repeat,
    linear-gradient(#f7b733, #f7b733) center 100% / 3px 7px no-repeat,
    linear-gradient(90deg, #f7b733, #f7b733) 0 center / 7px 3px no-repeat,
    linear-gradient(90deg, #f7b733, #f7b733) 100% center / 7px 3px no-repeat;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.brand p {
  margin: 4px 0 0;
  color: #aab4c2;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.nav button {
  min-height: 42px;
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: #d8dee8;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.nav button:hover,
.nav button.active {
  color: #fff;
  background: var(--nav-soft);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #dbe2ea;
  background: rgba(255, 255, 255, 0.94);
}

.strip-main,
.strip-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.strip-main span,
.strip-main a,
.strip-actions a,
.strip-actions button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 12px;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.strip-main span:first-child {
  color: #0f172a;
  font-weight: 800;
}

.strip-main a {
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--blue);
  font-weight: 700;
}

.strip-actions a,
.strip-actions button {
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.history-list {
  position: absolute;
  z-index: 5;
  top: 50px;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid #dbe2ea;
  background: #fff;
}

.history-list[hidden] {
  display: none;
}

.history-list button {
  min-height: 32px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.history-list button:hover,
.history-list button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

iframe {
  width: 100%;
  height: calc(100vh - 50px);
  border: 0;
  display: block;
  background: #fff;
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    overflow: visible;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  iframe {
    height: 82vh;
  }

  .top-strip,
  .strip-main,
  .strip-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .main {
    min-height: 0;
  }

  .strip-main a,
  .strip-main span,
  .strip-actions a,
  .strip-actions button {
    width: 100%;
    max-width: none;
  }

  .history-list {
    position: static;
  }
}

@media (max-width: 560px) {
  .nav {
    grid-template-columns: 1fr;
  }
}
