/* ── Dashboard Hero ── */
.db-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    margin-bottom: 1.75rem;
    color: #fff;
}

/* 黎明 5–7：紫粉橙，曙光初現 */
.db-hero--dawn {
    background:
        radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
        linear-gradient(150deg, #4c1d95 0%, #db2777 45%, #f97316 100%);
    background-size: 24px 24px, 100% 100%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 20px 60px rgba(219,39,119,0.45);
}

/* 早晨 7–11：天藍轉金黃，朝氣蓬勃 */
.db-hero--morning {
    background:
        radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
        linear-gradient(150deg, #0369a1 0%, #0ea5e9 45%, #fbbf24 100%);
    background-size: 24px 24px, 100% 100%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 20px 60px rgba(14,165,233,0.4);
}

/* 正午 11–14：晴空萬里 */
.db-hero--noon {
    background:
        radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
        linear-gradient(150deg, #0284c7 0%, #0ea5e9 50%, #7dd3fc 100%);
    background-size: 24px 24px, 100% 100%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 20px 60px rgba(2,132,199,0.4);
}

/* 下午 14–17：藍天深邃 */
.db-hero--afternoon {
    background:
        radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
        linear-gradient(150deg, #1e3a8a 0%, #2563eb 50%, #60a5fa 100%);
    background-size: 24px 24px, 100% 100%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 20px 60px rgba(37,99,235,0.4);
}

/* 傍晚 17–20：橙紅晚霞 */
.db-hero--sunset {
    background:
        radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
        linear-gradient(150deg, #7c3aed 0%, #dc2626 30%, #f97316 65%, #fbbf24 100%);
    background-size: 24px 24px, 100% 100%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 20px 60px rgba(249,115,22,0.45);
}

/* 夜晚 20–5：深邃星空 */
.db-hero--night {
    background:
        radial-gradient(circle, rgba(255,255,255,0.22) 1px, transparent 1px),
        linear-gradient(150deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    background-size: 20px 20px, 100% 100%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 20px 60px rgba(15,23,42,0.6);
}

.db-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.10) 45%,
        rgba(255,255,255,0.22) 50%,
        rgba(255,255,255,0.10) 55%,
        transparent 70%
    );
    background-size: 200% 100%;
    background-position: 200% 0;
    animation: db-shimmer 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes db-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.db-hero-content {
    position: relative;
    z-index: 3;
}

.db-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 100px;
    padding: 0.25rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}

.db-hero-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(74,222,128,0.3);
    animation: db-pulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes db-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(74,222,128,0.3); }
    50%       { box-shadow: 0 0 0 7px rgba(74,222,128,0.1); }
}

.db-hero-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.375rem;
    line-height: 1.2;
}

.db-hero-date {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
}

.db-hero-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.db-deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    filter: blur(2px);
}

.db-deco-c1 {
    width: 220px; height: 220px;
    top: -90px; right: -50px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.02) 70%);
    filter: blur(4px);
}
.db-deco-c2 {
    width: 150px; height: 150px;
    top: 10px; right: 110px;
    background: radial-gradient(circle, rgba(167,139,250,0.3) 0%, rgba(109,40,217,0.05) 70%);
    filter: blur(12px);
}
.db-deco-c3 {
    width: 90px; height: 90px;
    bottom: -25px; right: 260px;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    filter: blur(8px);
}

/* ── Section ── */
.dashboard-section { margin-bottom: 2rem; }

.section-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.section-title-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
    border-radius: var(--radius);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(109,40,217,0.3);
}

.section-title-icon svg { width: 14px; height: 14px; }

/* ── Announcement Card ── */
.db-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border), inset 0 1px 0 rgba(255,255,255,0.8);
    padding: 1.25rem;
    position: relative;
}

.db-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(109,40,217,0.12) 0%, rgba(59,130,246,0.08) 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.announcement-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
}

.announcement-item:first-child { padding-top: 0; }
.announcement-item:last-child  { border-bottom: none; padding-bottom: 0; }

.announcement-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.announcement-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Quick Actions ── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 1.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: 2px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.action-card--blue:hover   {
    transform: translateY(-3px);
    background: rgba(59,130,246,0.03);
    border-color: #93c5fd;
    border-top-color: #3b82f6;
    box-shadow: 0 10px 28px rgba(59,130,246,0.2);
}
.action-card--purple:hover {
    transform: translateY(-3px);
    background: rgba(139,92,246,0.03);
    border-color: #c4b5fd;
    border-top-color: #8b5cf6;
    box-shadow: 0 10px 28px rgba(139,92,246,0.2);
}
.action-card--green:hover  {
    transform: translateY(-3px);
    background: rgba(34,197,94,0.03);
    border-color: #86efac;
    border-top-color: #22c55e;
    box-shadow: 0 10px 28px rgba(34,197,94,0.2);
}
.action-card--teal:hover   {
    transform: translateY(-3px);
    background: rgba(20,184,166,0.03);
    border-color: #5eead4;
    border-top-color: #14b8a6;
    box-shadow: 0 10px 28px rgba(20,184,166,0.2);
}
.action-card--orange:hover {
    transform: translateY(-3px);
    background: rgba(249,115,22,0.03);
    border-color: #fdba74;
    border-top-color: #f97316;
    box-shadow: 0 10px 28px rgba(249,115,22,0.2);
}

.action-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: transform 0.2s;
}

.action-card:hover .action-icon { transform: scale(1.08); }
.action-icon svg { width: 24px; height: 24px; }

.action-card--blue   .action-icon { background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%); color: #3b82f6; }
.action-card--purple .action-icon { background: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(139,92,246,0.05) 100%); color: #8b5cf6; }
.action-card--green  .action-icon { background: linear-gradient(135deg, rgba(34,197,94,0.15) 0%, rgba(34,197,94,0.05) 100%); color: #22c55e; }
.action-card--teal   .action-icon { background: linear-gradient(135deg, rgba(20,184,166,0.15) 0%, rgba(20,184,166,0.05) 100%); color: #14b8a6; }
.action-card--orange .action-icon { background: linear-gradient(135deg, rgba(249,115,22,0.15) 0%, rgba(249,115,22,0.05) 100%); color: #f97316; }

.action-text {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* ── 快速操作覆蓋按鈕（移除 / 編輯）── */
.action-overlay-btn {
    position: absolute;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background 0.15s;
    z-index: 2;
}
.action-card:hover .action-overlay-btn { display: flex; }
.action-remove-btn { top: 0.3rem; right: 0.3rem; }
.action-edit-btn   { bottom: 0.3rem; right: 0.3rem; }
.action-remove-btn:hover { background: rgba(220,38,38,0.75); }
.action-edit-btn:hover   { background: rgba(37,99,235,0.75); }

/* ── 卡片 emoji 圖示 ── */
.action-emoji {
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
}

/* ── 快速操作編輯表單（原地替換卡片）── */
.action-edit-form {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 0.75rem;
    background: var(--bg-white);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.action-icon-picker-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}
.action-icon-picker {
    font-size: 1.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    line-height: 1;
    transition: border-color 0.15s;
}
.action-icon-picker:hover { border-color: var(--primary); }
.emoji-grid {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0.375rem;
    width: 284px;
    z-index: 20;
}
.emoji-page-content {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}
.emoji-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0;
    border-radius: var(--radius);
    line-height: 1;
    transition: background 0.1s;
    width: 100%;
    text-align: center;
}
.emoji-btn:hover { background: var(--bg); }
.emoji-reset {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.emoji-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.125rem 0;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.emoji-prev, .emoji-next {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0.1rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
    color: var(--text);
    transition: background 0.1s;
}
.emoji-prev:hover, .emoji-next:hover { background: var(--bg); }
.emoji-prev:disabled, .emoji-next:disabled { opacity: 0.3; cursor: not-allowed; }
.action-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 100%;
}
.action-edit-input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    outline: none;
    box-sizing: border-box;
}
.action-edit-input:focus { border-color: var(--primary); }
.action-edit-btns {
    display: flex;
    gap: 0.375rem;
    width: 100%;
}
.btn-edit-save, .btn-edit-cancel {
    flex: 1;
    padding: 0.3rem 0;
    font-size: 0.75rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
}
.btn-edit-save   { background: var(--primary); color: #fff; }
.btn-edit-cancel { background: var(--border);  color: var(--text); }
.btn-edit-save:hover   { opacity: 0.88; }
.btn-edit-cancel:hover { opacity: 0.75; }

/* 快速操作空白提示 */
.quick-actions-empty {
    grid-column: 1 / -1;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.9;
    margin: 0;
}


/* ── Responsive ── */
@media (max-width: 640px) {
    .db-hero { padding: 1.75rem 1.25rem; }
    .db-hero-title { font-size: 1.375rem; }
    .db-deco-c2, .db-deco-c3 { display: none; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
