/* 施工备忘录 - 前台样式（作用域 sgm-，避免影响站点其他页面） */

.sgm-wrap {
    max-width: 840px;
    margin: 0 auto;
    padding: 18px 15px 36px;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.65;
}
.sgm-wrap-narrow { max-width: 680px; }

.sgm-wrap * { box-sizing: border-box; }

/* ---------------- 顶部 ---------------- */
.sgm-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 20px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.22);
    margin-bottom: 18px;
}
.sgm-hero-slim { padding: 16px 20px; }
.sgm-hero h1 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.sgm-hero p { margin: 0; font-size: 13px; opacity: .9; line-height: 1.6; }
.sgm-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 按钮 ---------------- */
.sgm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.28);
    transition: transform .15s, box-shadow .15s, opacity .15s;
}
.sgm-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(102, 126, 234, 0.36); }
.sgm-btn:active { transform: translateY(0); }
.sgm-btn-light { background: rgba(255, 255, 255, .18); box-shadow: none; border: 1px solid rgba(255, 255, 255, .55); }
.sgm-btn-light:hover { background: rgba(255, 255, 255, .28); box-shadow: none; }
.sgm-btn-ghost { background: #f1f5f9; color: #475569; box-shadow: none; }
.sgm-btn-ghost:hover { background: #e2e8f0; box-shadow: none; }
.sgm-btn-danger { background: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, .25); }
.sgm-btn-danger:hover { background: #dc2626; box-shadow: 0 6px 16px rgba(239, 68, 68, .3); }
.sgm-btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------------- 卡片 ---------------- */
.sgm-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
    border: 1px solid rgba(226, 232, 240, .8);
}
.sgm-card-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #1e293b; }
.sgm-card-summary { font-size: 15px; font-weight: 600; color: #475569; cursor: pointer; list-style: none; }
.sgm-card-summary::-webkit-details-marker { display: none; }
.sgm-card-summary::before { content: '▸ '; color: #667eea; }
details[open] > .sgm-card-summary::before { content: '▾ '; }
.sgm-hint { margin: 6px 0 14px; color: #64748b; font-size: 13px; }
.sgm-hint.is-warn { color: #b45309; }
.sgm-optional { color: #94a3b8; font-weight: 400; font-size: 12px; }

/* ---------------- 统计 ---------------- */
.sgm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.sgm-stat {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .8);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.sgm-stat-num { display: block; font-size: 24px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.sgm-stat-num.is-open { color: #d97706; }
.sgm-stat-num.is-done { color: #059669; }
.sgm-stat-label { display: block; margin-top: 4px; font-size: 12px; color: #64748b; }

/* ---------------- 筛选 ---------------- */
.sgm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sgm-chip {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    transition: all .15s;
}
.sgm-chip:hover { border-color: #c7d2fe; color: #4f46e5; }
.sgm-chip.active { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; font-weight: 600; }

/* ---------------- 新建 ---------------- */
.sgm-new summary {
    list-style: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #4f46e5;
    padding: 2px 0;
}
.sgm-new summary::-webkit-details-marker { display: none; }
.sgm-new summary::before { content: ''; }
.sgm-new[open] summary { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed #e2e8f0; }

/* ---------------- 表单 ---------------- */
.sgm-form { margin: 0; }
.sgm-field { margin-bottom: 14px; }
.sgm-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.sgm-field input,
.sgm-field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.sgm-field textarea { resize: vertical; min-height: 96px; }
.sgm-field input:focus,
.sgm-field textarea:focus {
    outline: none;
    background: #fff;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .12);
}
.sgm-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------------- 列表 ---------------- */
.sgm-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 2px 10px;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}
.sgm-section-count { font-size: 12px; font-weight: 500; color: #94a3b8; }

.sgm-list { display: flex; flex-direction: column; gap: 10px; }
.sgm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .9);
    border-left: 4px solid #f59e0b;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    transition: transform .15s, box-shadow .15s;
}
.sgm-item:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.sgm-item.is-done { border-left-color: #10b981; }
.sgm-item-main { flex: 1; min-width: 0; }
.sgm-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.sgm-item-title { margin: 0 0 3px; font-size: 15px; font-weight: 600; color: #1e293b; word-break: break-word; }
.sgm-item-sub { margin: 0; font-size: 12px; color: #94a3b8; }
.sgm-arrow { color: #cbd5e1; font-size: 22px; line-height: 1; }

.sgm-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
    white-space: nowrap;
}
.sgm-badge.is-open { background: #fef3c7; color: #92400e; }
.sgm-badge.is-done { background: #d1fae5; color: #065f46; }
.sgm-loc {
    display: inline-block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 999px;
    padding: 2px 9px;
}
.sgm-time { margin-left: auto; font-size: 11.5px; color: #94a3b8; }

/* ---------------- 空状态 / 提示 ---------------- */
.sgm-empty { text-align: center; padding: 40px 20px; color: #94a3b8; }
.sgm-empty-icon { font-size: 44px; margin-bottom: 8px; }
.sgm-empty p { margin: 6px 0 16px; font-size: 14px; }

.sgm-alert {
    padding: 11px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.6;
}
.sgm-alert-ok { background: #d1fae5; color: #065f46; }
.sgm-alert-err { background: #fee2e2; color: #991b1b; }

/* ---------------- 分页 ---------------- */
.sgm-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.sgm-pager a, .sgm-pager span {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
}
.sgm-pager a { background: #fff; border: 1px solid #e2e8f0; color: #475569; }
.sgm-pager a:hover { border-color: #c7d2fe; color: #4f46e5; }
.sgm-pager .off { color: #cbd5e1; border: 1px solid #f1f5f9; }
.sgm-pager-info { font-size: 12.5px; color: #94a3b8; padding: 0; }

/* ---------------- 详情 ---------------- */
.sgm-back { display: inline-block; margin-bottom: 12px; color: #64748b; font-size: 13px; text-decoration: none; }
.sgm-back:hover { color: #4f46e5; }
.sgm-detail-head { margin-bottom: 8px; }
.sgm-detail-title { margin: 6px 0 4px; font-size: 20px; font-weight: 700; color: #1e293b; word-break: break-word; line-height: 1.4; }
.sgm-meta { font-size: 12.5px; color: #94a3b8; }
.sgm-pre { margin-top: 12px; color: #334155; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

.sgm-solution { background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%); border-color: #a7f3d0; }
.sgm-solution-head { display: flex; align-items: center; gap: 10px; }
.sgm-solution-icon { font-size: 22px; }
.sgm-solution-head strong { display: block; font-size: 15px; color: #065f46; }
.sgm-solution-by { display: block; font-size: 12px; color: #059669; }

.sgm-share-row { display: flex; gap: 8px; align-items: center; }
.sgm-share-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px dashed #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12.5px;
}
.sgm-inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sgm-inline-actions form { margin: 0; }
.sgm-danger-zone { border-color: #fecaca; background: #fff7f7; }
.sgm-thanks { text-align: center; color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.sgm-thanks p { margin: 0; font-size: 14px; }

/* ---------------- 日历 ---------------- */
.sgm-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sgm-cal-title { text-align: center; font-size: 16px; color: #1e293b; }
.sgm-cal-title strong { font-size: 17px; }
.sgm-cal-today { display: block; margin-top: 2px; font-size: 11.5px; color: #4f46e5; text-decoration: none; }
.sgm-cal-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 20px;
    text-decoration: none;
}
.sgm-cal-arrow:hover { background: #e0e7ff; color: #4338ca; }

.sgm-cal-head, .sgm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.sgm-cal-head { margin-bottom: 5px; }
.sgm-cal-head span { text-align: center; font-size: 11.5px; color: #94a3b8; padding: 4px 0; }

.sgm-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-height: 40px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid transparent;
    transition: transform .12s, background .12s;
}
.sgm-cal-day:hover { transform: scale(1.04); background: #eef2ff; }
.sgm-cal-day.has { background: #e0e7ff; color: #3730a3; font-weight: 600; }
.sgm-cal-day.warm { background: #c7d2fe; }
.sgm-cal-day.hot { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.sgm-cal-day.today { border-color: #4f46e5; }
.sgm-cal-day.selected { outline: 2px solid #4f46e5; outline-offset: 1px; }
.sgm-cal-blank { display: block; aspect-ratio: 1 / 1; }
.sgm-cal-num { line-height: 1.2; }
.sgm-cal-count {
    margin-top: 2px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
}
.sgm-cal-day.hot .sgm-cal-count { background: rgba(255, 255, 255, .25); }

.sgm-cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 11.5px; color: #64748b; }
.sgm-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sgm-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sgm-dot.lv0 { background: #f8fafc; border: 1px solid #e2e8f0; }
.sgm-dot.lv1 { background: #e0e7ff; }
.sgm-dot.lv2 { background: #c7d2fe; }
.sgm-dot.lv3 { background: linear-gradient(135deg, #667eea, #764ba2); }

/* ---------------- 小屏 ---------------- */
@media (max-width: 480px) {
    .sgm-wrap { padding: 12px 12px 28px; }
    .sgm-hero { padding: 16px; }
    .sgm-hero h1 { font-size: 18px; }
    .sgm-card { padding: 16px; }
    .sgm-stat-num { font-size: 21px; }
    .sgm-detail-title { font-size: 18px; }
    .sgm-share-row { flex-direction: column; align-items: stretch; }
    .sgm-share-row .sgm-btn { width: 100%; }
    .sgm-time { margin-left: 0; }
    .sgm-cal-day { font-size: 12px; border-radius: 8px; }
    .sgm-cal-head, .sgm-cal-grid { gap: 3px; }
}
