Spaces:
Paused
Paused
Download novel-reader/src/styles.css from tanlang002/tupload07: direct link, hf CLI and curl.
- Browser
- Download file 15.8 kB
-
https://huggingface.co/spaces/tanlang002/tupload07/resolve/main/novel-reader/src/styles.css
- Command line
-
hf download hf://spaces/tanlang002/tupload07/novel-reader/src/styles.css
-
curl -L -o styles.css https://huggingface.co/spaces/tanlang002/tupload07/resolve/main/novel-reader/src/styles.css
15.8 kB
:root {
--primary: #a8322a;
--primary-dark: #8f2a23;
--bg: #f6f4ef;
--card: #ffffff;
--text: #26221f;
--muted: #8a857e;
--border: #e5e0d8;
--radius: 10px;
}
* {
box-sizing: border-box;
}
html {
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI',
Helvetica, Arial, sans-serif;
line-height: 1.6;
}
a {
color: inherit;
text-decoration: none;
}
button {
font: inherit;
cursor: pointer;
}
.container {
max-width: 760px;
margin: 0 auto;
padding: 14px 12px 28px;
}
/* ---------- 顶栏 ---------- */
.header {
position: sticky;
top: 0;
z-index: 100;
background: var(--primary);
color: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.header-inner {
display: flex;
align-items: center;
gap: 10px;
min-height: 52px;
padding: 12px 12px;
}
/* 桌面端:即使阅读模式的 body 类残留,也强制显示顶栏 */
@media (min-width: 769px) {
body.reader-mode .header {
display: block;
}
}
@media (min-width: 900px) {
.container {
max-width: 960px;
}
}
.logo {
font-size: 18px;
font-weight: 700;
white-space: nowrap;
}
.header-search {
display: flex;
flex: 0 1 240px;
max-width: 240px;
gap: 6px;
}
.header-search input,
.hero-search input,
.chapter-filter {
flex: 1;
border: none;
border-radius: 999px;
padding: 5px 11px;
font-size: 13px;
background: #fff;
outline: none;
}
.header-search input {
height: 30px;
padding: 3px 10px;
}
.header-search button,
.hero-search button {
border: none;
border-radius: 999px;
padding: 8px 16px;
background: var(--primary-dark);
color: #fff;
font-weight: 600;
}
.header-search button {
padding: 5px 12px;
font-size: 13px;
}
.header-links {
display: flex;
align-items: center;
gap: 10px;
margin-left: auto;
white-space: nowrap;
font-size: 14px;
}
.header-links a {
color: #fff;
}
.header-user {
max-width: 90px;
overflow: hidden;
text-overflow: ellipsis;
color: #ffd9d4;
font-size: 13px;
}
.header-logout {
border: 1px solid rgba(255, 255, 255, 0.6);
background: transparent;
color: #fff;
border-radius: 999px;
padding: 4px 10px;
font-size: 13px;
}
/* ---------- 首页 ---------- */
.hero {
text-align: center;
padding: 34px 10px 20px;
}
.hero h1 {
margin: 0 0 6px;
font-size: 26px;
color: var(--primary);
}
.hero p {
margin: 0 0 18px;
color: var(--muted);
font-size: 14px;
}
.hero-search {
display: flex;
gap: 8px;
max-width: 520px;
margin: 0 auto;
}
.hero-search input {
border: 1px solid var(--border);
height: 44px;
}
.hero-search button {
height: 44px;
padding: 0 22px;
}
.section-title {
font-size: 17px;
margin: 22px 0 12px;
padding-left: 10px;
border-left: 4px solid var(--primary);
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.section-btn {
border: 1px solid var(--border);
background: var(--card);
color: var(--muted);
font-size: 12px;
border-radius: 999px;
padding: 4px 12px;
}
.category-chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 6px 0 4px;
}
.chip {
background: #fff;
border: 1px solid var(--border);
border-radius: 999px;
padding: 6px 16px;
font-size: 14px;
}
.chip:active {
background: #f1e5e2;
}
/* ---------- 书籍列表 ---------- */
.book-list {
background: var(--card);
border-radius: var(--radius);
overflow: hidden;
border: 1px solid var(--border);
}
.book-row {
display: flex;
align-items: center;
gap: 10px;
padding: 13px 14px;
border-bottom: 1px solid #f0ece5;
}
.book-row:last-child {
border-bottom: none;
}
.book-row:active {
background: #faf7f2;
}
.book-row-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.book-row-title {
font-size: 16px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.book-row-author {
color: var(--muted);
font-size: 13px;
}
.book-row-latest {
flex-shrink: 0;
max-width: 42%;
font-size: 13px;
color: var(--primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.history-row {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 14px;
border-bottom: 1px solid #f0ece5;
}
.history-row:last-child {
border-bottom: none;
}
.history-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.history-title {
font-size: 15px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.history-chapter {
font-size: 13px;
color: var(--muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.history-continue {
flex-shrink: 0;
font-size: 13px;
color: var(--primary);
font-weight: 600;
}
.history-time {
flex-shrink: 0;
font-size: 12px;
color: var(--muted);
}
.history-delete {
border: none;
background: transparent;
color: var(--muted);
font-size: 18px;
line-height: 1;
padding: 4px 6px;
flex-shrink: 0;
}
.history-delete:active {
color: var(--primary);
}
/* ---------- 书籍详情 ---------- */
.book-page {
padding: 14px 0 40px;
}
.book-head {
display: flex;
gap: 14px;
background: var(--card);
border-radius: var(--radius);
border: 1px solid var(--border);
padding: 16px;
}
.book-actions {
display: flex;
gap: 10px;
margin: 12px 0;
flex-wrap: wrap;
}
.btn.ghost {
background: transparent;
color: var(--muted);
}
.book-progress-banner {
display: block;
background: #fdf3ea;
border: 1px solid #f0d9c5;
color: #a45a2a;
border-radius: var(--radius);
padding: 12px 14px;
margin: 0 0 12px;
font-size: 14px;
font-weight: 600;
}
.book-cover {
width: 104px;
height: 140px;
object-fit: cover;
border-radius: 6px;
flex-shrink: 0;
background: #eee;
}
.book-meta {
min-width: 0;
}
.book-title {
font-size: 20px;
margin: 0 0 10px;
}
.book-meta p {
margin: 4px 0;
color: #555;
font-size: 14px;
}
.book-intro {
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px 14px;
margin: 12px 0;
font-size: 14px;
color: #555;
}
.book-intro summary {
font-weight: 600;
color: var(--text);
cursor: pointer;
}
.book-intro p {
margin: 8px 0 0;
line-height: 1.8;
}
.chapter-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.chapter-toolbar .section-title {
margin: 16px 0 10px;
}
.chapter-filter {
width: 140px;
flex: none;
border: 1px solid var(--border);
height: 34px;
padding: 4px 12px;
font-size: 14px;
}
.chapter-list {
list-style: none;
margin: 0;
padding: 0;
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.chapter-list li {
border-bottom: 1px solid #f0ece5;
}
.chapter-list li:last-child {
border-bottom: none;
}
.chapter-list a {
display: block;
padding: 12px 14px;
font-size: 15px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chapter-list a:active {
background: #faf7f2;
}
/* ---------- 登录页 ---------- */
.login-page {
display: flex;
justify-content: center;
padding: 40px 0;
}
.login-card {
width: 100%;
max-width: 380px;
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 28px 24px;
}
.login-card h1 {
margin: 0 0 6px;
text-align: center;
color: var(--primary);
}
.login-hint {
color: var(--muted);
font-size: 13px;
text-align: center;
margin: 0 0 20px;
}
.login-card label {
display: block;
margin-bottom: 14px;
}
.login-card label span {
display: block;
font-size: 14px;
margin-bottom: 6px;
}
.login-card input {
width: 100%;
border: 1px solid var(--border);
border-radius: 8px;
padding: 11px 12px;
font-size: 15px;
outline: none;
}
.login-card input:focus {
border-color: var(--primary);
}
.login-error {
color: var(--primary);
font-size: 14px;
margin: 0 0 12px;
}
.login-submit {
width: 100%;
padding: 12px;
background: var(--primary);
border: none;
color: #fff;
font-size: 16px;
}
/* ---------- 书架 ---------- */
.shelf-list {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 30px;
}
.shelf-card {
display: flex;
align-items: center;
gap: 12px;
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 14px;
}
.shelf-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 3px;
}
.shelf-title {
font-size: 16px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.shelf-author,
.shelf-progress {
color: var(--muted);
font-size: 13px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.shelf-progress {
color: #a45a2a;
}
.download-bar {
height: 6px;
background: #f0ece5;
border-radius: 999px;
overflow: hidden;
margin-top: 6px;
}
.download-bar-inner {
height: 100%;
background: var(--primary);
border-radius: 999px;
transition: width 0.2s;
}
.download-info {
color: var(--muted);
font-size: 13px;
}
.download-error {
color: var(--primary);
font-size: 13px;
}
.shelf-actions {
display: flex;
flex-direction: column;
gap: 8px;
flex-shrink: 0;
}
.shelf-actions .btn {
padding: 7px 14px;
font-size: 13px;
text-align: center;
}
.load-more,
.pager {
display: flex;
justify-content: center;
gap: 12px;
align-items: center;
margin: 16px 0;
}
.btn {
border: 1px solid var(--border);
background: var(--card);
border-radius: 999px;
padding: 9px 22px;
color: var(--primary);
font-weight: 600;
}
.btn:disabled {
color: #bbb;
background: #f0ede8;
}
.pager-info {
color: var(--muted);
font-size: 14px;
}
/* ---------- 阅读页 ---------- */
.reader {
padding: 16px 0 30px;
}
.reader-head {
text-align: center;
padding-bottom: 12px;
}
.reader-book {
display: inline-block;
color: var(--primary);
font-size: 14px;
margin-bottom: 6px;
}
.reader-title {
font-size: 20px;
margin: 0;
}
.reader-content {
background: var(--card);
border-radius: var(--radius);
border: none;
padding: 18px 18px 30px;
margin-top: 14px;
}
.reader-block + .reader-block {
margin-top: 28px;
}
.reader-subtitle {
font-size: 18px;
text-align: center;
margin: 26px 0 10px;
color: var(--primary);
}
.reader-paragraph {
font-size: 18px;
line-height: 2;
margin: 0 0 18px;
text-indent: 2em;
word-break: break-word;
}
.reader-sentinel {
text-align: center;
color: var(--muted);
font-size: 14px;
padding: 14px 10px;
}
.reader-sentinel-error {
color: var(--primary);
}
.reader-sentinel-error .btn {
margin-left: 8px;
padding: 5px 14px;
font-size: 13px;
}
/* 电脑端:上一章/目录/下一章显示在章节内容内,紧凑居中 */
.chapter-nav {
display: flex;
gap: 10px;
max-width: 460px;
margin: 26px auto 0;
padding: 0;
background: transparent;
border: none;
}
.nav-btn {
flex: 1;
text-align: center;
padding: 10px 0;
border-radius: 999px;
background: var(--primary);
color: #fff;
font-weight: 600;
font-size: 15px;
}
.nav-btn.center {
flex: 1.2;
background: #fff;
color: var(--primary);
border: 1px solid var(--primary);
}
.nav-btn.disabled {
background: #e8e5df;
color: #aaa;
}
.bottom-spacer {
display: none;
}
/* ---------- 手机端阅读模式 ---------- */
body.reader-mode .header {
display: none;
}
body.reader-mode .chapter-nav {
display: none;
}
body.reader-mode .bottom-spacer {
display: none;
}
body.reader-dark {
background: #121214;
}
.reader-body {
min-height: 55vh;
}
.reader-settings-mask {
position: fixed;
inset: 0;
z-index: 300;
background: rgba(0, 0, 0, 0.45);
display: flex;
align-items: flex-end;
}
.reader-settings {
width: 100%;
max-width: 760px;
margin: 0 auto;
border-radius: 16px 16px 0 0;
padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}
.settings-title {
text-align: center;
font-weight: 700;
margin-bottom: 14px;
}
.settings-row {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 14px;
flex-wrap: wrap;
}
.settings-label {
flex: 0 0 48px;
font-size: 14px;
opacity: 0.75;
}
.btn.small {
padding: 6px 14px;
font-size: 14px;
}
.btn.disabled {
color: #aaa;
background: #eee;
}
.settings-value {
min-width: 46px;
text-align: center;
font-size: 14px;
}
.color-dot {
width: 34px;
height: 34px;
border-radius: 50%;
border: 1px solid #d8d2c8;
cursor: pointer;
}
.color-dot.active {
border-color: var(--primary);
box-shadow: 0 0 0 2px rgba(168, 50, 42, 0.25);
}
.settings-row .chip {
border: 1px solid var(--border);
background: transparent;
border-radius: 999px;
padding: 6px 14px;
font-size: 13px;
color: inherit;
}
.settings-row .chip.active {
border-color: var(--primary);
color: var(--primary);
font-weight: 600;
}
.settings-nav {
display: flex;
gap: 10px;
margin-top: 4px;
}
.settings-nav .btn {
flex: 1;
text-align: center;
}
.settings-close {
width: 100%;
margin-top: 12px;
background: var(--primary);
border: none;
color: #fff;
padding: 10px;
}
/* ---------- 确认弹窗 ---------- */
.confirm-mask {
position: fixed;
inset: 0;
z-index: 400;
background: rgba(0, 0, 0, 0.45);
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
}
.confirm-box {
width: 100%;
max-width: 320px;
background: #fff;
border-radius: 14px;
padding: 22px 20px 18px;
text-align: center;
}
.confirm-box h3 {
margin: 0 0 8px;
font-size: 17px;
}
.confirm-box p {
margin: 0 0 18px;
color: var(--muted);
font-size: 14px;
line-height: 1.6;
}
.confirm-actions {
display: flex;
gap: 10px;
}
.confirm-actions .btn {
flex: 1;
text-align: center;
}
.btn.danger {
border: none;
background: var(--primary);
color: #fff;
}
/* ---------- 状态 ---------- */
.status {
text-align: center;
color: var(--muted);
padding: 40px 10px;
font-size: 15px;
}
.status.error {
color: var(--primary);
}
.status .btn {
margin-top: 12px;
}
/* ---------- 手机端 ---------- */
@media (max-width: 768px) {
/* 手机端保持底部固定操作栏 */
.chapter-nav {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
max-width: none;
margin: 0;
background: #fff;
border-top: 1px solid var(--border);
padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
}
.nav-btn {
padding: 6px 0;
font-size: 13px;
}
.bottom-spacer {
display: block;
height: 54px;
}
}
@media (max-width: 520px) {
.header-inner {
gap: 8px;
}
.logo {
font-size: 16px;
}
.header-search input {
height: 28px;
padding: 2px 8px;
font-size: 12px;
}
.header-search button {
padding: 4px 10px;
font-size: 12px;
}
.header-search {
max-width: none;
flex: 1;
}
.hero {
padding: 24px 6px 16px;
}
.hero h1 {
font-size: 22px;
}
.book-head {
padding: 12px;
}
.book-cover {
width: 88px;
height: 120px;
}
.reader-paragraph {
font-size: 17px;
line-height: 1.9;
}
.chapter-filter {
width: 120px;
}
.header-links {
gap: 6px;
font-size: 13px;
}
.header-user {
display: none;
}
.header-logout {
padding: 3px 8px;
font-size: 12px;
}
.shelf-card {
align-items: flex-start;
flex-direction: column;
}
.shelf-actions {
flex-direction: row;
width: 100%;
}
}
:root {
--primary: #a8322a;
--primary-dark: #8f2a23;
--bg: #f6f4ef;
--card: #ffffff;
--text: #26221f;
--muted: #8a857e;
--border: #e5e0d8;
--radius: 10px;
}
* {
box-sizing: border-box;
}
html {
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI',
Helvetica, Arial, sans-serif;
line-height: 1.6;
}
a {
color: inherit;
text-decoration: none;
}
button {
font: inherit;
cursor: pointer;
}
.container {
max-width: 760px;
margin: 0 auto;
padding: 14px 12px 28px;
}
/* ---------- 顶栏 ---------- */
.header {
position: sticky;
top: 0;
z-index: 100;
background: var(--primary);
color: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.header-inner {
display: flex;
align-items: center;
gap: 10px;
min-height: 52px;
padding: 12px 12px;
}
/* 桌面端:即使阅读模式的 body 类残留,也强制显示顶栏 */
@media (min-width: 769px) {
body.reader-mode .header {
display: block;
}
}
@media (min-width: 900px) {
.container {
max-width: 960px;
}
}
.logo {
font-size: 18px;
font-weight: 700;
white-space: nowrap;
}
.header-search {
display: flex;
flex: 0 1 240px;
max-width: 240px;
gap: 6px;
}
.header-search input,
.hero-search input,
.chapter-filter {
flex: 1;
border: none;
border-radius: 999px;
padding: 5px 11px;
font-size: 13px;
background: #fff;
outline: none;
}
.header-search input {