/* 重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局缩放 - 默认80% */
html {
    font-size: 14px;
    zoom: 0.8;
}

/* 黄金比例优化 - Linus式设计 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 12px;
    font-size: 1rem;
}

.container {
    max-width: 1180px;  /* 黄金比例：1920 ÷ 1.618 ≈ 1180px */
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: -420px;
    top: 0;
    bottom: 0;
    width: 420px;
    background: #ffffff;
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.sidebar-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.tab-btn {
    padding: 8px 14px;
    border: none;
    background: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #7c3aed;
    border-color: #c4b5fd;
}

.tab-btn.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    padding-bottom: 60px;
    background: #f8fafc;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.sidebar-content::-webkit-scrollbar {
    display: none;  /* Chrome/Safari/Opera */
}

.sidebar-item {
    padding: 16px;
    margin-bottom: 12px;
    background: #ffffff;
    border-radius: 14px;
    border-left: 4px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left-color: #7c3aed;
}

.sidebar-item.registered {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.sidebar-item.can-register {
    border-left-color: #10b981;
}

.sidebar-item.ongoing {
    border-left-color: #f59e0b;
}

.sidebar-item.ended {
    opacity: 0.6;
    background: #f1f5f9;
    border-left-color: #94a3b8;
}

.sidebar-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.4;
}

.sidebar-item-info {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* 左侧操作按钮组 */
.action-buttons {
    position: fixed;
    left: 20px;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.action-btn {
    width: 60px;
    height: 60px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102,126,234,0.5);
    transition: all 0.3s;
}

.action-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 35px rgba(102,126,234,0.6);
}

/* 用户信息 */
.user-info {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 999;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102,126,234,0.5);
    transition: all 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-avatar:hover + .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown {
    position: absolute;
    top: 70px;
    right: 0;
    background: white;
    border-radius: 16px;
    padding: 20px;
    min-width: 200px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.user-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.user-role {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 8px;
    display: inline-block;
}

.logout-btn {
    width: 100%;
    padding: 10px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* 类型选择器（多选） */
.type-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px 30px;
    background: rgba(255,255,255,0.9);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.type-label {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

.type-buttons {
    display: flex;
    gap: 10px;
}

.type-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.type-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102,126,234,0.2);
}

.type-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.type-btn-all {
    padding: 12px 24px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(72,187,120,0.3);
}

.type-btn-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72,187,120,0.5);
}

.type-btn-ended {
    padding: 12px 24px;
    background: linear-gradient(135deg, #a0aec0, #718096);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(113,128,150,0.3);
    margin-left: 8px;
}

.type-btn-ended:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(113,128,150,0.5);
}

.type-btn-ended.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

/* 头部 - 黄金比例 */
.header {
    text-align: center;
    margin-bottom: 18px;  /* 黄金比例：30 ÷ 1.618 ≈ 18px */
    background: rgba(255,255,255,0.98);
    padding: 25px 30px;  /* 黄金比例：40 ÷ 1.618 ≈ 25px */
    border-radius: 20px;  /* 黄金比例：32 ÷ 1.618 ≈ 20px */
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 36px;  /* 黄金比例：58 ÷ 1.618 ≈ 36px */
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;  /* 黄金比例：13 ÷ 1.618 ≈ 8px */
    font-weight: 800;
}

.subtitle {
    color: #6b7280;
    font-size: 15px;
    margin: 10px 0 15px 0;
}

.type-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.type-btn {
    padding: 10px 24px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.type-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat-box {
    padding: 15px 25px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 90px;
}

.stat-box.can-register {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.stat-box.ongoing {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
}

.stat-box.registered {
    background: linear-gradient(135deg, #bfdbfe, #93c5fd);
}

.stat-box.ended {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.stat-num {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

/* 月份导航 - 黄金比例 */
.month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;  /* 黄金比例：50 ÷ 1.618 ≈ 30px */
    margin-bottom: 18px;  /* 黄金比例：30 ÷ 1.618 ≈ 18px */
}

.nav-btn {
    width: 46px;  /* 黄金比例：75 ÷ 1.618 ≈ 46px */
    height: 46px;
    border: none;
    background: white;
    border-radius: 50%;
    font-size: 24px;  /* 黄金比例：39 ÷ 1.618 ≈ 24px */
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s;
    color: #667eea;
    font-weight: bold;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.1);  /* 黄金比例倍数 */
}

.month-title {
    font-size: 28px;  /* 黄金比例：45 ÷ 1.618 ≈ 28px */
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    min-width: 180px;  /* 黄金比例：290 ÷ 1.618 ≈ 180px */
    text-align: center;
}

/* 日历 - 黄金比例 */
.calendar-wrapper {
    background: rgba(255,255,255,0.98);
    border-radius: 20px;  /* 黄金比例：32 ÷ 1.618 ≈ 20px */
    padding: 25px;  /* 黄金比例：40 ÷ 1.618 ≈ 25px */
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;  /* 黄金比例：16 ÷ 1.618 ≈ 10px */
    margin-bottom: 15px;  /* 黄金比例：24 ÷ 1.618 ≈ 15px */
}

.weekday {
    text-align: center;
    font-weight: 800;
    color: #667eea;
    padding: 8px 0;  /* 黄金比例：13 ÷ 1.618 ≈ 8px */
    font-size: 13px;  /* 黄金比例：21 ÷ 1.618 ≈ 13px */
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;  /* 黄金比例间距 */
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid #e5e7eb;
    border-radius: 12px;  /* 黄金比例：20 ÷ 1.618 ≈ 12px */
    padding: 10px 8px;  /* 黄金比例：16 ÷ 1.618 ≈ 10px */
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 120px;
}

/* 日历格子背景 - 保持白色，不要变色！*/
/* 颜色只在图标背景上显示（通过JS动态设置）*/

.calendar-day:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(102,126,234,0.3);
    z-index: 10;
}

.calendar-day.other-month {
    opacity: 0.3;
}

/* 今天 - 蓝色背景标识（保留） */
.calendar-day.today {
    border-color: #667eea;
    border-width: 4px;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(102,126,234,0.25); }
    50% { box-shadow: 0 8px 35px rgba(102,126,234,0.45); }
}

/* 移除所有日历格子的彩色背景，统一使用白色 */
/* 状态通过图标背景色体现，不用格子背景色 */

.day-number {
    font-size: 22px;  /* 黄金比例：36 ÷ 1.618 ≈ 22px */
    font-weight: 800;
    z-index: 1;
    color: #1f2937;
    margin-bottom: 6px;  /* 黄金比例：10 ÷ 1.618 ≈ 6px */
    line-height: 1;
}

.day-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    flex: 1;
    justify-content: center;
}

.day-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    color: white;
}

.badge-register { background: #10b981; }
.badge-ongoing { background: #ef4444; }
.badge-warn { background: #f59e0b; }
.badge-ended { background: #9ca3af; }

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 28px;
    max-width: 600px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0,0,0,0.4);
    animation: slideUp 0.3s;
    position: relative;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-back {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-back:hover {
    background: #f3f4f6;
    border-color: #667eea;
    transform: translateX(-5px);
}

.modal-back-arrow {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.modal-back-arrow:hover {
    transform: translateX(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.modal-subtitle {
    color: #6b7280;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.modal-section {
    margin-bottom: 18px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 4px solid #667eea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 600;
}

.info-value {
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.modal-back-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-back-btn:hover {
    background: rgba(0,0,0,0.1);
    transform: translateX(-2px);
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transition: all 0.3s;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.modal-btn.signup {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    transition: all 0.3s;
}

.modal-btn.signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.modal-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.5);
}

.modal-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.modal-btn.success:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16,185,129,0.5);
}

.modal-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.modal-btn.danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(239,68,68,0.5);
}

/* 今天按钮 */
.today-btn {
    padding: 12px 24px;
    border: 2px solid white;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.today-btn:hover {
    background: white;
    color: #667eea;
    transform: scale(1.05);
}

/* 全部比赛模态框 */
.all-comp-modal {
    max-width: 1000px;
}

.all-comp-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.all-comp-filters input,
.all-comp-filters select {
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.all-comp-filters input {
    flex: 1;
}

.all-comp-filters input:focus,
.all-comp-filters select:focus {
    outline: none;
    border-color: #667eea;
}

.all-comp-list {
    display: grid;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 编辑器 */
.editor-modal {
    max-width: 900px;
}

.editor-modal h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 25px;
}

.editor-form textarea {
    width: 100%;
    height: 400px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

.editor-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.5);
}

.btn-secondary {
    background: #f3f4f6;
    color: #667eea;
}

.editor-help {
    margin-top: 20px;
    padding: 15px;
    background: #eff6ff;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    font-size: 13px;
    color: #374151;
}

.editor-help ul {
    margin-top: 10px;
    margin-left: 20px;
}

.editor-help code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    color: #667eea;
    font-weight: 700;
}

/* 比赛列表网格（多个比赛选择） */
.comp-list-grid {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.comp-list-item {
    padding: 20px;
    background: linear-gradient(135deg, #f9fafb, #ffffff);
    border-radius: 16px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comp-list-item:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.25);
    background: white;
}

.comp-list-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.comp-list-info {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    gap: 10px;
}

/* 日历样式保留之前的，添加新状态 */
.calendar-wrapper {
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    margin-bottom: 35px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.weekday {
    text-align: center;
    font-weight: 800;
    color: #667eea;
    padding: 15px 0;
    font-size: 15px;
}

.weekday.weekend {
    color: #f59e0b;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        left: -100%;
        top: 0;
        bottom: 0;
    }
    
    .sidebar-content {
        padding-bottom: 60px;
    }
    
    .expand-btn, .edit-btn {
        width: 50px;
        height: 50px;
    }
    
    .edit-btn {
        top: 80px;
    }
    
    .modal-content {
        width: 95%;
        padding: 25px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 智能编辑模态框 - 全新设计 ==================== */
.smart-edit-modal {
    max-width: 900px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* 头部区域 */
.smart-edit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 35px 40px;
    text-align: center;
    color: white;
    position: relative;
}

.smart-edit-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.smart-edit-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    color: white;
}

.smart-edit-subtitle {
    font-size: 14px;
    opacity: 0.95;
    margin: 0;
}

/* 内容区域 */
.smart-edit-body {
    padding: 30px 40px;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}

/* 字段组 */
.smart-field {
    margin-bottom: 24px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.smart-field:hover {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.smart-field.highlight {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
}

/* 标签 */
.smart-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 700;
    color: #1f2937;
    font-size: 15px;
}

.label-icon {
    font-size: 20px;
}

.label-text {
    flex: 1;
}

.label-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.label-badge.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* 输入框组 */
.smart-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.smart-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.smart-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.smart-input::placeholder {
    color: #9ca3af;
}

.smart-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.smart-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.smart-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s;
    font-family: inherit;
}

.smart-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 解析按钮 */
.smart-parse-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.smart-parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.smart-parse-btn:active {
    transform: translateY(0);
}

/* 字段提示 */
.field-tip {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 13px;
    color: #1e40af;
}

/* 底部操作区 */
.smart-edit-footer {
    padding: 25px 40px;
    background: white;
    border-top: 2px solid #e5e7eb;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.smart-btn-cancel,
.smart-btn-save {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.smart-btn-save {
    width: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.smart-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* 响应式 */
@media (max-width: 768px) {
    .smart-edit-header {
        padding: 25px 20px;
    }
    
    .smart-edit-body {
        padding: 20px;
    }
    
    .smart-input-group {
        flex-direction: column;
    }
    
    .smart-parse-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 移除黄色背景，保持一致 */
.calendar-day.deadline-passed {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-color: #e5e7eb;
}


/* ==================== 响应式优化 - 手机端适配 ==================== */

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .calendar-day {
        min-height: 100px;
        padding: 8px 6px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .event-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* 手机端 (小于768px) */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    /* 头部 */
    .header {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 13px;
        margin: 8px 0 12px 0;
    }
    
    /* 类型选择器 */
    .type-selector {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        border-radius: 12px;
    }
    
    .type-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .type-btn, .type-btn-all, .type-btn-ended {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* 统计卡片 */
    .header-stats {
        gap: 8px;
        margin-top: 15px;
    }
    
    .stat-box {
        padding: 10px 15px;
        min-width: 70px;
        border-radius: 10px;
    }
    
    .stat-num {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    /* 月份导航 */
    .month-nav {
        gap: 15px;
        margin-bottom: 12px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .month-title {
        font-size: 20px;
        min-width: 140px;
    }
    
    /* 日历 */
    .calendar-wrapper {
        padding: 12px;
        border-radius: 12px;
    }
    
    .weekdays {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .weekday {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 6px 4px;
        border-radius: 8px;
        border-width: 1px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .event-icon {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .event-count {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    /* 操作按钮 */
    .action-buttons {
        left: 10px;
        top: 10px;
        gap: 8px;
    }
    
    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    /* 用户信息 */
    .user-info {
        right: 10px;
        top: 10px;
    }
    
    .user-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .user-dropdown {
        top: 55px;
        min-width: 160px;
        padding: 15px;
    }
    
    /* 侧边栏 */
    .sidebar {
        width: 100%;
        left: -100%;
        top: 0;
        bottom: 0;
    }
    
    .sidebar-header {
        padding: 16px 20px;
    }
    
    .sidebar-header h3 {
        font-size: 16px;
    }
    
    .sidebar-tabs {
        padding: 12px 16px;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .sidebar-content {
        padding: 12px 16px;
        padding-bottom: 60px;
        flex: 1;
    }
    
    .sidebar-item {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .sidebar-item-title {
        font-size: 13px;
    }
    
    .sidebar-item-info {
        font-size: 11px;
    }
    
    /* 模态框 */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 15px;
        border-radius: 12px;
        max-height: 90vh;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        right: 10px;
        top: 10px;
    }
    
    /* 联系我模态框 */
    #contactModal .modal-content {
        padding: 0;
    }
    
    #contactModal .modal-content > div:nth-child(2) {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    #contactModal .modal-content > div:nth-child(2) > div {
        padding: 12px;
    }
    
    #contactModal .modal-content > div:nth-child(2) > div > div {
        width: 150px !important;
        height: 150px !important;
    }
    
    /* 智能编辑模态框 */
    .smart-edit-modal {
        max-width: 100%;
        margin: 5px;
    }
    
    .smart-edit-header {
        padding: 20px 15px;
    }
    
    .smart-edit-icon {
        font-size: 36px;
    }
    
    .smart-edit-title {
        font-size: 20px;
    }
    
    .smart-edit-body {
        padding: 15px;
    }
    
    .smart-field {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* 信息网格 */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 超小屏幕 (小于480px) */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .header {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .type-btn, .type-btn-all, .type-btn-ended {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .stat-box {
        padding: 8px 10px;
        min-width: 60px;
    }
    
    .stat-num {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .month-title {
        font-size: 16px;
        min-width: 100px;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .calendar-day {
        min-height: 55px;
        padding: 4px 2px;
    }
    
    .day-number {
        font-size: 10px;
    }
    
    .event-icon {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .weekday {
        font-size: 10px;
    }
    
    .action-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .user-avatar {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .calendar-day {
        min-height: 60px;
    }
    
    .header {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .month-nav {
        margin-bottom: 8px;
    }
}


/* ==================== 三端适配优化 ==================== */

/* 平板横屏 (1024px - 1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    html {
        font-size: 13px;
    }
    
    .container {
        max-width: 95%;
    }
    
    .modal-content {
        max-width: 550px;
    }
}

/* 手机端弹窗优化 */
@media (max-width: 768px) {
    .modal-content {
        width: 94%;
        padding: 16px;
        border-radius: 14px;
        max-height: 88vh;
    }
    
    .modal-title {
        font-size: 1.2rem;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .modal-subtitle {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 0.95rem;
        padding-left: 8px;
        border-left-width: 3px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .info-label {
        font-size: 0.75rem;
    }
    
    .info-value {
        font-size: 0.9rem;
    }
    
    /* 弹窗按钮 */
    .modal-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 16px;
    }
    
    .modal-btn {
        padding: 12px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    /* 链接按钮 */
    .modal-section a[style*="padding"] {
        padding: 12px 16px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    
    /* 操作按钮组 */
    div[style*="display:flex"][style*="gap:8px"] {
        flex-wrap: wrap;
    }
    
    div[style*="display:flex"][style*="gap:8px"] button {
        flex: 1 1 45%;
        min-width: 120px;
        font-size: 0.8rem !important;
        padding: 10px 12px !important;
    }
}

/* 超小屏幕弹窗 */
@media (max-width: 480px) {
    .modal-content {
        width: 96%;
        padding: 12px;
        margin: 8px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-back-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* 日历格子 */
    .calendar-day {
        min-height: 50px;
    }
    
    .event-icons {
        gap: 2px;
    }
    
    .event-icon {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }
    
    /* 头部统计 */
    .header-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-box {
        flex: 0 0 auto;
    }
}

/* 防止内容溢出 */
.modal-content,
.calendar-wrapper {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* 侧边栏滚动条隐藏 - 强制覆盖 */
.sidebar-content {
    overflow-x: hidden;
    overflow-y: auto;
    word-wrap: break-word;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.sidebar-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .action-btn,
    .nav-btn,
    .type-btn,
    .modal-btn,
    .tab-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .calendar-day {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .calendar-day:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* iOS Safari 底部安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .modal-content {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 防止横屏时内容被刘海遮挡 */
@supports (padding-left: env(safe-area-inset-left)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ========== UI2 切换按钮提示箭头 ========== */
.ui2-btn-wrapper {
    position: relative;
    display: inline-block;
}

.ui2-tip-arrow {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 100;
}

.ui2-tip-arrow.show {
    display: block;
    animation: bounce 1s infinite;
}

.ui2-tip-arrow .tip-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.ui2-tip-arrow .tip-text {
    margin-bottom: 2px;
}

.ui2-tip-arrow .tip-arrow {
    font-size: 18px;
    line-height: 1;
    animation: arrowPulse 0.8s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes arrowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ========== UI2 切换按钮提示箭头 ========== */
.ui2-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ui2-tip-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 1000;
    pointer-events: none;
    margin-top: 8px;
}

.ui2-tip-arrow.show {
    display: block;
    animation: tipBounce 1.5s ease-in-out infinite;
}

.ui2-tip-arrow .tip-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.ui2-tip-arrow .tip-content::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #ef4444;
}

.ui2-tip-arrow .tip-arrow {
    display: none;
}

@keyframes tipBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}
