/**
  Lovingly made by yefengs
  version:1.0
  lastUpdated:2026-03-29

*/

/* ── 全局变量 ── */
:root {
  --bg:          #f5f2ec;
  --bg-sidebar:  #edeae2;
  --bg-card:     #faf8f4;
  --border:      #d8d2c4;
  --border-light:#e8e3d8;
  --text-main:   #3a2e20;
  --text-sub:    #7a6e5e;
  --text-hint:   #b0a898;
  --accent:      #7b5c38;
  --accent-hover:#5c3f1f;
  --link:        #6b4f2a;
  --link-hover:  #3a2200;
  --active-bg:   #e8e0d0;
  --nav-h:       48px;
}

/* ── 深色模式变量 ── */
:root[data-theme="dark"] {
  --bg:          #1c1b1a;
  --bg-sidebar:  #242220;
  --bg-card:     #2a2927;
  --border:      #3d3b38;
  --border-light:#32302d;
  --text-main:   #e0dbd4;
  --text-sub:    #a09890;
  --text-hint:   #6b6560;
  --accent:      #c49a6c;
  --accent-hover:#d4b48a;
  --link:        #c49a6c;
  --link-hover:  #e0c090;
  --active-bg:   #2e2c29;
}

/* ── 全局过渡（主题切换时颜色平滑变化）── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color .25s ease,
    color .2s ease,
    border-color .2s ease;
}

html { scroll-behavior: smooth; font-size: 15px; }

/* 深色模式下 transition 排除 img 避免闪烁 */
img { transition: opacity .4s ease; }

body {
  font-family: 'Georgia', 'STSong', serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── 顶部导航 ── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
}

.nav-brand {
  font-size: 1rem;
  font-weight: normal;
  color: var(--text-main);
  letter-spacing: .04em;
  margin-right: 32px;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: inline-block;
  padding: 4px 10px;
  font-size: .88rem;
  color: var(--text-sub);
  border-radius: 3px;
  transition: color .2s, background .2s;
}
.nav-link:hover {
  color: var(--text-main);
  background: var(--active-bg);
  text-decoration: none;
}

.nav-login-btn { color: var(--accent); }
.nav-logout    { color: var(--text-hint); font-size: .82rem; }
.nav-user      { color: var(--text-hint); font-size: .82rem; padding: 0 4px; }

/* ── 主题切换按钮 ── */
.theme-btn {
  width: 1.55rem;
  height:1.55rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  margin-left:.4rem;
  margin-right:.4rem ;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, color .2s, background .2s;
  margin-left: 4px;
  flex-shrink: 0;
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--active-bg);
}

/* 太阳月亮图标叠在一起，旋转切换 */
.theme-btn .icon-sun,
.theme-btn .icon-moon {
  position: absolute;
  transition: opacity .35s ease, transform .35s ease;
}
/* 默认：浅色模式显示太阳，隐藏月亮 */
.theme-btn .icon-sun  { opacity: 1; transform: scale(1) rotate(0deg); }
.theme-btn .icon-moon { opacity: 0; transform: scale(.6) rotate(-90deg); }
/* 深色模式：显示月亮，隐藏太阳 */
:root[data-theme="dark"] .theme-btn .icon-sun  { opacity: 0; transform: scale(.6) rotate(90deg); }
:root[data-theme="dark"] .theme-btn .icon-moon { opacity: 1; transform: scale(1) rotate(0deg); }

.nav-toggle {
  display: none;
  font-size: 1.2rem;
  color: var(--text-sub);
  padding: 4px 8px;
  margin-left: auto;
}

/* ── 主布局 ── */
.layout {
  display: flex;
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
  justify-content: center;
}

/* ── 左侧栏 ── */
.sidebar {
  width: 220px;
  min-width: 180px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  user-select: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-title {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-hint);
}

.sidebar-actions { display: flex; gap: 6px; }

.btn-icon {
  width: 24px; height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
}
.btn-icon:hover { background: var(--active-bg); border-color: var(--accent); }

.feed-list { list-style: none; padding: 8px 0; }

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.feed-item:hover { background: var(--active-bg); }
.login .feed-item:hover .feed-count{
    display: none;
}
.login .feed-item .feed-edit,.feed-item .feed-del{
    display:none ;
}
.feed-item.active {
  background: var(--active-bg);
  border-left-color: var(--accent);
}

.feed-name {
  font-size: .9rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-left:.5em ;
}
.feed-item.active .feed-name { color: var(--accent); }
.feed-item[data-id="0"] .feed-name{
    padding-left:0 ;
}
.feed-del {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--text-hint);
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.feed-item:hover .feed-del,.feed-item:hover .feed-edit { opacity: 1; display:inherit}
.feed-del:hover { color: #a04040; }

/* 编辑按钮，风格与删除一致 */
.feed-edit {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--text-hint);
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity .15s, color .15s;
}

.feed-edit:hover { color: var(--accent); }

/* 只读输入框（编辑弹窗中的订阅地址） */
.input-readonly {
  background: var(--bg-sidebar) !important;
  color: var(--text-hint) !important;
  cursor: default;
}

.feed-count {
  font-size: .72rem;
  color: var(--text-hint);
  margin-left: 6px;
  margin-right: 5px;
  flex-shrink: 0;
}
.copyright{
    display:flex;
    justify-content: center;
    padding: .4em 0 .2em;
    color:var(--text-hint);
    font-size: .78rem;
}

/* ── 内容区 ── */
.content {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 48px;
  max-width: 860px;
}

.content-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.content-title {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--text-main);
  letter-spacing: .02em;
}

.content-meta {
  font-size: .8rem;
  color: var(--text-hint);
}

/* ── 文章列表 ── */
.entry-list { display: flex; flex-direction: column; gap: 0; }

.entry-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
}
.entry-item.visible { opacity: 1; transform: none; }

.entry-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.entry-title {
  font-size: 1.222rem;
  color: var(--link);
  line-height: 1.5;
  flex: 1;
  font-weight: bold;
}
.entry-title:hover { color: var(--link-hover); }

.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.entry-feed-tag {
  font-size: .788rem;
  color: var(--text-hint);
  background: var(--border-light);
  padding: 1px 6px;
  border-radius: 2px;
  white-space: nowrap;
}

.entry-time  { font-size: .788rem; color: var(--text-hint); }
.entry-author { font-size: .788rem; color: var(--text-hint); }
.entry-author::before { content: '·'; margin: 0 4px; }

.entry-excerpt {
  font-size: 1rem;
  color: var(--text-sub);
  line-height: 1.65;
}

/* ── 翻页 ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: .85rem;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.total{
  height: 30px;
  padding: 0 8px 0 16px;
  color: var(--text-sub);
  font-size: .85rem;
  line-height: 30px;
}
.page-btn:hover:not(:disabled) {
  background: var(--active-bg);
  border-color: var(--accent);
  color: var(--text-main);
}
.page-btn.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: default;
}
.page-btn:disabled { opacity: .4; cursor: default; }

/* ── loading / empty ── */
.loading-hint, .empty-hint {
  padding: 48px 0;
  text-align: center;
  color: var(--text-hint);
  font-size: .9rem;
}

/* ── 弹窗 ── */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(50,40,28,.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-mask.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px 36px;
  position: relative;
  width: 90%;
  max-width: 420px;
}
.modal-box h3 {
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 22px;
  letter-spacing: .04em;
}
.modal-box p {
  font-size: .788rem;
  color: var(--text-main);
  margin-bottom: .8rem;
}
.modal-box p.author {
  color: var(--text-hint);
  text-align: right;
  font-size:.78rem;
  margin-bottom:0;
}
.modal-box a {
  color: var(--text-main);
  font-weight: bold;
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 1.3rem;
  color: var(--text-hint);
  line-height: 1;
  padding: 2px 6px;
}
.modal-close:hover { color: var(--text-main); }


/* 表单 */
.form-item { margin-bottom: 16px; }
.form-item label {
  display: block;
  font-size: .82rem;
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: .03em;
}

.form-item input[type="text"],
.form-item input[type="url"],
.form-item input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}
.form-item input:focus { border-color: var(--accent); }

.input-row {
  display: flex;
  gap: 8px;
}
.input-row input { flex: 1; }

.btn-primary {
  width: 100%;
  padding: 9px 0;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  font-size: .9rem;
  letter-spacing: .06em;
  transition: background .2s;
  margin-top: 8px;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-sub);
  font-size: .85rem;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.btn-secondary:hover { background: var(--active-bg); border-color: var(--accent); }

.form-tip {
  font-size: .8rem;
  color: #a04040;
  min-height: 16px;
  margin-top: 4px;
}
.form-tip.ok { color: #4a7a4a; }

.feed-desc-editor {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: .83rem;
  line-height: 1.55;
  border-radius: 2px;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}
.feed-desc-editor:focus { 
  border-color: var(--accent);
  margin-top: 2px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: var(--text-main);
  color: var(--border);
  padding: 9px 20px;
  border-radius: 4px;
  font-size: .85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    width: 240px;
    height: calc(100vh - var(--nav-h));
    z-index: 90;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }

  .layout { flex-direction: column; }

  .content { padding: 20px 18px 40px; }

  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links  { display: none; }

  .entry-top { flex-direction: column; gap: 4px; }

  .modal-box { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .content { padding: 16px 14px 32px; }
  .content-title { font-size: 1rem; }
  .entry-title { font-size: .95rem; }
}
