/* 精英金融日历专属样式 */
body.calendar-page {
    overflow-y: auto !important; /* 强制允许滚动 */
    height: auto !important;
    touch-action: manipulation !important;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

.calendar-page .app-container {
    height: auto !important;
    min-height: 100vh;
    padding-bottom: 80px;
}

.calendar-page {
    background: var(--bg-main);
    background-attachment: fixed;
}

body.light-theme.calendar-page {
    background: radial-gradient(circle at 50% -20%, #ffffff, #f8fafc);
}

body:not(.light-theme).calendar-page {
    background: radial-gradient(circle at 50% -20%, #1a1c2c, #0d0e17);
}

.calendar-page header {
    padding-top: 5vh;
    padding-bottom: 5vh;
    text-align: center;
}

.back-nav {
    margin-bottom: 20px;
}

.back-link {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--text-main);
}

.calendar-page h1 {
    font-size: 38px;
    letter-spacing: 3px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-sub) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-sync-panel {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sync-config {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

.config-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line-color);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.config-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(195, 163, 74, 0.2);
}

.year-auto-detect {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.year-auto-detect .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.year-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    color: var(--gold);
    font-weight: 700;
}

.sync-actions {
    display: flex;
    gap: 15px;
}

.sync-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-scaffold);
    color: var(--text-main);
    letter-spacing: 1px;
}

.sync-btn.prompt {
    background: rgba(195, 163, 74, 0.1);
    border-color: rgba(195, 163, 74, 0.3);
    color: #c3a34a;
}

.sync-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.sync-btn.success {
    background: rgba(0, 255, 170, 0.2) !important;
    border-color: rgba(0, 255, 170, 0.4) !important;
    color: #00ffaa !important;
}

/* Modal 样式 */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-main);
    border: 1px solid var(--line-color);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.modal-content h3 { margin-bottom: 10px; color: var(--text-main); }
.modal-content p { color: var(--text-sub); font-size: 13px; margin-bottom: 20px; }

textarea {
    width: 100%;
    height: 200px;
    background: #0d0e12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #00ffaa;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 15px;
    margin-bottom: 20px;
    resize: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

#cancel-import { background: transparent; color: rgba(255,255,255,0.4); }
#confirm-import.primary { background: #c3a34a; color: #000; font-weight: 700; }
#confirm-import.primary:hover { background: #e2bd5b; }

.calendar-grid {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 6vw;
}

.holiday-card {
    display: flex;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--line-color);
    transition: all 0.3s ease;
    background: transparent;
    border-radius: 0;
}

.holiday-card:last-child {
    border-bottom: none;
}

.holiday-card:hover {
    transform: translateX(10px);
}

.card-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-right: 40px;
    min-width: 100px;
}

.card-date .month {
    font-size: 12px;
    color: var(--text-sub);
    text-transform: uppercase;
}

.card-date .day {
    font-size: 32px;
    font-weight: 200;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.card-date .week {
    font-size: 11px;
    color: var(--text-sub);
}

.card-info {
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-info h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-main);
}

.meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.markets-tag {
    font-size: 10px;
    color: var(--text-sub);
    background: var(--bg-scaffold);
    padding: 2px 8px;
    border-radius: 4px;
}

.impact-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Impact 影响度标识（点状点缀） */
.card-info {
    position: relative;
}

/* 状态指标点（位于日期与内容之间） */
.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 40px;
    flex-shrink: 0;
    filter: blur(0.5px);
}

.impact-critical .status-indicator { background: #ef4444; box-shadow: 0 0 15px #ef4444; }
.impact-high .status-indicator { background: #eab308; box-shadow: 0 0 15px #eab308; }
.impact-medium .status-indicator { background: #3b82f6; box-shadow: 0 0 15px #3b82f6; }

.impact-critical .impact-tag { color: #ef4444; background: transparent; }
.impact-high .impact-tag { color: #eab308; background: transparent; }
.impact-medium .impact-tag { color: #3b82f6; background: transparent; }

footer {
    padding: 60px 4vw;
    text-align: center;
}

.calendar-footer {
    margin-top: 80px;
    padding: 40px 4vw;
    border-top: 1px solid var(--line-color);
}

/* 垂直对齐的详细图鉴 */
.detailed-legend {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 300;
}

.l-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.red .l-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.yellow .l-dot { background: #eab308; box-shadow: 0 0 8px #eab308; }
.blue .l-dot { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }

/* 高亮工作日（周一至周四）字体 */
.is-workday .month,
.is-workday .week,
.is-workday .markets-tag {
    color: var(--text-main) !important;
    opacity: 1;
}

.is-workday .impact-tag {
    opacity: 1;
}

.sync-note {
    font-size: 11px;
    color: var(--text-sub);
    opacity: 0.4;
    letter-spacing: 2px;
    font-weight: 300;
}
