/* ============================================================
   倒计时备忘 countdown.s1.css
   橙色渐变主题 + 玻璃拟态，移动端自适应
   类前缀 .cd-，主题渐变 linear-gradient(135deg,#f59e0b,#f97316)
   ============================================================ */

.cd-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.96), rgba(255,247,237,0.92));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.10);
    padding: 22px;
    position: relative;
    overflow: hidden;
}
.cd-card::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(249,115,22,0.10), transparent 70%);
    pointer-events: none;
}
.cd-card::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(245,158,11,0.08), transparent 70%);
    pointer-events: none;
}
.cd-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
    animation: cd-breath 3s ease-in-out infinite;
}
@keyframes cd-breath {
    0%, 100% { box-shadow: 0 6px 18px rgba(245,158,11,0.35); }
    50% { box-shadow: 0 6px 26px rgba(249,115,22,0.55); }
}

/* ---------- 登录引导 ---------- */
.cd-login-guide { text-align: center; padding: 34px 16px 26px; position: relative; z-index: 1; }
.cd-login-guide i { font-size: 40px; background: linear-gradient(135deg,#f59e0b,#f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-login-guide h3 { margin: 12px 0 6px; font-size: 1.05rem; color: #1e293b; }
.cd-login-guide p { margin: 0 0 18px; font-size: 0.85rem; color: #64748b; }
.cd-login-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cd-login-btns a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 26px; border-radius: 999px; text-decoration: none;
    font-size: 0.9rem; font-weight: 600; transition: all .25s ease;
}
.cd-login-btns a.main { background: linear-gradient(135deg,#f59e0b,#f97316); color: #fff; box-shadow: 0 6px 16px rgba(245,158,11,0.35); }
.cd-login-btns a.main:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(249,115,22,0.45); }
.cd-login-btns a.ghost { border: 1.5px solid rgba(245,158,11,0.45); color: #c2410c; background: rgba(255,255,255,0.7); }
.cd-login-btns a.ghost:hover { background: rgba(245,158,11,0.08); }

/* ---------- Tabs ---------- */
.cd-tabs {
    display: flex; gap: 5px; margin: 6px 0 16px;
    background: rgba(255,237,213,0.55); border: 1px solid rgba(245,158,11,0.28);
    padding: 5px; border-radius: 14px;
    position: relative; z-index: 1;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tab {
    flex: 1 0 auto; border: none; background: transparent; cursor: pointer;
    padding: 9px 12px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
    color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    transition: all .22s ease; white-space: nowrap;
}
.cd-tab i { font-size: 0.8rem; }
.cd-tab:hover { color: #c2410c; }
.cd-tab.active {
    background: linear-gradient(135deg,#f59e0b,#f97316); color: #fff;
    box-shadow: 0 4px 14px rgba(245,158,11,0.35);
}

/* ---------- 汇总卡 ---------- */
.cd-summary-card {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border-radius: 16px; padding: 18px 20px;
    border: 1px solid rgba(245,158,11,0.4);
    box-shadow: 0 6px 20px rgba(245,158,11,0.10);
    margin-bottom: 16px;
    flex-wrap: wrap;
    position: relative; z-index: 1;
}
.cd-summary-main { flex: 1; min-width: 0; }
.cd-summary-label { font-size: 0.78rem; color: #92400e; font-weight: 600; letter-spacing: 0.5px; }
.cd-summary-title { font-size: 1.5rem; font-weight: 700; color: #7c2d12; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-summary-sub { font-size: 0.82rem; color: #92400e; }
.cd-summary-side { display: flex; flex-direction: column; gap: 6px; }
.cd-summary-side-item { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; color: #7c2d12; font-weight: 500; }
.cd-sum-ico { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,0.5); display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; }

/* ---------- 表单 ---------- */
.cd-form-card {
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(245,158,11,0.22);
    border-radius: 16px; padding: 18px;
    margin-bottom: 16px;
    position: relative; z-index: 1;
}
.cd-form-title { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: #7c2d12; margin-bottom: 16px; }
.cd-form-title i { color: #f59e0b; }

.cd-field-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-field { flex: 1; min-width: 130px; margin-bottom: 14px; }
.cd-field-row .cd-field { margin-bottom: 0; }
.cd-field label { display: block; font-size: 0.82rem; font-weight: 600; color: #475569; margin-bottom: 7px; }
.cd-field label i { color: #f59e0b; margin-right: 4px; }
.cd-field input[type="text"], .cd-field input[type="date"], .cd-field input[type="time"] {
    width: 100%; padding: 10px 12px; border: 1.5px solid rgba(245,158,11,0.25);
    border-radius: 10px; font-size: 0.88rem; color: #1e293b;
    background: #fff; box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.cd-field input:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }

.cd-note-input {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; border: 1.5px solid rgba(245,158,11,0.25);
    border-radius: 10px; font-size: 0.88rem; color: #1e293b;
    background: #fff; resize: vertical; min-height: 60px; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.cd-note-input:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }

/* 分类选择 */
.cd-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.cd-cat-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: 1.5px solid rgba(245,158,11,0.25); border-radius: 12px;
    cursor: pointer; transition: all .2s; background: #fff; text-align: center;
}
.cd-cat-item i { font-size: 1.1rem; }
.cd-cat-item .cd-cat-name { font-size: 0.75rem; color: #64748b; }
.cd-cat-item.active { background: rgba(245,158,11,0.10); border-color: #f59e0b; }
.cd-cat-item.active .cd-cat-name { color: #7c2d12; font-weight: 600; }

/* 颜色选择 */
.cd-color-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-color-item {
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all .2s; position: relative;
}
.cd-color-item:hover { transform: scale(1.12); }
.cd-color-item.active { border-color: #1e293b; transform: scale(1.12); }
.cd-color-item.active::after {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.7rem;
}

/* 保存按钮 */
.cd-save-row { display: flex; gap: 10px; margin-top: 6px; }
.cd-save-btn {
    flex: 1; border: none; cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #fff;
    background: linear-gradient(135deg,#f59e0b,#f97316);
    box-shadow: 0 6px 16px rgba(245,158,11,0.35);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .25s ease;
}
.cd-save-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(249,115,22,0.45); }
.cd-cancel-btn {
    border: 1.5px solid rgba(245,158,11,0.4); cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #c2410c; background: rgba(255,255,255,0.7);
    transition: all .2s;
}
.cd-cancel-btn:hover { background: rgba(245,158,11,0.08); }

/* ---------- 列表（卡片网格） ---------- */
.cd-list-area { position: relative; z-index: 1; }
.cd-list-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.cd-item {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(245,158,11,0.22);
    border-radius: 16px; padding: 16px;
    position: relative; overflow: hidden;
    transition: all .25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}
.cd-item:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(245,158,11,0.18); }
.cd-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: var(--cd-item-color, #f59e0b);
}
.cd-item.past { opacity: 0.75; background: rgba(249,250,251,0.85); }
.cd-item.past::before { background: #94a3b8; }
.cd-item.today::before { background: linear-gradient(90deg, #10b981, #34d399); }

.cd-item-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.cd-item-icon {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff;
    background: var(--cd-item-color, #f59e0b);
}
.cd-item.past .cd-item-icon { background: #94a3b8; }
.cd-item-title {
    flex: 1; min-width: 0; font-size: 0.95rem; font-weight: 700; color: #1e293b;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-item-cat { font-size: 0.7rem; color: #94a3b8; font-weight: 500; }

.cd-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cd-item-btn {
    border: none; background: rgba(245,158,11,0.08); color: #c2410c;
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 0.8rem;
    transition: all .2s;
}
.cd-item-btn:hover { background: rgba(245,158,11,0.18); }
.cd-item-btn.del { color: #ef4444; background: rgba(239,68,68,0.08); }
.cd-item-btn.del:hover { background: rgba(239,68,68,0.18); }

/* 倒计时数字 - 大字号 */
.cd-item-timer {
    text-align: center; margin: 12px 0 10px;
    padding: 14px 8px; border-radius: 12px;
    background: linear-gradient(135deg, var(--cd-item-color-light, #fef3c7), var(--cd-item-color-lighter, #fed7aa));
}
.cd-item.past .cd-item-timer { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); }
.cd-item.today .cd-item-timer { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.cd-timer-days {
    font-size: 2.8rem; font-weight: 800; line-height: 1;
    color: var(--cd-item-color-dark, #7c2d12);
    font-variant-numeric: tabular-nums;
}
.cd-item.past .cd-timer-days { color: #64748b; }
.cd-item.today .cd-timer-days { color: #065f46; }
.cd-timer-unit { font-size: 0.85rem; color: var(--cd-item-color-dark, #7c2d12); font-weight: 600; margin-top: 4px; }
.cd-item.past .cd-timer-unit { color: #64748b; }
.cd-item.today .cd-timer-unit { color: #065f46; }
.cd-timer-label { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }

.cd-item-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.78rem; color: #64748b; margin-top: 8px;
}
.cd-item-note {
    font-size: 0.8rem; color: #64748b; margin-top: 8px;
    padding-top: 8px; border-top: 1px dashed rgba(245,158,11,0.2);
    line-height: 1.5;
}

.cd-empty { text-align: center; padding: 28px 16px; color: #94a3b8; }
.cd-empty i { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
.cd-empty div { font-size: 0.85rem; }

/* ---------- Toast ---------- */
.cd-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 12px 20px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; font-weight: 500; z-index: 999999;
    border-left: 4px solid #f59e0b;
    animation: cd-toast-in .3s ease;
    max-width: 90vw;
}
.cd-toast.success { border-left-color: #10b981; }
.cd-toast.error { border-left-color: #ef4444; }
.cd-toast.warning { border-left-color: #f59e0b; }
.cd-toast.info { border-left-color: #3b82f6; }
.cd-toast i { font-size: 1rem; }
.cd-toast.success i { color: #10b981; }
.cd-toast.error i { color: #ef4444; }
.cd-toast.warning i { color: #f59e0b; }
.cd-toast.info i { color: #3b82f6; }
@keyframes cd-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-15px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- 弹窗 ---------- */
.cd-modal-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,0.45);
    z-index: 999998; display: flex; align-items: center; justify-content: center;
    padding: 16px; animation: cd-fade .2s ease;
}
@keyframes cd-fade { from { opacity: 0; } to { opacity: 1; } }
.cd-modal {
    background: #fff; border-radius: 18px; max-width: 420px; width: 100%;
    padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: cd-pop .25s ease;
    max-height: 85vh; overflow-y: auto;
}
@keyframes cd-pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.cd-modal-title { font-size: 1.05rem; font-weight: 700; color: #7c2d12; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.cd-modal-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
.cd-modal-row:last-child { border-bottom: none; }
.cd-modal-row .cd-mr-label { color: #64748b; }
.cd-modal-row .cd-mr-val { font-weight: 600; color: #1e293b; }
.cd-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.cd-modal-btn {
    flex: 1; border: none; cursor: pointer; padding: 10px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 600; transition: all .2s;
}
.cd-modal-btn.primary { background: linear-gradient(135deg,#f59e0b,#f97316); color: #fff; }
.cd-modal-btn.primary:hover { transform: translateY(-1px); }
.cd-modal-btn.ghost { background: rgba(245,158,11,0.08); color: #c2410c; }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .cd-card { padding: 14px; border-radius: 16px; }
    .cd-tab { padding: 8px 10px; font-size: 0.78rem; }
    .cd-tab i { display: none; }
    .cd-summary-card { padding: 14px; }
    .cd-summary-title { font-size: 1.25rem; }
    .cd-form-card { padding: 14px; }
    .cd-field-row { gap: 8px; }
    .cd-list-grid { grid-template-columns: 1fr; }
    .cd-timer-days { font-size: 2.2rem; }
    .cd-category-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}
