/*
 * 小红书笔记插件：Tailwind 工具类子集
 *
 * 原插件用 CDN 引入 Tailwind 2.2.19 提供布局工具类，其余样式在 xhs_notes.css
 * 与页面内联 <style> 中。这里只补齐模板实际用到的工具类，避免再依赖外部 CDN。
 * 数值与 Tailwind 默认刻度保持一致，改动前请确认模板中确实用到。
 */

/*
 * 详情页：页面自带固定顶栏，main 不再需要顶部留白。
 */
.xhs-main-detail {
  padding: 0;
  max-width: none;
}

/* ==========================================================================
 * Tailwind 2.2.19 preflight（modern-normalize + base）原文照搬
 *
 * 这一段不能省，也不能缩成「只补 body 外边距」。原插件的视觉有一大半建立在
 * 它上面，缺了就会逐处走形：
 *   - `img{display:block;vertical-align:middle}` —— 少了它图片按 inline 排版，
 *     基线留白会把圆形容器撑高（顶栏头像 32px 图片撑出 41px 的容器）。
 *   - `html{line-height:1.5}` + `button,input{line-height:inherit}` —— 少了它
 *     行高退回 normal（约 1.2），导航、按钮、输入框全部偏紧。
 *   - `blockquote,dd,dl,figure,h1..h6,hr,p,pre{margin:0}` —— 少了它浏览器默认
 *     给 p/h1 的 1em 上下边距会留着，主页的昵称/UID/简介间距全乱。
 *   - `*{border-width:0;border-style:solid}` —— 工具类 .border/.border-2 只设
 *     宽度，靠这条才有样式；同时避免无宽度的 border-color 画出边框。
 *
 * 这里用**裸元素选择器**（特异性 0,0,1），与原版 Tailwind 完全一致，因此不会
 * 盖掉 xhs_notes.css 里的单类组件规则（.nav-link / .site-brand / .note-tag …）。
 * 不要改成 .xhs-notes-container 前缀：那样特异性升到 (0,1,1)，导航与链接会
 * 全部掉成 #000；详情页 body 无类也拿不到重置。
 * ========================================================================== */

*, ::after, ::before { box-sizing: border-box; }

html { -moz-tab-size: 4; tab-size: 4; }
html { line-height: 1.15; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; }
hr { height: 0; color: inherit; }
abbr[title] { -webkit-text-decoration: underline dotted; text-decoration: underline dotted; }
b, strong { font-weight: bolder; }
code, kbd, pre, samp { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; font-size: 1em; }
small { font-size: 80%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sub { bottom: -.25em; }
sup { top: -.5em; }
table { text-indent: 0; border-color: inherit; }
button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; }
button, select { text-transform: none; }
[type=button], [type=reset], [type=submit], button { -webkit-appearance: button; }
::-moz-focus-inner { border-style: none; padding: 0; }
:-moz-focusring { outline: 1px dotted ButtonText; }
:-moz-ui-invalid { box-shadow: none; }
legend { padding: 0; }
progress { vertical-align: baseline; }
::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }
[type=search] { -webkit-appearance: textfield; outline-offset: -2px; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; }
summary { display: list-item; }
blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre { margin: 0; }
button { background-color: transparent; background-image: none; }
fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; margin: 0; padding: 0; }
html { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; line-height: 1.5; }
body { font-family: inherit; line-height: inherit; }
*, ::after, ::before { box-sizing: border-box; border-width: 0; border-style: solid; border-color: currentColor; }
hr { border-top-width: 1px; }
img { border-style: solid; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { opacity: 1; color: #9ca3af; }
[role=button], button { cursor: pointer; }
:-moz-focusring { outline: auto; }
table { border-collapse: collapse; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
button, input, optgroup, select, textarea { padding: 0; line-height: inherit; color: inherit; }
code, kbd, pre, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
audio, canvas, embed, iframe, img, object, svg, video { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
/* 原版这里是 rgba(229,231,235,var(--tw-border-opacity))；本插件不用该变量，写死等价值。 */
*, ::after, ::before { --tw-border-opacity: 1; border-color: rgba(229, 231, 235, 1); }

/*
 * 主题里可能给 body 设了字体/行高，而 .xhs-notes-container 的字体规则在
 * xhs_notes.css 里（同一特异性、后加载，胜出）。这里保持 preflight 原样即可。
 */

.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/*
 * hidden 属性必须能盖住显式 display 规则：徽标一类元素自身是 inline-flex，
 * 只加 hidden 属性不会隐藏。放在工具类之后，确保优先级足够。
 */
[hidden] { display: none !important; }

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.top-1\/2 { top: 50%; }
.top-2 { top: 0.5rem; }
.top-3 { top: 0.75rem; }
.left-0 { left: 0; }
.left-4 { left: 1rem; }
.right-0 { right: 0; }
.right-2 { right: 0.5rem; }
.right-4 { right: 1rem; }
.bottom-2 { bottom: 0.5rem; }
.bottom-3 { bottom: 0.75rem; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

.z-10 { z-index: 10; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-3 { margin-bottom: 0.75rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.mr-2 { margin-right: 0.5rem; }

.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pt-20 { padding-top: 5rem; }
.pb-12 { padding-bottom: 3rem; }

.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-16 { width: 4rem; }
.w-auto { width: auto; }
.w-full { width: 100%; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.min-w-0 { min-width: 0; }
.min-h-screen { min-height: 100vh; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

/*
 * .xhs-notes-container 是列向 flex 容器，main 又带 mx-auto。
 * 交叉轴上的 auto 外边距会让子项按内容宽度收缩，空列表时整页只剩两百多像素宽
 * （分类导航、空状态全被挤扁）。撑满宽度即可，不影响有内容时的表现。
 */
.xhs-notes-container > .xhs-main-wrap,
.xhs-notes-container > .xhs-main-detail { width: 100%; }

.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-gray-200 { border-color: #e5e7eb; }

.bg-white { background-color: #fff; }
.bg-black { background-color: #000; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-opacity-50 { background-color: rgba(0, 0, 0, 0.5); }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-700 { color: #374151; }


.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }
.cursor-pointer { cursor: pointer; }
.cursor-zoom-in { cursor: zoom-in; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }
.transform { transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)); }
.-translate-y-1\/2 { --tw-translate-y: -50%; transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)); }
.animate-spin { animation: spin 1s linear infinite; }
/* Icon::svg('spinner', …, 'xhs-spin') 用的类名；@keyframes spin 在 xhs_notes.css。 */
.xhs-spin { animation: spin 1s linear infinite; }
.pointer-events-none { pointer-events: none; }
.scale-110 { --tw-scale-x: 1.1; --tw-scale-y: 1.1; }

/* 悬停态与响应式断点：模板中出现的全部组合 */
@media (hover: hover) {
  .group:hover .group-hover\:border-gray-400 { border-color: #9ca3af; }
  .group:hover .group-hover\:shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
  .group:hover .group-hover\:scale-110 { transform: scale(1.1); }
}

@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:inline-flex { display: inline-flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}
