:root {
  --gutter: 24px;
  --radius: 13px;
  --color-primary: #ff4e6a;
  --color2: #ff761e;
  --color3: #ffb900;
  --color4: #33d57a;
  --color5: #00dbff;
  --color6: #1a98ff;
  --color7: #9090ff;
  --color-primary-bg: rgba(255,78,106,0.15);
  --color2-bg: rgba(255,118,30,0.15);
  --color3-bg: rgba(255,185,0,0.15);
  --color4-bg: rgba(51,213,122,0.15);
  --color5-bg: rgba(0,219,255,0.15);
  --color6-bg: rgba(26,152,255,0.15);
  --color7-bg: rgba(144,144,255,0.15);
  --color-shadow: rgba(161,177,204,0.4);
  --color-card: #fff;
  --color-text-1: #111;
  --color-text-2: #444;
  --color-text-3: #666;
  --drawer-width: 280px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-card: #2b2b2b;
    --color-text-1: #eee;
    --color-text-2: #bbb;
    --color-text-3: #888;
    --color-shadow: rgba(0,0,0,0.4);
  }
  body { background: #1a1a1a; }
}
*, *:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--color-text-2);
  background: #f5f5f5;
  line-height: 1.8;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: color .35s; }
a:hover { color: var(--color-primary); }
img { max-width: 100%; }

/* Background */
#nexmoe-background {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
}
#nexmoe-background .nexmoe-bg {
  opacity: 0.25;
  background-size: cover;
  filter: blur(30px);
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0; left: 0;
  z-index: -1;
}
#nexmoe-background .mdui-appbar {
  padding: 10px;
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}
#nexmoe-background .mdui-appbar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.mdui-toolbar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
  background: var(--color-card);
  box-shadow: 0 1px 4px var(--color-shadow);
}
.mdui-toolbar-spacer { flex: 1; }
.mdui-btn { cursor: pointer; }
.mdui-btn-icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-1);
}
@media screen and (max-width: 1023px) {
  #nexmoe-background .mdui-appbar { display: block !important; }
}

/* Drawer */
#nexmoe-header { margin-left: calc(var(--drawer-width) * -1); }
#nexmoe-header .mdui-drawer {
  position: fixed;
  top: 0;
  left: calc(var(--drawer-width) * -1);
  width: var(--drawer-width);
  height: 100vh;
  background: var(--color-card);
  z-index: 1000;
  overflow-y: auto;
  transition: left .3s cubic-bezier(.4,0,.2,1);
  scrollbar-width: none;
}
#nexmoe-header .mdui-drawer::-webkit-scrollbar { display: none; }
.drawer-open #nexmoe-header .mdui-drawer { left: 0; }
@media screen and (min-width: 1024px) {
  .nexmoe #nexmoe-header { margin-left: 0; }
  #nexmoe-header .mdui-drawer { left: 0 !important; }
}
#nexmoe-header .nexmoe-avatar {
  margin: 45px;
  z-index: 4;
  position: relative;
  width: calc(100% - 90px);
  overflow: hidden;
  border-radius: 100%;
  box-shadow: 0 0.3rem 2rem var(--color-shadow);
  font-size: 0;
}
#nexmoe-header .nexmoe-avatar a {
  padding-bottom: 100%;
  display: block;
  height: 0;
}
#nexmoe-header .nexmoe-avatar img {
  width: 100%;
  border-radius: 50%;
  transition: transform 1.5s ease-out;
}
#nexmoe-header .nexmoe-avatar:hover img { transform: rotate(360deg); }
#nexmoe-header .nexmoe-count {
  padding: 0 30px;
  margin-bottom: 30px;
  display: flex;
}
#nexmoe-header .nexmoe-count div {
  flex: 1;
  text-align: center;
  color: #a3a8ae;
}
#nexmoe-header .nexmoe-count div span {
  color: var(--color-text-2);
  display: block;
}
#nexmoe-header .nexmoe-list {
  padding: 8px 20px;
}
#nexmoe-header .nexmoe-list .nexmoe-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 36px;
  color: #9ca2a8;
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: none;
  cursor: pointer;
}
#nexmoe-header .nexmoe-list .nexmoe-list-item.true,
#nexmoe-header .nexmoe-list .nexmoe-list-item.true i {
  color: #fff;
}
#nexmoe-header .nexmoe-list .nexmoe-list-item.true {
  background: var(--color-primary);
  box-shadow: 0 2px 12px var(--color-primary);
}
#nexmoe-header .nexmoe-list .nexmoe-list-item i { font-size: 18px; color: #9ca2a8; font-style: normal; }
#nexmoe-header .nexmoe-list .nexmoe-list-item .mdui-list-item-content { font-size: 14px; }
#nexmoe-header .nexmoe-copyright {
  padding: 0 30px;
  text-align: center;
  color: #777;
  white-space: normal;
  margin-bottom: 20px;
  font-size: 12px;
}
#nexmoe-header .nexmoe-copyright a { color: var(--color-primary); }

/* Overlay */
.nexmoe-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.drawer-open .nexmoe-overlay {
  opacity: 1;
  pointer-events: auto;
}
@media screen and (min-width: 1024px) {
  .nexmoe-overlay { display: none; }
}

/* Content layout */
#nexmoe-content { position: relative; }
#nexmoe-content .nexmoe-primary {
  box-shadow: 0 0 1rem var(--color-shadow);
  background-color: var(--color-card);
  float: left;
  width: 100%;
  padding: 24px;
  min-height: 100vh;
}
#nexmoe-content:after {
  clear: both;
  display: table;
  content: ' ';
}
@media screen and (max-width: 1024px) {
  #nexmoe-content .nexmoe-primary {
    width: 100%;
    position: relative;
    min-height: 100vh;
  }
  #nexmoe-content .nexmoe-secondary { display: none; }
}

/* Posts */
.nexmoe-posts { position: relative; }
.nexmoe-posts .nexmoe-post {
  width: 100%;
  margin-bottom: 40px;
}
.nexmoe-posts .nexmoe-post:last-child { margin-bottom: 24px; }
.nexmoe-post .nexmoe-post-cover {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 95px;
  background-color: #eee;
}
.nexmoe-post .nexmoe-post-cover img {
  display: block;
  position: absolute;
  left: 0; top: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.nexmoe-post .nexmoe-post-cover h1 {
  position: absolute;
  bottom: 0;
  z-index: 1;
  color: #fff;
  font-size: 2.5rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 24px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
  line-height: 1.3;
}
.nexmoe-post .nexmoe-post-cover h1:after {
  background-image: linear-gradient(to top, rgba(16,16,16,0.35) 25%, rgba(16,16,16,0) 100%);
  pointer-events: none;
  background-size: cover;
  content: '';
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  bottom: 0;
  width: 100%;
  z-index: -1;
}

/* Post meta */
.nexmoe-post .nexmoe-post-meta { margin: 10px 0; font-size: 0; }
.nexmoe-post .nexmoe-post-meta div { display: inline-block; }
.nexmoe-post .nexmoe-post-meta a {
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 5px;
  margin-right: 10px;
  text-decoration: none;
}
.nexmoe-rainbow a:nth-child(7n+1) { background-color: var(--color-primary-bg); color: var(--color-primary); }
.nexmoe-rainbow a:nth-child(7n+2) { background-color: var(--color2-bg); color: var(--color2); }
.nexmoe-rainbow a:nth-child(7n+3) { background-color: var(--color3-bg); color: var(--color3); }
.nexmoe-rainbow a:nth-child(7n+4) { background-color: var(--color4-bg); color: var(--color4); }
.nexmoe-rainbow a:nth-child(7n+5) { background-color: var(--color5-bg); color: var(--color5); }
.nexmoe-rainbow a:nth-child(7n+6) { background-color: var(--color6-bg); color: var(--color6); }
.nexmoe-rainbow a:nth-child(7n+7) { background-color: var(--color7-bg); color: var(--color7); }

/* Widget */
.nexmoe-widget-wrap { padding: 0 20px; }
.nexmoe-widget-wrap .nexmoe-widget-title { font-size: 14px; color: var(--color-text-3); margin-bottom: 8px; font-weight: normal; }
.nexmoe-widget-wrap .nexmoe-widget { }
.nexmoe-widget-wrap .nexmoe-widget .hitokoto-box { margin: 0 auto; overflow: hidden; list-style: none; }
.nexmoe-widget-wrap .nexmoe-widget .hitokoto-text {
  display: inline-block;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.6;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-primary-bg);
  font-style: italic;
  word-break: break-all;
}
.nexmoe-widget-wrap .nexmoe-widget ul { list-style: none; }

/* Pagination */
.nexmoe-page-nav {
  list-style: none;
  text-align: center;
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.nexmoe-page-nav > * {
  color: #999;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  line-height: 36px;
  background: #f5f6f5;
  display: inline-block;
  text-align: center;
  font-size: 14px;
}
.nexmoe-page-nav .current {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 2px 12px var(--color-primary);
}
.nexmoe-page-nav a:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

/* Back to top */
.nexmoe-post-right { float: right; }
.nexmoe-post-right .nexmoe-fixed { position: sticky; top: 24px; }
.nexmoe-post-right .nexmoe-tool { display: flex; flex-direction: column; gap: 8px; }
.nexmoe-post-right .nexmoe-tool button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-card);
  color: var(--color-text-2);
  box-shadow: 0 2px 8px var(--color-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .3s;
}
.nexmoe-post-right .nexmoe-tool button:hover {
  background: var(--color-primary);
  color: #fff;
}
@media screen and (max-width: 1024px) {
  .nexmoe-post-right { display: none; }
}

/* Page title */
.page-title {
  font-size: 26px;
  color: var(--color-text-1);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
}

/* Archive */
.nexmoe-archives .archive-year { margin-bottom: 32px; }
.nexmoe-archives .year-title {
  font-size: 22px;
  color: var(--color-primary);
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 3px solid var(--color-primary);
}
.nexmoe-archives ul { list-style: none; padding-left: 0 !important; }
.nexmoe-archives li {
  position: relative;
  padding: 10px 0;
  padding-left: 25px;
}
.nexmoe-archives li:before {
  content: '';
  width: 14px; height: 14px;
  background: var(--color-primary);
  display: inline-block;
  vertical-align: middle;
  margin-top: -2px;
  margin-right: 11px;
  margin-left: -25px;
  border-radius: 100%;
  border: 3px solid #fff;
  z-index: 100;
  position: relative;
}
.nexmoe-archives li:after {
  content: '';
  height: 100%;
  width: 2px;
  background: var(--color-primary-bg);
  position: absolute;
  left: 6px;
  top: 20px;
}
.nexmoe-archives li:last-child:after { display: none; }
.nexmoe-archives ul span { margin-right: 15px; font-size: 14px; color: var(--color-text-3); font-family: "SF Mono", Consolas, monospace; }

/* Article body (detail page) */
article { color: var(--color-text-2); font-size: 15px; margin-top: 20px; }
article p { line-height: 1.8; margin: 16px 0; }
article ul, article ol { padding-left: 24px; margin: 16px 0; }
article li { margin-bottom: 4px; }
article h1 { font-size: 2.2em; color: var(--color-text-1); margin: 24px 0; }
article h2 { font-size: 1.6em; color: var(--color-text-1); margin: 20px 0; }
article h3 { font-size: 1.3em; color: var(--color-text-1); margin: 16px 0; }
article a { color: var(--color-primary); text-decoration: none; }
article a:hover { text-decoration: underline; }
article blockquote { color: #666; margin: 16px 0; padding: 12px 20px; background: #f8f8f8; border-radius: 8px; border-left: 3px solid var(--color-primary); }
.nexmoe-post .nexmoe-post-cover + .nexmoe-post-meta + article { padding-top: 8px; }

/* About */
.about-content { max-width: 720px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 3px; }
::selection { background: var(--color-primary); color: #fff; }

/* Desktop override layout */
@media screen and (min-width: 1024px) {
  .nexmoe { padding-left: var(--drawer-width); }
  #nexmoe-content .nexmoe-primary { width: calc(100% - 80px); }
}