Files
Ubuntu 32b43f85bd a
2026-07-03 16:58:28 +08:00

717 lines
13 KiB
CSS

/* ===== Audiobook Player - Minimalist Immersive Design ===== */
/* CSS Variables for theming */
:root {
--bg-primary: #F5F1E8;
--bg-secondary: #FFFFFF;
--bg-card: #FFFFFF;
--text-primary: #2C2C2C;
--text-secondary: #666666;
--text-muted: #999999;
--accent: #8B7355;
--accent-light: #A68B6A;
--border: #E5E0D5;
--shadow: rgba(0, 0, 0, 0.08);
--player-bg: rgba(255, 255, 255, 0.95);
--progress-bg: #E5E0D5;
--progress-fill: #8B7355;
}
.dark-mode {
--bg-primary: #1A1A1A;
--bg-secondary: #252525;
--bg-card: #2A2A2A;
--text-primary: #E8E1D1;
--text-secondary: #B8B0A0;
--text-muted: #888888;
--accent: #A68B6A;
--accent-light: #C4A882;
--border: #3A3A3A;
--shadow: rgba(0, 0, 0, 0.3);
--player-bg: rgba(40, 40, 40, 0.98);
--progress-bg: #3A3A3A;
--progress-fill: #A68B6A;
}
/* Reset and Base */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 16px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
font-family: Georgia, "Times New Roman", serif;
background-color: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
transition: background-color 0.3s ease, color 0.3s ease;
overflow-x: hidden;
}
/* App Container */
.app {
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* ===== Header ===== */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 56px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
z-index: 1000;
box-shadow: 0 1px 3px var(--shadow);
}
.header-title {
font-size: 1.1rem;
font-weight: 600;
color: var(--text-primary);
flex: 1;
text-align: center;
margin: 0 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Navigation Buttons */
.nav-btn {
display: flex;
align-items: center;
gap: 6px;
background: none;
border: none;
color: var(--accent);
font-size: 0.9rem;
cursor: pointer;
padding: 8px 12px;
border-radius: 8px;
transition: background 0.2s;
}
.nav-btn:hover {
background: var(--bg-primary);
}
.nav-icon {
font-size: 0.8rem;
}
.back-btn .nav-text {
display: none;
}
@media (min-width: 400px) {
.back-btn .nav-text {
display: inline;
}
}
/* Theme Toggle */
.theme-toggle {
background: none;
border: none;
font-size: 1.2rem;
cursor: pointer;
padding: 8px;
border-radius: 50%;
transition: transform 0.2s;
}
.theme-toggle:hover {
transform: scale(1.1);
}
/* ===== Main Content ===== */
.main-content {
flex: 1;
padding: 72px 16px 24px;
max-width: 800px;
margin: 0 auto;
width: 100%;
}
/* Welcome Section */
.welcome {
text-align: center;
margin-bottom: 32px;
}
.welcome h2 {
font-size: 1.5rem;
margin-bottom: 8px;
color: var(--text-primary);
}
.subtitle {
color: var(--text-muted);
font-size: 0.9rem;
}
/* ===== Source Cards (Home) ===== */
.sources-grid {
display: grid;
gap: 16px;
}
.source-card {
display: flex;
align-items: center;
gap: 16px;
background: var(--bg-card);
border-radius: 16px;
padding: 20px;
text-decoration: none;
color: inherit;
box-shadow: 0 2px 8px var(--shadow);
transition: transform 0.2s, box-shadow 0.2s;
min-height: 80px;
}
.source-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px var(--shadow);
}
.source-icon {
font-size: 2.5rem;
flex-shrink: 0;
}
.source-info {
flex: 1;
}
.source-name {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 4px;
color: var(--text-primary);
}
.source-count {
font-size: 0.85rem;
color: var(--text-secondary);
}
.source-arrow {
font-size: 1.5rem;
color: var(--text-muted);
}
/* ===== List Page ===== */
.list-header {
margin-bottom: 20px;
}
.list-header h2 {
font-size: 1.1rem;
color: var(--text-secondary);
margin-bottom: 12px;
}
.search-box input {
width: 100%;
padding: 12px 16px;
border: 1px solid var(--border);
border-radius: 12px;
background: var(--bg-card);
color: var(--text-primary);
font-size: 1rem;
font-family: inherit;
}
.search-box input:focus {
outline: none;
border-color: var(--accent);
}
.search-box input::placeholder {
color: var(--text-muted);
}
/* Stories List */
.stories-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.story-item {
display: flex;
align-items: center;
gap: 12px;
background: var(--bg-card);
border-radius: 12px;
padding: 16px;
text-decoration: none;
color: inherit;
transition: background 0.2s;
}
.story-item:hover {
background: var(--bg-secondary);
}
.story-number {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-primary);
border-radius: 50%;
font-size: 0.85rem;
color: var(--text-secondary);
flex-shrink: 0;
}
.story-info {
flex: 1;
min-width: 0;
}
.story-title {
font-size: 1rem;
font-weight: 600;
margin-bottom: 4px;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.story-meta {
font-size: 0.8rem;
color: var(--text-secondary);
}
.story-meta .author {
color: var(--accent);
}
.story-arrow {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-primary);
border-radius: 50%;
font-size: 0.7rem;
color: var(--accent);
flex-shrink: 0;
}
/* ===== Player Page ===== */
.player-page {
overflow: hidden;
}
/* Fixed Player Bar (80px) */
.player-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 80px;
background: var(--player-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
z-index: 1000;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 16px;
}
.player-controls {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
}
.player-info {
flex: 1;
min-width: 0;
}
.player-title {
font-size: 0.95rem;
font-weight: 600;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 2px;
}
.player-author {
font-size: 0.8rem;
color: var(--text-secondary);
}
.play-btn, .close-btn {
width: 44px;
height: 44px;
border-radius: 50%;
border: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: transform 0.2s;
}
.play-btn {
background: var(--accent);
color: white;
font-size: 1.2rem;
}
.play-btn:hover {
transform: scale(1.05);
background: var(--accent-light);
}
.close-btn {
background: var(--bg-primary);
color: var(--text-secondary);
font-size: 1rem;
}
.close-btn:hover {
color: var(--text-primary);
}
/* Progress Bar */
.progress-container {
display: flex;
align-items: center;
gap: 10px;
padding-top: 8px;
}
.time-current, .time-total {
font-size: 0.7rem;
color: var(--text-muted);
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
min-width: 35px;
}
.time-total {
text-align: right;
}
/* Speed Control Bar */
.speed-control-bar {
position: fixed;
top: 80px;
left: 0;
right: 0;
height: 44px;
background: var(--player-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
gap: 40px;
padding: 0 20px;
}
.speed-btn {
background: none;
border: none;
color: var(--text-secondary);
font-size: 0.9rem;
font-family: inherit;
cursor: pointer;
padding: 6px 16px;
border-radius: 16px;
transition: all 0.2s;
min-width: 60px;
}
.speed-btn:hover {
color: var(--text-primary);
background: var(--bg-primary);
}
.speed-btn.active {
color: white;
background: var(--accent);
}
/* Content Area with Speed Control */
.content-area.player-with-speed {
margin-top: 124px; /* 80px player + 44px speed control */
}
.progress-bar {
flex: 1;
height: 4px;
background: var(--progress-bg);
border-radius: 2px;
cursor: pointer;
position: relative;
}
.progress-fill {
height: 100%;
background: var(--progress-fill);
border-radius: 2px;
width: 0%;
transition: width 0.1s linear;
}
/* Content Area */
.content-area {
margin-top: 80px;
padding: 20px 16px 40px;
height: calc(100vh - 80px);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.content-area.player-with-speed {
margin-top: 124px; /* 80px player + 44px speed control */
height: calc(100vh - 124px);
}
.story-content {
max-width: 680px;
margin: 0 auto;
}
.content-header {
margin-bottom: 32px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border);
}
.content-header h1 {
font-size: 1.6rem;
line-height: 1.3;
margin-bottom: 12px;
color: var(--text-primary);
}
.content-meta {
font-size: 0.9rem;
color: var(--text-secondary);
}
.content-meta .author {
color: var(--accent);
font-weight: 500;
}
.content-meta .year {
margin-left: 8px;
padding-left: 8px;
border-left: 1px solid var(--border);
}
/* Content Body */
.content-body {
font-size: 1.1rem;
line-height: 1.8;
color: var(--text-primary);
}
.content-chunk {
margin-bottom: 24px;
transition: opacity 0.3s ease;
}
.content-chunk p {
margin-bottom: 1.2em;
text-align: justify;
hyphens: auto;
}
.content-chunk p:last-child {
margin-bottom: 0;
}
/* Loading State */
.loading {
text-align: center;
padding: 40px;
color: var(--text-muted);
}
/* Content End */
.content-end {
text-align: center;
padding: 48px 0;
color: var(--text-muted);
border-top: 1px solid var(--border);
margin-top: 48px;
}
.content-end p {
font-style: italic;
margin-bottom: 24px;
}
.back-to-list {
padding: 12px 32px;
background: var(--accent);
color: white;
border: none;
border-radius: 24px;
font-size: 0.95rem;
cursor: pointer;
transition: background 0.2s;
}
.back-to-list:hover {
background: var(--accent-light);
}
/* ===== Empty State ===== */
.empty-state {
text-align: center;
padding: 60px 20px;
color: var(--text-muted);
}
.empty-state p {
font-size: 1.1rem;
margin-bottom: 8px;
}
.empty-subtitle {
font-size: 0.85rem !important;
}
/* ===== Footer ===== */
.footer {
text-align: center;
padding: 20px;
color: var(--text-muted);
font-size: 0.8rem;
border-top: 1px solid var(--border);
}
/* ===== Responsive Adjustments ===== */
@media (min-width: 768px) {
.main-content {
padding-top: 80px;
}
.content-area {
padding: 32px 40px;
}
.content-body {
font-size: 1.2rem;
line-height: 1.9;
}
}
@media (min-width: 1024px) {
.player-bar {
left: auto;
width: 380px;
right: 0;
top: 0;
bottom: 0;
height: auto;
border-left: 1px solid var(--border);
border-bottom: none;
flex-direction: column-reverse;
justify-content: flex-end;
padding: 24px;
}
.player-controls {
flex-direction: column;
gap: 20px;
}
.player-info {
text-align: center;
}
.progress-container {
padding-top: 0;
padding-bottom: 20px;
}
.content-area {
margin-top: 0;
margin-right: 380px;
height: 100vh;
}
.content-area.player-with-speed {
margin-top: 0;
margin-right: 380px;
height: 100vh;
}
.speed-control-bar {
left: auto;
right: 0;
top: auto;
bottom: 0;
width: 380px;
height: 60px;
border-top: 1px solid var(--border);
border-bottom: none;
border-left: 1px solid var(--border);
}
}
/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-muted);
}
/* ===== Selection ===== */
::selection {
background: var(--accent-light);
color: white;
}
.dark-mode ::selection {
background: var(--accent);
}