/* Takoma 全站基础样式：界面字体、元素默认值、滚动条与 ProseMirror 必需样式。
   必须是页面里第一个样式表（index.html 第一个 stylesheet），组件样式排在它后面才能照常覆盖。 */
/* stylelint-disable scale-unlimited/declaration-strict-value -- 全站最底层默认值，用固定数值，不跟 token 调整 */

/* ── 界面字体（拉丁字符；汉字走 --tk-font 里的中文字体）── */
@font-face {
  font-family: "Source Sans Pro";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/source-sans-pro-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans Pro";
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url("fonts/source-sans-pro-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans Pro";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/source-sans-pro-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans Pro";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("fonts/source-sans-pro-latin-900-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Eczar";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/eczar-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Eczar";
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url("fonts/eczar-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Eczar";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/eczar-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 盒模型与外边距归零 ── */
*,
::before,
::after {
  box-sizing: inherit;
  padding: 0;
  margin: 0;
}

* {
  color: inherit;
}

/* ── 根元素与页面 ── */
/* html 和 body 都绝对定位撑满视口，滚动交给各面板自己处理 */
html,
body {
  position: absolute;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
}

body {
  overflow: auto;
}

html {
  overflow: hidden;
  font-family: sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

body {
  min-width: 268px;
  padding: 0;
  margin: 0 auto;
  border-radius: 10px;
  background: #13152c;
  color: rgb(255 255 255);
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
}

div {
  word-break: break-word;
}

strong {
  font-weight: 600;
}

label {
  font-size: 0.875rem;
}

img {
  border: 0;
}

svg:not(:root) {
  overflow: hidden;
}

template {
  display: none;
}

[hidden] {
  display: none !important;
}

/* ── 链接 ── */
a {
  background-color: transparent;
  color: rgb(255 255 255);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  color: rgb(245 243 194);
  text-decoration: none;
}

/* ── 按钮 ── */
button {
  overflow: visible;
  padding: 1px 6px;
  border: 1px solid;
  font: inherit;
  font-weight: 600;
  text-transform: none;
  -webkit-appearance: button;
}

[type="button"] {
  padding: 1px 6px;
  -webkit-appearance: button;
}

button:disabled {
  color: rgb(255 255 255 / 62.7%);
}

button[disabled] {
  pointer-events: none;
}

/* ── 输入框 ── */
input,
textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 0 10px 10px;
  border: 0;
  background: rgb(14 15 33);
  color: rgb(255 255 255);
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 0.875rem;
  line-height: inherit;
  resize: none;
  touch-action: pan-y;
}

input {
  overflow: visible;
}

textarea {
  overflow: auto;
  vertical-align: top;
}

input::placeholder,
textarea::placeholder {
  color: rgb(255 255 255 / 46.7%);
  opacity: 1;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  height: auto;
  margin: 0;
  appearance: none;
}

::-webkit-file-upload-button,
::-webkit-search-decoration {
  font: inherit;
  -webkit-appearance: button;
}

/* ── 焦点：鼠标点击不出系统描边，键盘焦点由各组件自己画 ── */
input:focus,
textarea:focus,
button:focus,
[role="button"]:focus {
  outline-color: rgb(255 255 255);
  outline-style: none;
  outline-width: 0;
}

input:active,
textarea:active,
button:active,
[role="button"]:active {
  outline-width: 0 !important;
}

::-moz-focus-inner {
  border: 0;
}

:-moz-focusring {
  outline: 1px dotted ButtonText;
}

:-moz-ui-invalid {
  box-shadow: none;
}

/* ── 原生勾选框 / 单选框的外观重置 ── */
[type="checkbox"],
[type="radio"] {
  width: 1.25em;
  height: 1.25em;
  margin-top: -0.125em;
  margin-right: 0.375em;
  margin-left: 0;
  margin-inline: 0 0.375em;
  border-width: medium;
  font-size: inherit;
  vertical-align: middle;
  cursor: pointer;
  appearance: none;
}

[type="checkbox"]:checked,
[type="checkbox"]:indeterminate,
[type="radio"]:checked {
  background-image: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.75em auto;
}

[type="radio"] {
  border-radius: 50%;
}

[type="radio"]:checked {
  border-width: 0.35em;
  background-image: none;
}

[type="checkbox"] ~ label,
[type="radio"] ~ label {
  display: inline-block;
  margin-right: 0.375em;
  margin-bottom: 0;
  cursor: pointer;
}

/* ── 滚动条（Chromium / Safari；颜色由主题变量覆盖） ── */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

::-webkit-scrollbar-track {
  background: none;
}

::-webkit-scrollbar-thumb {
  border: 5px solid transparent;
  border-radius: 15px;
  background-clip: padding-box;
  background-color: rgb(34 37 63);
}

::-webkit-scrollbar-corner,
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* ── ProseMirror 必需样式（同 prosemirror-view 自带样式表的对应规则） ── */
.ProseMirror {
  position: relative;
  word-wrap: break-word;
  white-space: break-spaces;
  font-variant-ligatures: none;
}

.ProseMirror-hideselection ::selection {
  background: transparent;
}

li.ProseMirror-selectednode::after {
  position: absolute;
  inset: -2px -2px -2px -32px;
  border: 2px solid #8cf;
  content: "";
  pointer-events: none;
}
