* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10B981;
    --secondary-dark: #059669;
    --danger: #EF4444;
    --warning: #F59E0B;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.2s ease;
}

.navbar:hover {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    position: relative;
    z-index: 200;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    min-height: 44px;
    min-width: 44px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    position: relative;
    z-index: 100;
}

.nav-menu-overlay {
    display: none;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn.disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-500);
    font-size: 1.2rem;
}

.today-section {
    margin-bottom: 3rem;
}

.today-section h2 {
    margin-bottom: 1rem;
}

.today-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.today-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.weekday-badge {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
}

.plan-duration {
    color: var(--gray-500);
}

.plan-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.plan-desc {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1.25rem;
    border: 2px dashed var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.empty-state:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    transition: opacity 0.25s ease;
}

.empty-state:hover .empty-icon {
    opacity: 0.8;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--gray-800);
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
}

.week-overview {
    margin-top: 2rem;
}

.week-overview h2 {
    margin-bottom: 1rem;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.day-card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.day-card.today {
    background: var(--primary);
    color: white;
}

.day-name {
    display: block;
    font-weight: 600;
}

.day-status {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.day-card.today .day-status {
    color: rgba(255,255,255,0.8);
}

.today-header {
    text-align: center;
    padding: 2rem 0;
}

.today-header h1 {
    font-size: 2rem;
}

.date {
    color: var(--gray-500);
}

.plan-overview {
    margin-bottom: 2rem;
}

.plan-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.plan-info h2 {
    margin-bottom: 0.5rem;
}

.plan-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-500);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-desc {
    color: var(--gray-500);
}

.exercises-preview {
    margin-bottom: 2rem;
}

.exercises-preview h3 {
    margin-bottom: 1rem;
}

.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exercise-item {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.exercise-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.exercise-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.exercise-type-icon {
    font-size: 1.1rem;
}

.exercise-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exercise-detail {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-align: right;
}

.exercise-index {
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.exercise-arrow {
    color: var(--gray-400);
    transition: transform 0.2s;
}

.exercise-item.expanded .exercise-arrow {
    transform: rotate(180deg);
}

.exercise-details {
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--gray-100);
}

.exercise-item.expanded .exercise-details {
    display: block;
}

.detail-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-50);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.detail-row p {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.detail-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.detail-row.caution {
    background: rgba(255, 193, 7, 0.08);
    margin: 0 -1rem;
    padding: 0.5rem 1rem;
    border-bottom: none;
}

.detail-row.caution strong {
    color: #f59e0b;
}

.detail-row {
    padding: 0.5rem 0;
    color: var(--gray-700);
}

.detail-row.caution {
    color: var(--danger);
}

.cautions {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.cautions h3 {
    color: var(--danger);
    margin-bottom: 1rem;
}

.caution-item {
    padding: 0.5rem 0;
    color: var(--gray-700);
}

.start-section {
    margin-top: 2rem;
}

.week-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.day-plan-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
}

.day-plan-card.rest-day {
    background: var(--gray-100);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.plan-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
}

.rest-text {
    color: var(--gray-500);
    text-align: center;
    padding: 1rem;
}

.exercises-details {
    margin-top: 1rem;
}

.exercises-details summary {
    cursor: pointer;
    color: var(--primary);
}

.exercise-list-compact {
    list-style: none;
    margin-top: 0.5rem;
}

.exercise-list-compact li {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.ex-detail {
    color: var(--gray-500);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
}

.history-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-status {
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.status-done {
    background: var(--secondary);
}

.history-stats {
    display: flex;
    gap: 1rem;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--gray-400);
    padding: 2.5rem 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
    display: block !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.footer-brand {
    display: inline-block;
    margin-bottom: 1rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.05em;
}

.brand-version {
    background: rgba(79, 70, 229, 0.2);
    color: var(--primary);
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.75rem;
}

.footer-info {
    margin-bottom: 1rem;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0 0 0.25rem 0;
}

.footer-desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    display: inline-block;
    margin: 0 1rem;
}

.footer-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.footer-link:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.plans-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem 0 !important;
}

.plan-item {
    background: white !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    margin-bottom: 1rem !important;
    border: 1px solid var(--gray-100) !important;
}

.plan-item.disabled {
    opacity: 0.6;
    background: var(--gray-100);
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.weekday-badge {
    background: var(--primary);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.plan-type-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.plan-duration {
    font-size: 0.9rem;
    color: var(--gray-500);
    flex-shrink: 0;
}

.plan-status {
    margin-left: auto;
    flex-shrink: 0;
}

.status-active {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
}

.status-disabled {
    background: var(--gray-300);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
}

.plan-body {
    margin-bottom: 1rem;
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.plan-desc {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.plan-exercises-count {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exercise-item {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.exercise-body {
    margin-top: 0.5rem;
}

.exercise-info {
    padding: 0.5rem 0;
    color: var(--gray-700);
}

.exercise-info.caution {
    color: var(--danger);
}

.exercise-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.exercise-type-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.exercise-rest {
    color: var(--gray-500);
}

.summary-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.summary-section h3 {
    margin-bottom: 1rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.summary-item {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-label {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.modal-large {
    max-width: 700px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    flex: 1;
}

.items-list,
.types-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.measurement-item,
.posture-type {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.measurement-item.disabled,
.posture-type.disabled {
    opacity: 0.6;
    background: var(--gray-100);
}

.item-header,
.type-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.item-index,
.type-index {
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.item-name,
.type-name {
    font-weight: 600;
    flex: 1;
}

.item-unit {
    color: var(--gray-500);
}

.item-frequency-badge,
.item-type-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.type-count {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.item-status,
.type-status {
    margin-left: auto;
}

.item-actions,
.type-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.type-body {
    margin-top: 0.5rem;
}

.type-desc {
    color: var(--gray-700);
}

.help-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.help-section h3 {
    margin-bottom: 1rem;
}

.help-section h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.help-section ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.help-section li {
    padding: 0.25rem 0;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-nav-item {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.2s;
}

.admin-nav-item:hover {
    background: var(--primary);
    color: white;
}

.admin-nav-item.active {
    background: var(--primary);
    color: white;
}

.training-type-item {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.training-type-item.disabled {
    opacity: 0.6;
    background: var(--gray-100);
}

.type-color {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: inline-block;
}

.type-code {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker input[type="color"] {
    width: 3rem;
    height: 3rem;
    border: none;
    cursor: pointer;
}

.color-preview {
    font-family: monospace;
    color: var(--gray-700);
}

.form-hint {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.current-user-info {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-label {
    color: var(--gray-500);
}

.current-name {
    font-weight: 600;
    color: var(--primary);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-item {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.user-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.current-badge {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}

.user-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.detail-value {
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hint {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 1rem;
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .navbar {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        z-index: 100;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .main-content,
    .container {
        padding-top: 5rem;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        max-width: 85%;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        padding-top: 5rem;
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
        gap: 0.25rem;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .nav-menu.mobile-active {
        left: 0;
    }

    .nav-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        transition: opacity 0.3s ease;
    }

    .nav-menu-overlay.active {
        display: block;
    }

    .nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #4F46E5 !important;
        border: 2px solid #4F46E5 !important;
        color: white !important;
        font-size: 1.5rem !important;
        cursor: pointer !important;
        padding: 0.75rem 1rem !important;
        border-radius: 0.5rem !important;
        min-height: 48px !important;
        min-width: 48px !important;
        transition: all 0.2s !important;
        position: relative !important;
        z-index: 200 !important;
        box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3) !important;
    }

    .nav-toggle:hover {
        background: var(--primary-dark);
    }

    .nav-link {
        display: flex;
        align-items: center;
        padding: 0.875rem 1rem;
        color: var(--gray-700);
        text-decoration: none;
        font-weight: 500;
        border-radius: 0.5rem;
        transition: background 0.2s;
        margin-bottom: 0.25rem;
        line-height: 1.4;
    }

    .nav-link:hover {
        background: var(--gray-50);
        color: var(--primary);
    }

    .nav-brand {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header .btn {
        width: 100%;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }

    .day-plan-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .week-plans {
        grid-template-columns: 1fr;
    }

    .plan-item {
        padding: 1rem;
        border-radius: 0.5rem;
        background: white;
        margin-bottom: 1rem;
    }

    .plan-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .weekday-badge {
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
        background: var(--primary);
        color: white;
        border-radius: 0.25rem;
        flex-shrink: 0;
    }

    .plan-type-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        background: var(--gray-200);
        color: var(--gray-700);
        border-radius: 0.25rem;
        flex-shrink: 0;
    }

    .plan-duration {
        font-size: 0.85rem;
        color: var(--gray-500);
        flex-basis: 100%;
        padding-top: 0.25rem;
        border-top: 1px solid var(--gray-100);
        margin-top: 0.25rem;
    }

    .plan-status {
        margin-left: auto;
    }

    .status-active {
        background: var(--secondary);
        color: white;
        padding: 0.2rem 0.6rem;
        border-radius: 0.25rem;
        font-size: 0.75rem;
    }

    .status-disabled {
        background: var(--gray-300);
        color: var(--gray-700);
        padding: 0.2rem 0.6rem;
        border-radius: 0.25rem;
        font-size: 0.75rem;
    }

    .plan-body {
        margin-bottom: 0.75rem;
    }

    .plan-name {
        font-size: 1.15rem;
        font-weight: 600;
        margin-bottom: 0.35rem;
        color: var(--gray-800);
    }

    .plan-desc {
        font-size: 0.9rem;
        color: var(--gray-500);
        margin-bottom: 0.25rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .plan-exercises-count {
        font-size: 0.85rem;
        color: var(--gray-400);
    }

    .plan-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--gray-100);
    }

    .plan-actions .btn {
        min-height: 44px;
        padding: 0.65rem 0.5rem;
        font-size: 0.8rem;
        text-align: center;
        justify-content: center;
        border-radius: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .plan-actions .btn-outline {
        grid-column: span 2;
        background: var(--primary);
        color: white;
        border: none;
    }

    .exercises-details {
        margin-top: 0.75rem;
    }

    .exercise-list-compact li {
        flex-direction: column;
        gap: 0.25rem;
    }

    .day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .plan-card {
        padding: 1rem;
    }

    .plan-card h3 {
        font-size: 1rem;
    }

    .training-type-item {
        padding: 0.75rem;
    }

    .type-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .type-index {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    .type-color {
        width: 1.5rem;
        height: 1.5rem;
    }

    .type-actions {
        flex-wrap: wrap;
    }

    .type-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        padding: 1.25rem;
        margin: 0;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 1rem 1rem 0 0;
        max-width: 100%;
        width: 100%;
    }

    .modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .modal-close {
        width: 2rem;
        height: 2rem;
        border: none;
        background: var(--gray-100);
        border-radius: 50%;
        font-size: 1.25rem;
        cursor: pointer;
        color: var(--gray-600);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .modal-close:hover {
        background: var(--gray-200);
        color: var(--gray-900);
    }

    .user-card {
        padding: 1rem;
    }

    .user-avatar {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .user-info h3 {
        font-size: 1rem;
    }

    .user-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .footer-link {
        font-size: 0.8125rem;
    }

    .today-plan {
        padding: 1rem;
    }

    .today-plan h2 {
        font-size: 1.25rem;
    }

    .today-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .plan-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .exercises-preview h3 {
        font-size: 1rem;
    }

    .exercise-list {
        padding: 0.5rem;
    }

    .exercise-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .exercise-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .exercise-left {
        width: 100%;
        justify-content: flex-start;
    }

    .exercise-right {
        width: 100%;
        justify-content: space-between;
        padding-top: 0.25rem;
        border-top: 1px solid var(--gray-100);
    }

    .exercise-name {
        font-size: 1rem;
        font-weight: 600;
    }

    .exercise-detail {
        font-size: 0.85rem;
        color: var(--gray-500);
    }

    .exercise-index {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85rem;
    }

    .exercise-type-icon {
        font-size: 1rem;
    }

    .detail-row {
        gap: 0.5rem;
        padding: 0.4rem 0;
    }

    .detail-icon {
        font-size: 1.1rem;
    }

    .detail-row strong {
        font-size: 0.75rem;
    }

    .detail-row p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .timer-display {
        font-size: 3rem;
    }

    .timer-controls {
        flex-wrap: wrap;
    }

    .timer-controls .btn {
        flex: 1;
        min-width: 100px;
    }

    .history-list {
        padding: 0.5rem;
    }

    .history-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .color-picker {
        flex-wrap: wrap;
    }

    .color-picker input[type="color"] {
        width: 2.5rem;
        height: 2.5rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state p {
        font-size: 0.95rem;
    }

/* 历史页面优化 */
.history-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-calendar {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.calendar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav button {
    background: var(--gray-100);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.calendar-nav button:hover {
    background: var(--primary);
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    padding: 0.5rem 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: var(--gray-50);
}

.calendar-day:hover {
    background: var(--gray-100);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
}

.calendar-day.has-training {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
}

.calendar-day.has-training:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.calendar-day.has-cycling {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.calendar-day.has-cycling:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.calendar-day.has-both {
    background: linear-gradient(135deg, var(--primary) 50%, #10b981 50%);
    color: white;
}

.calendar-day.today {
    border: 2px solid var(--primary);
    font-weight: 700;
}

.calendar-day .day-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
    background: rgba(255,255,255,0.7);
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 0.25rem;
}

.legend-dot.training {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
}

.legend-dot.cycling {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.history-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.history-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--gray-100);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.history-tab.active {
    background: var(--primary);
    color: white;
}

.history-list-new {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item-new {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
}

.history-item-new:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.history-item-date {
    display: flex;
    flex-direction: column;
}

.history-item-date .date-main {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
}

.history-item-date .date-week {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.history-item-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.history-item-badge.completed {
    background: #dcfce7;
    color: #166534;
}

.history-item-badge.in-progress {
    background: #fef3c7;
    color: #92400e;
}

.history-item-title {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.history-item-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.history-stat-icon {
    font-size: 0.9rem;
}

.history-item-notes {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.cycling-summary-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem;
    border-radius: 1rem;
    text-align: center;
}

.summary-item .summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.summary-item .summary-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.cycling-item {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
}

.cycling-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cycling-item-date {
    display: flex;
    flex-direction: column;
}

.cycling-item-distance {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
}

.cycling-item-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.cycling-item-details {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cycling-detail {
    font-size: 0.85rem;
    color: var(--gray-600);
}

@media (max-width: 768px) {
    .history-calendar {
        padding: 1rem;
    }

    .calendar-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .calendar-day {
        font-size: 0.8rem;
        border-radius: 0.5rem;
    }

    .cycling-summary-new {
        grid-template-columns: 1fr;
    }

    .history-item-stats {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .nav-toggle {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .type-actions .btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .user-details {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 0.75rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .timer-display {
        font-size: 2.5rem;
    }
}
