:root {
  --app-bg: #edf1f6;
  --chrome: #ffffff;
  --chrome-border: #d8dee9;
  --toolbar: #f7f9fc;
  --ink: #202124;
  --muted: #667085;
  --blue: #2556b8;
  --blue-soft: #eaf1ff;
  --paper: #ffffff;
  --line: #d9dee8;
  --table-line: #9aa4b2;
  --comment: #fff8d8;
  --shadow: 0 22px 54px rgba(18, 24, 38, .17);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--app-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37,86,184,.08), transparent 34rem),
    linear-gradient(180deg, #f9fbfe 0, var(--app-bg) 230px, #e7ebf2 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--chrome-border);
  backdrop-filter: blur(14px);
}
.window-controls { display: flex; gap: 7px; }
.window-controls span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d4dae3;
  border: 1px solid #bdc5d1;
}
.file-identity { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.doc-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #174ea6, #3f7ee8);
  color: white;
  font-weight: 700;
  font-size: 15px;
}
.file-meta { min-width: 0; }
.file-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-subtitle { margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-pill {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37,86,184,.22);
}
.contact-pill:hover { text-decoration: none; background: #1e489b; }

.menu-strip {
  position: sticky;
  top: 56px;
  z-index: 35;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 74px;
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid #edf0f5;
  color: #596273;
  font-size: 12px;
  user-select: none;
  pointer-events: none;
}

.toolbar {
  position: sticky;
  top: 84px;
  z-index: 34;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 18px 8px 74px;
  background: var(--toolbar);
  border-bottom: 1px solid var(--chrome-border);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
  overflow-x: auto;
}
.faux-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: .62;
  pointer-events: none;
  user-select: none;
}
.static-tool {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #fff;
  color: #677083;
  font-size: 12px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.02);
  cursor: default;
}
.static-tool::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}
.static-tool.icon-line::before { content: none; }
.static-tool.icon-line { width: 30px; padding: 0; color: #98a2b3; }
.document-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 3px;
  border: 1px solid #dfe5ef;
  border-radius: 11px;
  background: #eef3fb;
  box-shadow: inset 0 1px 2px rgba(18,24,38,.04);
}
.lang-tab {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f5b6b;
  padding: 0 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 12.5px;
  cursor: pointer;
}
.lang-tab:hover { background: rgba(255,255,255,.64); }
.lang-tab.active {
  background: #fff;
  color: #174ea6;
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(18,24,38,.12);
}


.topbar,
.menu-strip,
.toolbar,
.outline-panel,
.comments-panel,
.ruler {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.workspace {
  width: min(1440px, 100vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 230px;
  gap: 22px;
  padding: 24px 22px 72px;
}
.outline-panel,
.comments-panel {
  position: sticky;
  top: 150px;
  align-self: start;
  max-height: calc(100vh - 170px);
  overflow: auto;
}
.outline-panel {
  padding: 14px;
  border: 1px solid var(--chrome-border);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 24px rgba(18,24,38,.06);
}
.panel-title {
  margin-bottom: 12px;
  color: #6b7280;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.outline-panel a {
  display: block;
  padding: 8px 9px;
  border-radius: 8px;
  color: #344054;
  font-size: 13px;
  line-height: 1.25;
}
.outline-panel a:hover { background: var(--blue-soft); text-decoration: none; }
.document-stage { min-width: 0; }
.ruler {
  height: 27px;
  max-width: 8.8in;
  margin: 0 auto 10px;
  border: 1px solid var(--chrome-border);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 47px, #cbd3df 48px),
    #fff;
  box-shadow: 0 4px 10px rgba(18,24,38,.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  color: #8a94a6;
  font-size: 10px;
  user-select: none;
}

.page {
  display: none;
  width: 8.5in;
  min-height: 11in;
  margin: 0 auto;
  padding: .72in .82in .78in;
  background: var(--paper);
  border: 1px solid #d6d9df;
  border-radius: 2px;
  box-shadow: var(--shadow);
  font-family: "Times New Roman", Times, serif;
  font-size: 11.2pt;
  line-height: 1.42;
}
.page.active { display: block; }
.page[lang="zh-Hans"] { font-family: "Times New Roman", SimSun, "Songti SC", "Noto Serif CJK SC", serif; line-height: 1.55; }
.page[lang="ko"] { font-family: "Times New Roman", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Serif CJK KR", serif; line-height: 1.58; }

.doc-header-space {
  height: .42in;
  margin: -.42in 0 .3in;
  padding-top: .13in;
  border-bottom: 1px solid #d8dce3;
  color: #667085;
  font-size: 8.6pt;
  font-weight: 700;
}
.title-block {
  text-align: center;
  padding: 8px 0 22px;
  border-bottom: 1.5px solid #252525;
  margin-bottom: 22px;
}
h1 { margin: 0 0 6px; font-size: 24pt; line-height: 1.08; font-weight: 700; }
.deck { margin: 0; font-size: 13pt; font-style: italic; text-align: center; }
.subdeck, .prepared { margin: 5px 0 0; font-size: 10.8pt; text-align: center; color: #333; }
h2 { margin: 22px 0 7px; font-size: 13.2pt; line-height: 1.22; font-weight: 700; }
h3 { margin: 16px 0 6px; font-size: 11.6pt; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 10px; text-align: justify; }
.abstract-block {
  margin: 0 0 18px;
  padding: 12px 14px 9px;
  border: 1px solid #a7aeb9;
  background: #fbfcfe;
}
.abstract-block h2,
.contents h2,
.notes h2 { margin-top: 0; }
.keywords { font-size: 10.3pt; text-align: left; }
.contents {
  margin: 0 0 24px;
  padding: 12px 14px;
  background: #f7f9fc;
  border-left: 4px solid #b7c3d6;
}
.contents ol { margin: 0; padding-left: 20px; columns: 2; }
.contents li { margin: 3px 0; break-inside: avoid; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 18px;
  font-size: 9.6pt;
  line-height: 1.3;
}
.doc-table caption {
  caption-side: top;
  text-align: left;
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 10.4pt;
}
.doc-table th,
.doc-table td {
  border: 1px solid var(--table-line);
  padding: 7px 8px;
  vertical-align: top;
  text-align: left;
}
.doc-table th {
  background: #eef2f7;
  font-size: 9.2pt;
}
.doc-table td:first-child { width: 18%; font-weight: 700; }
.project-list { margin: 0 0 14px; padding-left: 21px; }
.project-list li { margin: 5px 0; }
.notes {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #222;
  font-size: 9.8pt;
}
.notes p { text-align: left; }
.comment-card {
  margin-bottom: 12px;
  padding: 12px 13px;
  border: 1px solid #e2d38b;
  border-radius: 12px;
  background: var(--comment);
  box-shadow: 0 8px 20px rgba(18,24,38,.06);
  font-size: 12px;
  color: #3d3b2f;
}
.comment-card span { display: block; margin-bottom: 5px; font-weight: 700; color: #5c4a00; }
.comment-card p { margin: 0; text-align: left; line-height: 1.35; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 180px minmax(0, 1fr); }
  .comments-panel { display: none; }
  .toolbar { padding-left: 18px; }
  .menu-strip { padding-left: 18px; }
}
@media (max-width: 980px) {
  .workspace { display: block; padding: 18px 12px 48px; }
  .outline-panel { display: none; }
  .page, .ruler { width: min(8.5in, calc(100vw - 24px)); }
  .page { padding: .55in .45in .65in; }
  .toolbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
  .topbar { height: auto; min-height: 58px; padding: 10px 12px; }
  .window-controls, .file-subtitle, .menu-strip, .faux-tools { display: none; }
  .toolbar {
    position: sticky;
    top: 58px;
    z-index: 39;
    display: block;
    padding: 7px 10px 9px;
    min-height: 48px;
    background: rgba(247,249,252,.98);
  }
  .toolbar::before {
    content: "Document tabs";
    display: block;
    margin: 0 0 5px 2px;
    color: #6b7280;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .document-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    overflow: visible;
    border-radius: 10px;
  }
  .lang-tab {
    min-width: 0;
    width: 100%;
    padding: 0 6px;
    font-size: 11.5px;
    white-space: nowrap;
  }
  .contact-pill { padding: 7px 11px; }
  .file-title { font-size: 13px; }
  .workspace { padding-top: 12px; }
  .ruler { display: none; }
  .page { font-size: 10.6pt; padding: .5in .28in .55in; }
  .doc-header-space { display: none; }
  .contents ol { columns: 1; }
  h1 { font-size: 21pt; }
  .deck { font-size: 12pt; }
}
