Files
jap_web/src/style.css
T
2026-07-03 13:06:14 +03:00

715 lines
12 KiB
CSS

:root {
--text: #6b6375;
--text-h: #08060d;
--bg: #fff;
--card-bg: #f8f7f9;
--border: #e5e4e7;
--accent: #7c3aed;
--accent-light: rgba(124, 58, 237, 0.1);
--success: #16a34a;
--error: #dc2626;
--shadow: rgba(0, 0, 0, 0.08) 0 4px 12px;
--sans: -apple-system, 'Segoe UI', system-ui, Roboto, sans-serif;
--mono: ui-monospace, Consolas, monospace;
font: 16px/1.5 var(--sans);
color-scheme: light dark;
color: var(--text);
background: var(--bg);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@media (prefers-color-scheme: dark) {
:root {
--text: #9ca3af;
--text-h: #f3f4f6;
--bg: #0f0f13;
--card-bg: #1a1b23;
--border: #2e303a;
--accent: #a78bfa;
--accent-light: rgba(167, 139, 250, 0.15);
--shadow: rgba(0, 0, 0, 0.4) 0 4px 12px;
}
}
* {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
body {
margin: 0;
min-height: 100dvh;
min-height: 100svh;
display: flex;
flex-direction: column;
overscroll-behavior: none;
-webkit-overflow-scrolling: touch;
touch-action: manipulation;
}
#app {
flex: 1;
display: flex;
flex-direction: column;
max-width: 480px;
width: 100%;
margin: 0 auto;
padding: 0;
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
}
.app-header {
padding: 1.5rem 1.25rem 0.5rem;
padding-top: calc(1.5rem + env(safe-area-inset-top));
text-align: center;
}
.app-header h1 {
font-family: var(--sans);
font-size: 1.75rem;
font-weight: 700;
color: var(--text-h);
margin: 0;
letter-spacing: -0.5px;
}
.app-header p {
font-size: 0.9rem;
color: var(--text);
margin: 0.25rem 0 0;
}
.app-content {
flex: 1;
padding: 1rem 1.25rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.card {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.25rem;
box-shadow: var(--shadow);
}
.card-title {
font-size: 0.85rem;
font-weight: 600;
color: var(--text);
text-transform: uppercase;
letter-spacing: 0.5px;
margin: 0 0 0.75rem;
}
.sync-input-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.sync-input-group input {
font-family: var(--mono);
font-size: 0.9rem;
padding: 0.65rem 0.75rem;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg);
color: var(--text-h);
outline: none;
transition: border-color 0.2s;
width: 100%;
}
.sync-input-group input:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-light);
}
.sync-buttons {
display: flex;
gap: 0.5rem;
}
.btn {
flex: 1;
font-family: var(--sans);
font-size: 0.9rem;
font-weight: 600;
padding: 0.75rem 1rem;
min-height: 48px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--card-bg);
color: var(--text-h);
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
user-select: none;
}
.btn:hover {
border-color: var(--accent);
background: var(--accent-light);
}
.btn:active {
transform: scale(0.97);
opacity: 0.9;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
.btn-primary {
background: var(--accent);
color: white;
border-color: var(--accent);
}
.btn-primary:hover {
filter: brightness(1.1);
}
.status-bar {
text-align: center;
font-size: 0.85rem;
padding: 0.5rem 0.75rem;
border-radius: 8px;
background: var(--accent-light);
color: var(--text);
margin-top: auto;
min-height: 36px;
}
.status-bar.error {
background: rgba(220, 38, 38, 0.1);
color: var(--error);
}
.status-bar.success {
background: rgba(22, 163, 74, 0.1);
color: var(--success);
}
.app-footer {
padding: 1rem 1.25rem;
padding-bottom: calc(1rem + env(safe-area-inset-bottom));
text-align: center;
font-size: 0.75rem;
color: var(--text);
opacity: 0.6;
}
.divider {
border: none;
border-top: 1px solid var(--border);
margin: 0.25rem 0;
}
.placeholder-area {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: var(--text);
opacity: 0.4;
font-size: 0.85rem;
gap: 0.5rem;
min-height: 100px;
}
.word-list {
list-style: none;
padding: 0;
margin: 0;
}
.word-item {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 14px 16px;
margin-bottom: 10px;
display: flex;
align-items: center;
flex-wrap: wrap;
box-shadow: var(--shadow);
transition: border-color 0.2s;
}
.word-item:hover {
border-color: var(--accent);
}
.word-item-empty {
align-items: center;
text-align: center;
color: var(--text);
opacity: 0.6;
font-size: 0.9rem;
padding: 24px 16px;
}
.word-key {
font-size: 1.2rem;
font-weight: 600;
color: var(--text-h);
letter-spacing: 0.5px;
flex-shrink: 0;
}
.word-value {
font-size: 0.95rem;
color: var(--text);
flex: 1;
text-align: right;
}
.word-tags {
font-size: 0.7rem;
color: var(--accent);
background: var(--accent-light);
padding: 2px 8px;
border-radius: 4px;
font-weight: 500;
flex-basis: 100%;
order: 1;
align-self: flex-start;
margin-top: 2px;
}
.placeholder-icon {
font-size: 2rem;
opacity: 0.6;
}
/* ──── Группировка слов (табы) ──── */
.group-tabs {
display: flex;
gap: 0;
border-bottom: 1px solid var(--border);
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.group-tabs::-webkit-scrollbar {
display: none;
}
.group-tab {
flex: 1;
min-width: 0;
font-family: var(--sans);
font-size: 0.85rem;
font-weight: 600;
padding: 0.65rem 0.5rem;
border: none;
border-bottom: 2px solid transparent;
background: transparent;
color: var(--text);
cursor: pointer;
transition: all 0.2s;
-webkit-tap-highlight-color: transparent;
white-space: nowrap;
display: flex;
align-items: center;
gap: 0.5rem;
}
.group-tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
background: var(--accent-light);
}
.group-tab-count {
font-size: 0.7rem;
background: var(--accent-light);
color: var(--accent);
padding: 1px 6px;
border-radius: 8px;
font-weight: 500;
margin-left: auto;
}
.group-panel {
display: none;
padding-top: 0.75rem;
}
.group-panel.active {
display: block;
}
.word-tag-block {
margin-bottom: 0.5rem;
}
.word-tag-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 10px;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
border-radius: 8px;
transition: background 0.15s;
}
.word-tag-header:hover {
background: var(--accent-light);
}
.word-tag-header::after {
content: '▸';
font-size: 0.75rem;
color: var(--text);
transition: transform 0.2s;
}
.word-tag-header.collapsed::after {
transform: rotate(90deg);
}
.word-tag-label {
font-size: 0.85rem;
font-weight: 500;
color: var(--accent);
}
.word-tag-count {
font-size: 0.75rem;
color: var(--text);
background: var(--accent-light);
padding: 1px 8px;
border-radius: 10px;
}
.word-tag-words {
padding: 0.25rem 0 0.25rem 0.5rem;
}
.word-tag-words .word-item {
margin-bottom: 6px;
padding: 10px 12px;
}
.word-tag-words .word-item:last-child {
margin-bottom: 0;
}
/* ──── Навигация ──── */
.app-nav {
display: flex;
border-top: 1px solid var(--border);
background: var(--card-bg);
position: sticky;
bottom: 0;
z-index: 10;
padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
flex: 1;
font-family: var(--sans);
font-size: 0.85rem;
font-weight: 600;
padding: 0.75rem 0.5rem;
min-height: 52px;
border: none;
background: transparent;
color: var(--text);
cursor: pointer;
transition: all 0.2s;
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
}
.nav-btn.active {
color: var(--accent);
background: var(--accent-light);
}
.nav-btn:hover {
color: var(--accent);
}
/* ──── Страница колод ──── */
.sets-layout {
display: flex;
gap: 0;
flex: 1;
min-height: 0;
}
.sets-list {
flex: 1;
list-style: none;
padding: 0;
margin: 0;
border-right: 1px solid var(--border);
overflow-y: auto;
}
.sets-list li {
padding: 14px 14px;
min-height: 48px;
cursor: pointer;
border-bottom: 1px solid var(--border);
transition: background 0.15s;
font-weight: 500;
color: var(--text-h);
-webkit-tap-highlight-color: transparent;
}
.sets-list li:last-child {
border-bottom: none;
}
.sets-list li:hover {
background: var(--accent-light);
}
.sets-list li.selected {
background: var(--accent-light);
color: var(--accent);
}
.sets-detail {
flex: 1;
padding: 14px;
overflow-y: auto;
}
.sets-detail h3 {
margin: 0 0 12px;
font-size: 1rem;
color: var(--text-h);
}
.sets-detail p {
margin: 0 0 6px;
font-size: 0.85rem;
color: var(--text);
}
.sets-detail .mode-select {
width: 100%;
margin: 10px 0;
padding: 10px;
min-height: 48px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg);
color: var(--text-h);
font-size: 0.9rem;
}
.sets-detail .btn {
width: 100%;
margin-top: 8px;
}
@media (max-width: 400px) {
.sets-layout {
flex-direction: column;
}
.sets-list {
border-right: none;
border-bottom: 1px solid var(--border);
max-height: 200px;
}
}
/* ──── Страница тренировки ──── */
.training-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem 0;
}
.training-card {
flex: 1;
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 16px;
padding: 2rem 1.5rem;
box-shadow: var(--shadow);
display: flex;
flex-direction: column;
justify-content: center;
min-height: 200px;
}
.training-content {
text-align: center;
}
.training-field {
font-size: 1.5rem;
font-weight: 600;
color: var(--text-h);
padding: 0.5rem 0;
line-height: 1.4;
}
.training-side {
padding: 0.5rem 0;
}
.training-side-back .training-field {
color: var(--accent);
font-weight: 500;
}
.training-divider {
border: none;
border-top: 1px solid var(--border);
margin: 0.75rem 0;
}
.training-score {
font-size: 0.85rem;
color: var(--accent);
margin-top: 0.75rem;
font-weight: 500;
opacity: 0.8;
}
/* ──── Просмотр слова ──── */
.word-view-header {
padding: 0.5rem 0;
}
.word-view-card {
flex: 1;
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 16px;
padding: 1.5rem;
box-shadow: var(--shadow);
}
.word-view-section {
padding: 0.25rem 0;
}
.word-view-label {
font-size: 0.75rem;
font-weight: 600;
color: var(--text);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 0.5rem;
}
.word-view-field {
font-size: 1.3rem;
font-weight: 600;
color: var(--text-h);
padding: 0.25rem 0;
line-height: 1.4;
}
.word-view-field-back {
color: var(--accent);
}
.word-view-divider {
border: none;
border-top: 1px solid var(--border);
margin: 0.75rem 0;
}
.word-view-more-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
gap: 8px;
}
.word-view-more-key {
font-size: 0.8rem;
font-weight: 500;
color: var(--text);
flex-shrink: 0;
}
.word-view-more-value {
font-size: 0.9rem;
color: var(--text-h);
text-align: right;
word-break: break-word;
}
.word-view-actions {
padding: 0.75rem 0;
}
.training-actions {
padding: 0.75rem 0;
}
.training-vote {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
}
.vote-btn {
font-size: 0.85rem;
padding: 0.75rem 0.5rem;
min-height: 52px;
}
.vote-easy {
border-color: #16a34a;
color: #16a34a;
}
.vote-ok {
border-color: #ca8a04;
color: #ca8a04;
}
.vote-hard {
border-color: #ea580c;
color: #ea580c;
}
.vote-none {
border-color: #dc2626;
color: #dc2626;
}
@media (prefers-color-scheme: dark) {
.vote-easy { color: #4ade80; border-color: #4ade80; }
.vote-ok { color: #facc15; border-color: #facc15; }
.vote-hard { color: #fb923c; border-color: #fb923c; }
.vote-none { color: #f87171; border-color: #f87171; }
}