/* =========================================
   day_of_year_calculator.css
   今天是今年的第几天 - 专属样式
   ========================================= */

.dyc-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---- 错误提示 ---- */
.dyc-alert {
    background: #fff3f3;
    border: 1px solid #ffb3b3;
    color: #c0392b;
    padding: 10px 14px 10px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: opacity 0.3s;
}

.dyc-alert-fadeout {
    opacity: 0;
    pointer-events: none;
}

.dyc-alert-close {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.55;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.dyc-alert-close:hover {
    opacity: 1;
}

/* ---- 工具类 ---- */
.dyc-hidden {
    display: none;
}

/* ---- 日期输入行 ---- */
.dyc-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dyc-input-label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    font-weight: 500;
}

.dyc-date-input {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
    padding: 10px 14px;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.dyc-date-input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.dyc-btn-today {
    padding: 10px 18px;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s, color 0.18s;
    white-space: nowrap;
}

.dyc-btn-today:hover {
    background: #f0f6ff;
    border-color: #4a90d9;
    color: #4a90d9;
}

.dyc-btn-calc {
    padding: 10px 24px !important;
    white-space: nowrap;
}

/* ====================================
   主结果卡片
   ==================================== */
.dyc-main-card {
    background: linear-gradient(135deg, #4a90d9 0%, #3578c5 60%, #2460a8 100%);
    border-radius: 18px;
    padding: 36px 32px 28px;
    text-align: center;
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 8px 32px rgba(52, 120, 210, 0.28);
    position: relative;
    overflow: hidden;
}

/* 装饰圆圈 */
.dyc-main-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.dyc-main-card::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

/* 日期信息顶部行 */
.dyc-main-topline {
    font-size: 15px;
    margin-bottom: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.dyc-today-badge {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.55);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dyc-sep {
    opacity: 0.5;
}

/* 大数字行 */
.dyc-number-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.dyc-prefix {
    font-size: 30px;
    font-weight: 400;
    opacity: 0.85;
    padding-bottom: 6px;
}

.dyc-big-num {
    font-size: 100px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -3px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: opacity 0.18s;
}

.dyc-big-num:hover {
    opacity: 0.78;
}

/* 大数字弹跳动画 */
@keyframes dyc-num-pop {
    0%   { transform: scale(0.86); opacity: 0.5;  }
    55%  { transform: scale(1.07); opacity: 1;    }
    100% { transform: scale(1);   opacity: 1;    }
}

.dyc-num-animate {
    animation: dyc-num-pop 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dyc-suffix {
    font-size: 30px;
    font-weight: 400;
    opacity: 0.85;
    padding-bottom: 6px;
}

/* 年份信息底部行 */
.dyc-main-subline {
    font-size: 14px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.dyc-year-type-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.dyc-year-type-badge.dyc-leap {
    background: rgba(255, 220, 80, 0.3);
    border: 1px solid rgba(255, 220, 80, 0.65);
}

.dyc-year-type-badge.dyc-normal {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ====================================
   统计卡片网格
   ==================================== */
.dyc-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

/* ---- 统计卡片可点击复制 ---- */
.dyc-copyable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* 顶部蓝色强调条，使用 transform 动画以符合规范 */
.dyc-copyable::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90d9, #56c2e6);
    transform: translateY(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dyc-copyable:hover::before {
    transform: translateY(0);
}

.dyc-copyable:hover .dyc-stat-value {
    color: #4a90d9;
}

.dyc-stat-card {
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    padding: 18px 12px 16px;
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dyc-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.dyc-stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
    line-height: 1;
}

.dyc-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a2a4a;
    margin-bottom: 6px;
    line-height: 1.2;
    transition: color 0.18s;  /* 放在基础状态确保鼠标离开时也有过渡 */
}

.dyc-stat-desc {
    font-size: 11px;
    color: #9aa3b0;
    line-height: 1.3;
}

/* ====================================
   年度进度条
   ==================================== */
.dyc-progress-section {
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    padding: 20px 24px 18px;
    margin-bottom: 14px;
}

.dyc-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.dyc-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.dyc-progress-meta {
    font-size: 13px;
    color: #666;
}

.dyc-progress-track {
    position: relative;
    height: 14px;
    background: #eef1f6;
    border-radius: 7px;
    overflow: visible;
    margin-bottom: 10px;
}

.dyc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9 0%, #56c2e6 100%);
    border-radius: 7px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 6px;
    position: relative;
}

/* 进度条末端光点 */
.dyc-progress-fill::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px #4a90d9;
}

/* 季度标记线 */
.dyc-q-mark {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 2;
}

/* 季度标记线位置（用 CSS 类替代内联样式） */
.dyc-q1 { left: 25%; }
.dyc-q2 { left: 50%; }
.dyc-q3 { left: 75%; }

.dyc-progress-ruler {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #b0bac8;
}

/* ====================================
   底部操作行
   ==================================== */
.dyc-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 2px;
}

.dyc-hint {
    font-size: 12px;
    color: #aab0bb;
}

.dyc-hint kbd {
    background: #f0f3f7;
    border: 1px solid #d8dce5;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    color: #666;
    font-family: inherit;
}

.dyc-copy-btn {
    padding: 8px 18px;
    background: #fff;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s, color 0.18s;
}

.dyc-copy-btn:hover {
    background: #f0f6ff;
    border-color: #4a90d9;
    color: #4a90d9;
}

/* ====================================
   Toast 提示
   ==================================== */
.dyc-toast {
    position: fixed;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 30, 50, 0.82);
    color: #fff;
    padding: 10px 26px;
    border-radius: 24px;
    font-size: 14px;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.25s, transform 0.25s;
    white-space: nowrap;
}

.dyc-toast-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
}

.dyc-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ====================================
   响应式适配
   ==================================== */
@media (max-width: 640px) {
    .dyc-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dyc-big-num {
        font-size: 76px;
        letter-spacing: -2px;
    }

    .dyc-prefix,
    .dyc-suffix {
        font-size: 24px;
    }

    .dyc-main-card {
        padding: 28px 20px 22px;
    }

    .dyc-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .dyc-action-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dyc-input-row {
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .dyc-big-num {
        font-size: 64px;
    }

    .dyc-main-card {
        padding: 22px 16px 18px;
    }

    .dyc-stat-value {
        font-size: 17px;
    }
}
