:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #070a12; color: #edf2ff; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 20% -10%, #24325f 0, transparent 38%), radial-gradient(circle at 100% 0, #173f3b 0, transparent 30%), #070a12; }

.reader-layout { display: grid; grid-template-columns: 260px minmax(300px, 420px) minmax(0, 1fr); gap: 0; height: 100vh; }

/* ===== 侧栏：订阅列表 ===== */
.sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid rgba(132, 154, 216, .18); background: rgba(10, 15, 29, .72); }
.sidebar-header { flex: 0 0 auto; padding: 18px 18px 14px; border-bottom: 1px solid rgba(132, 154, 216, .14); }
.eyebrow { margin: 0 0 6px; color: #83a5ff; font: 700 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-title { margin: 0; font-size: 20px; font-weight: 720; letter-spacing: -.02em; }
.reader-credit-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; border: 1px solid rgba(132,154,216,.17); border-radius: 11px; padding: 9px 10px; background: rgba(13,20,38,.72); }
.reader-credit-copy { display: grid; gap: 2px; }
.reader-credit-label { color: #7784a0; font-size: 10px; }
.reader-credit-value { color: #c5d8ff; font-size: 18px; font-weight: 730; font-variant-numeric: tabular-nums; }
.reader-credit-redeem { flex: none; border-color: rgba(102,135,232,.34); padding: 8px 10px; background: #1b3151; color: #b8d2ff; font-size: 11px; }
.reader-credit-redeem:hover { background: #243d68; }
.add-form { display: grid; gap: 8px; padding: 14px 18px; border-bottom: 1px solid rgba(132, 154, 216, .14); }
.add-input { width: 100%; border: 1px solid #35446f; border-radius: 10px; padding: 9px 12px; background: #0d1426; color: #edf2ff; font: inherit; font-size: 13px; }
.add-input:focus { outline: none; border-color: #6687e8; }
.add-input::placeholder { color: #5d6b8c; }
.feed-list { flex: 1; min-height: 0; overflow: auto; padding: 10px; display: grid; gap: 4px; align-content: start; }
.feed-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; width: 100%; border: 1px solid transparent; border-radius: 10px; padding: 9px 11px; background: transparent; color: #c6d0e8; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.feed-item:hover { border-color: rgba(132, 154, 216, .24); background: #131c33; }
.feed-item.selected { border-color: #3f6ed8; background: #1a2947; color: #edf2ff; }
.feed-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-unread { border-radius: 999px; padding: 2px 8px; background: #1b3151; color: #a8cbff; font-size: 11px; font-variant-numeric: tabular-nums; }
.feed-remove { border: 0; padding: 2px 6px; background: transparent; color: #5d6b8c; font-size: 15px; line-height: 1; }
.feed-remove:hover { color: #ff9fac; }
.feed-empty { border: 1px dashed rgba(132, 154, 216, .22); border-radius: 12px; padding: 18px; color: #8290ad; font-size: 12px; line-height: 1.7; }
.sidebar-footer { flex: 0 0 auto; padding: 12px 18px; border-top: 1px solid rgba(132, 154, 216, .14); color: #7784a0; font-size: 11px; }
.sidebar-logout { flex: 0 0 auto; min-height: 44px; border: 0; border-top: 1px solid rgba(132, 154, 216, .14); border-radius: 0; background: transparent; color: #8290ad; }
.sidebar-logout:hover { border-color: rgba(132, 154, 216, .14); background: #131c33; color: #edf2ff; }

/* ===== 中栏：文章列表 ===== */
.article-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid rgba(132, 154, 216, .18); background: rgba(12, 17, 32, .6); }
.article-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(132, 154, 216, .14); }
.article-toolbar-title { overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.article-status { flex: none; color: #7784a0; font-size: 11px; white-space: nowrap; }
.article-list { flex: 1; min-height: 0; overflow: auto; padding: 10px; display: grid; gap: 6px; align-content: start; }
.article-card { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 1px solid rgba(132, 154, 216, .14); border-radius: 12px; padding: 12px 13px; background: rgba(9, 14, 27, .62); color: #c6d0e8; font: inherit; text-align: left; cursor: pointer; }
.article-card-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.article-card-thumb { flex: none; width: 76px; height: 76px; border-radius: 9px; background: #0d1426; object-fit: cover; }
.article-card:hover { border-color: #6687e8; background: #131c33; }
.article-card.selected { border-color: #3f6ed8; background: #1a2947; }
.article-card.read { opacity: .58; }
.article-card-title { font-size: 13px; font-weight: 680; line-height: 1.5; color: #edf2ff; }
.article-card-snippet { color: #8290ad; font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-meta { display: flex; justify-content: space-between; gap: 10px; color: #7784a0; font-size: 11px; }
.article-empty { border: 1px dashed rgba(132, 154, 216, .22); border-radius: 12px; padding: 18px; color: #8290ad; font-size: 12px; line-height: 1.7; }

/* ===== 右栏：阅读区 ===== */
.reading-pane { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 32px 40px 64px; }
.reading-inner { width: min(720px, 100%); margin: 0 auto; }
.reading-title { margin: 0; font-size: clamp(22px, 3vw, 32px); font-weight: 730; letter-spacing: -.02em; line-height: 1.3; }
.reading-title a { color: inherit; text-decoration: none; }
.reading-title a:hover { color: #a8cbff; }
.reading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 24px; color: #8290ad; font-size: 12px; }
.reading-source { border-radius: 999px; padding: 4px 10px; background: #1b3151; color: #a8cbff; font-size: 11px; }
.reading-body { color: #c6d0e8; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.reading-body img, .reading-body video { max-width: 100%; height: auto; border-radius: 10px; }
.reading-body pre { overflow: auto; border: 1px solid rgba(132, 154, 216, .18); border-radius: 10px; padding: 14px; background: #0d1426; font-size: 13px; }
.reading-body a { color: #83a5ff; }
.reading-content-status { margin: 18px 0 0; color: #7784a0; font-size: 12px; }
.reading-placeholder { display: grid; place-content: center; gap: 10px; height: 100%; color: #7784a0; font-size: 13px; text-align: center; }
.error { display: none; margin: 12px 0 0; padding: 10px 12px; border: 1px solid #7b3340; border-radius: 10px; background: rgba(90, 24, 38, .62); color: #ffbdc6; font-size: 12px; }
.error.visible { display: block; }

button { border: 1px solid #35446f; border-radius: 10px; padding: 8px 13px; background: #16203b; color: #edf2ff; font: inherit; font-size: 12px; cursor: pointer; transition: .18s ease; }
button:hover { border-color: #6687e8; background: #202e51; }
button:disabled { cursor: progress; opacity: .6; }
button:focus-visible, input:focus-visible { outline: 2px solid #83a5ff; outline-offset: 2px; }

/* ===== Reader 登录 ===== */
.login-main { display: grid; grid-template-columns: minmax(0, 1fr); width: min(440px, calc(100% - 32px)); min-height: 100dvh; margin: 0 auto; place-items: center; padding: 32px 0; }
/* 渲染根节点是 place-items:center 的 grid item，不撑满会让卡片随内容收缩 */
#reader-login-root { width: 100%; }
.login-shell { width: 100%; }
.login-card { border: 1px solid rgba(132, 154, 216, .24); border-radius: 22px; padding: 30px; background: rgba(14, 20, 37, .9); box-shadow: 0 28px 80px rgba(0, 0, 0, .38); backdrop-filter: blur(18px); }
.login-title { margin: 0; font-size: 30px; font-weight: 740; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
.login-description { margin: 10px 0 24px; color: #9ca9c6; font-size: 14px; line-height: 1.6; }
.login-fields { display: grid; gap: 15px; }
.login-field { display: grid; gap: 7px; margin-top: 15px; color: #91a0bd; font-size: 13px; }
.login-field input { width: 100%; min-height: 44px; border: 1px solid #35446f; border-radius: 10px; padding: 10px 12px; background: #0d1426; color: #edf2ff; font: inherit; font-size: 16px; }
.login-field input::placeholder { color: #5d6b8c; }
.login-error { margin-top: 15px; border: 1px solid #7b3340; border-radius: 10px; padding: 10px 12px; background: rgba(90, 24, 38, .62); color: #ffbdc6; font-size: 13px; line-height: 1.5; }
.login-message { margin-top: 15px; border: 1px solid #315a53; border-radius: 10px; padding: 10px 12px; background: rgba(22, 75, 61, .32); color: #b8f0d7; font-size: 13px; line-height: 1.5; }
.login-submit { width: 100%; min-height: 44px; margin-top: 20px; background: #315fcb; border-color: #527ce0; font-size: 14px; font-weight: 680; }
.login-submit:hover { background: #3d6ed9; }
.login-link { width: 100%; min-height: 40px; margin-top: 10px; border-color: transparent; background: transparent; color: #a9bdf4; font-size: 13px; }
.login-link:hover { border-color: transparent; background: rgba(66, 91, 153, .18); transform: none; }

/* ===== 侧栏：分组 ===== */
.feed-group { display: grid; gap: 2px; }
.feed-group-header { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; border: 0; padding: 8px 9px; background: transparent; color: #8fa0c4; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.feed-group-header:hover { background: #131c33; color: #c6d0e8; }
.feed-group-chevron { font-size: 10px; line-height: 1; text-align: center; }
.feed-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-group-items { display: grid; gap: 2px; padding-left: 10px; }
.feed-item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px; }
.feed-icon-button { border: 0; padding: 3px 5px; background: transparent; color: #5d6b8c; font-size: 12px; line-height: 1; }
.feed-icon-button:hover { color: #edf2ff; background: #16203b; }
.feed-remove:hover { color: #ff9fac; }

/* ===== 内容区操作菜单 ===== */
.article-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.action-group { display: flex; gap: 2px; border: 1px solid #35446f; border-radius: 10px; padding: 2px; background: #0d1426; }
.action-chip { border: 0; border-radius: 8px; padding: 5px 10px; background: transparent; color: #8fa0c4; font-size: 11px; }
.action-chip:hover { background: #16203b; color: #edf2ff; transform: none; }
.action-chip.selected { background: #1b3151; color: #a8cbff; }
.action-button { font-size: 11px; padding: 7px 12px; }
.reading-actions { flex-wrap: nowrap; justify-content: flex-start; }
.action-hint { color: #8de2bd; font-size: 11px; white-space: nowrap; }

/* ===== 编辑订阅弹窗 ===== */
.edit-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(3, 6, 14, .68); backdrop-filter: blur(4px); }
.edit-dialog { display: grid; gap: 14px; width: min(360px, calc(100vw - 48px)); border: 1px solid rgba(132, 154, 216, .3); border-radius: 16px; padding: 20px; background: #0b1020; box-shadow: 0 24px 72px rgba(0, 0, 0, .5); }
.edit-dialog-title { font-size: 16px; font-weight: 720; }
.edit-dialog-field { display: grid; gap: 6px; }
.edit-dialog-label { color: #8190af; font-size: 11px; }
.edit-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== 积分兑换 ===== */
.credit-redeem-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3,6,14,.72); backdrop-filter: blur(5px); }
.credit-redeem-dialog { display: grid; gap: 14px; width: min(440px,100%); border: 1px solid rgba(132,154,216,.3); border-radius: 18px; padding: 22px; background: #0b1020; box-shadow: 0 24px 72px rgba(0,0,0,.5); }
.credit-redeem-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.credit-redeem-title { font-size: 19px; font-weight: 720; }
.credit-redeem-close { display: grid; width: 44px; height: 44px; place-items: center; border-color: transparent; padding: 0; background: transparent; color: #8290ad; font-size: 24px; line-height: 1; }
.credit-redeem-close:hover { border-color: rgba(132,154,216,.2); background: #16203b; color: #edf2ff; }
.credit-redeem-balance { border-radius: 10px; padding: 10px 12px; background: #111b32; color: #b8d2ff; font-size: 13px; font-weight: 650; }
.credit-redeem-description, .credit-redeem-history { color: #8290ad; font-size: 12px; line-height: 1.6; }
.credit-redeem-history { border-left: 2px solid #415d98; padding-left: 9px; }
.credit-redeem-input { width: 100%; min-height: 46px; border: 1px solid #35446f; border-radius: 10px; padding: 10px 12px; background: #0d1426; color: #edf2ff; font: 650 15px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .03em; }
.credit-redeem-input::placeholder { color: #5d6b8c; font-weight: 400; letter-spacing: 0; }
.credit-redeem-input:focus { outline: none; border-color: #6687e8; }
.credit-redeem-form { display: grid; gap: 14px; }
.credit-redeem-message { display: block; border-radius: 9px; padding: 9px 10px; font-size: 12px; line-height: 1.55; }
.credit-redeem-message.error-message { border: 1px solid rgba(165,82,100,.5); background: rgba(83,29,40,.42); color: #ffbdc6; }
.credit-redeem-message.success-message { border: 1px solid rgba(83,216,156,.28); background: rgba(22,73,61,.28); color: #b8f0d7; }
.credit-redeem-submit { min-height: 44px; background: #315fcb; border-color: #527ce0; font-size: 13px; font-weight: 680; }
.credit-redeem-submit:hover { background: #3d6ed9; }

/* ===== 阅读器设置 ===== */
.settings-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3,6,14,.72); backdrop-filter: blur(5px); }
.settings-dialog { display: grid; gap: 14px; width: min(520px,100%); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid rgba(132,154,216,.3); border-radius: 18px; padding: 22px; background: #0b1020; box-shadow: 0 24px 72px rgba(0,0,0,.5); }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-title { font-size: 19px; font-weight: 720; }
.settings-close { display: grid; width: 44px; height: 44px; place-items: center; border-color: transparent; padding: 0; background: transparent; color: #8290ad; font-size: 24px; line-height: 1; }
.settings-close:hover { border-color: rgba(132,154,216,.2); background: #16203b; color: #edf2ff; }
.settings-description { color: #8290ad; font-size: 12px; line-height: 1.6; }
.settings-flags { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid #35446f; border-radius: 10px; padding: 4px; background: #0d1426; }
.settings-flags .action-chip { flex: 1 1 auto; min-height: 34px; }
.settings-field { display: grid; gap: 6px; }
.settings-label { color: #8190af; font-size: 11px; }
.settings-hint { color: #5d6b8c; font-size: 11px; line-height: 1.5; }
.settings-textarea { min-height: 96px; resize: vertical; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.settings-save { min-height: 40px; padding: 8px 16px; }
.sidebar-settings { flex: 0 0 auto; min-height: 44px; border: 0; border-top: 1px solid rgba(132, 154, 216, .14); border-radius: 0; background: transparent; color: #8290ad; }
.sidebar-settings:hover { border-color: rgba(132, 154, 216, .14); background: #131c33; color: #edf2ff; }

@media (max-width: 1080px) {
  .reader-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .reading-pane { position: fixed; inset: 0; z-index: 20; background: #070a12; display: none; }
  .reading-pane.open { display: flex; }
}
@media (max-width: 720px) {
  .reader-layout { grid-template-columns: minmax(0, 1fr); }
  .article-pane { display: none; }
  .article-pane.open { display: flex; }
  .reading-pane { display: none; }
  .reading-pane.open { display: flex; }
}
