/**
 * 子比温馨伴侣 - 前端样式
 */

/* 工具条 */
.warm-companion-widget .sdr-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.warm-companion-widget .sdr-limit {
    font-size: 12px;
}

/* 空状态 */
.warm-companion-widget .sdr-empty-state {
    padding: 40px 20px;
}

.warm-companion-widget .sdr-empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
}

/* 日期卡片网格 */
.warm-companion-widget .sdr-date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.warm-companion-widget .sdr-card {
    --sdr-color: #ff6b6b;
    position: relative;
    border-radius: 12px;
    padding: 18px;
    background: #fff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.warm-companion-widget .sdr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.warm-companion-widget .sdr-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.warm-companion-widget .sdr-card-today::before {
    background: linear-gradient(180deg, #ff6b6b, #ff8e53);
}

.warm-companion-widget .sdr-card-upcoming::before {
    background: linear-gradient(180deg, #4facfe, #00f2fe);
}

.warm-companion-widget .sdr-card-passed::before {
    background: linear-gradient(180deg, #a8a8a8, #d0d0d0);
}

.warm-companion-widget .sdr-card-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .18;
}

.warm-companion-widget .sdr-card > * {
    position: relative;
    z-index: 1;
}

.warm-companion-widget .sdr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.warm-companion-widget .sdr-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.warm-companion-widget .sdr-card-icon {
    margin-right: 4px;
}

.warm-companion-widget .sdr-card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    margin-left: 8px;
}

.warm-companion-widget .sdr-card-body {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.warm-companion-widget .sdr-card-days {
    display: flex;
    align-items: baseline;
}

.warm-companion-widget .sdr-days-number {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: var(--sdr-color, #333);
}

.warm-companion-widget .sdr-card-today .sdr-days-number {
    color: #ff6b6b;
}

.warm-companion-widget .sdr-card-upcoming .sdr-days-number {
    color: #4facfe;
}

.warm-companion-widget .sdr-card-passed .sdr-days-number {
    color: #999;
}

.warm-companion-widget .sdr-days-label {
    font-size: 14px;
    color: #666;
    margin-left: 4px;
}

.warm-companion-widget .sdr-card-text {
    font-size: 14px;
    color: #666;
}

.warm-companion-widget .sdr-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
    flex-wrap: wrap;
}

.warm-companion-widget .sdr-card-date {
    font-size: 13px;
    color: #888;
}

.warm-companion-widget .sdr-card-ordinal {
    font-size: 12px;
    color: var(--sdr-color, #ff6b6b);
    background: rgba(255, 107, 107, .1);
    padding: 1px 8px;
    border-radius: 10px;
}

.warm-companion-widget .sdr-advance,
.warm-companion-widget .sdr-card-lunar {
    font-size: 12px;
}

.warm-companion-widget .sdr-card-message {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    word-break: break-all;
}

.warm-companion-widget .sdr-card-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.warm-companion-widget .sdr-card-actions .but {
    font-size: 12px;
    padding: 4px 12px;
}

/* 表单 */
.warm-companion-widget .sdr-date-form {
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 20px;
    margin-bottom: 20px;
    animation: sdr-fade-in 0.3s ease;
}

.warm-companion-widget .sdr-date-form .author-set-left {
    width: 110px;
    flex-shrink: 0;
}

.warm-companion-widget .sdr-date-form .author-set-right {
    flex: 1;
}

.warm-companion-widget .sdr-color-input {
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.warm-companion-widget .sdr-partner-select,
.warm-companion-widget .sdr-group-select {
    width: 100%;
    min-height: 40px;
}

/* 时间线 */
.warm-companion-widget .sdr-timeline-box {
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    padding: 20px;
}

.warm-companion-widget .sdr-timeline-form {
    background: #fafafa;
    border-radius: 8px;
    padding: 14px;
}

.warm-companion-widget .sdr-tl-item {
    padding: 14px 0;
    border-bottom: 1px dashed #eee;
}

.warm-companion-widget .sdr-tl-item:last-child {
    border-bottom: none;
}

.warm-companion-widget .sdr-tl-year {
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 4px;
}

.warm-companion-widget .sdr-tl-note {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.warm-companion-widget .sdr-tl-photos {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.warm-companion-widget .sdr-tl-photos img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

.warm-companion-widget .sdr-tl-meta {
    font-size: 12px;
    margin-top: 6px;
}

/* 订阅 / 海报容器 */
.warm-companion-widget .sdr-ical-box {
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    padding: 20px;
}

.warm-companion-widget .sdr-ical-url {
    margin: 8px 0;
}

/* 海报 */
.sdr-poster {
    position: relative;
    width: 100%;
    max-width: 375px;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(160deg, #ff9a9e 0%, #fecfef 50%, #f6f8ff 100%);
    box-shadow: 0 8px 30px rgba(255, 107, 107, .18);
    background-size: cover;
    background-position: center;
}

.sdr-poster-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.5), transparent 60%);
}

.sdr-poster-inner {
    position: relative;
    padding: 28px 24px;
    text-align: center;
    color: #333;
}

.sdr-posterYear {
    font-size: 13px;
    letter-spacing: 3px;
    color: #ff6b6b;
    font-weight: 600;
}

.sdr-poster-name {
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0 2px;
    color: var(--sdr-color, #ff6b6b);
}

.sdr-poster-sub {
    font-size: 13px;
    color: #777;
    margin: 0 0 14px;
}

.sdr-poster-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 16px;
}

.sdr-poster-stats b {
    display: block;
    font-size: 26px;
    color: var(--sdr-color, #ff6b6b);
    line-height: 1.2;
}

.sdr-poster-stats span {
    font-size: 12px;
    color: #888;
}

.sdr-poster-list {
    text-align: left;
    background: rgba(255,255,255,.6);
    border-radius: 10px;
    padding: 10px 12px;
}

.sdr-poster-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,.06);
    font-size: 13px;
}

.sdr-poster-item:last-child {
    border-bottom: none;
}

.sdr-poster-title {
    flex: 1;
    color: #444;
}

.sdr-poster-ord {
    font-size: 12px;
    color: #999;
}

.sdr-poster-empty {
    font-size: 13px;
    color: #888;
    text-align: center;
}

.sdr-poster-ico-big {
    font-size: 40px;
    margin-bottom: 6px;
}

.sdr-poster-days b {
    font-size: 46px;
    color: var(--sdr-color, #ff6b6b);
    line-height: 1;
}

.sdr-poster-days span {
    font-size: 14px;
    color: #888;
    margin-left: 3px;
}

.sdr-poster-date {
    font-size: 12px;
    color: #999;
}

.sdr-poster-msg {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    background: rgba(255,255,255,.65);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
}

.sdr-poster-foot {
    margin-top: 16px;
    font-size: 11px;
    color: #aaa;
}

.sdr-poster-actions {
    text-align: center;
    margin-bottom: 20px;
}

/* 短代码样式 */
.sdr-sc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sdr-sc-item {
    --sdr-color: #ff6b6b;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-left: 3px solid var(--sdr-color);
    border-radius: 8px;
    font-size: 14px;
}

.sdr-sc-icon {
    font-size: 18px;
}

.sdr-sc-title {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.sdr-sc-days b {
    font-size: 20px;
    color: var(--sdr-color);
}

.sdr-sc-days em {
    font-style: normal;
    font-size: 12px;
    color: #999;
    margin-left: 2px;
}

.sdr-sc-text {
    font-size: 12px;
    color: #888;
}

.sdr-sc-date {
    width: 100%;
    font-size: 12px;
    color: #999;
}

.sdr-muted {
    color: #999;
    font-size: 13px;
}

/* 纪念日墙 */
.sdr-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.sdr-wall-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.sdr-wall-ico {
    font-size: 24px;
}

.sdr-wall-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 4px 0;
}

.sdr-wall-days {
    font-size: 12px;
    color: #888;
}

.sdr-wall-days b {
    color: #ff6b6b;
    font-size: 16px;
}

.sdr-wall-user {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* 个人主页 */
.sdr-profile-dates h4 {
    font-size: 15px;
    margin-bottom: 8px;
}

/* 公开分享页 */
.sdr-share-page {
    padding: 40px 16px;
    display: flex;
    justify-content: center;
}

.sdr-share-card {
    --sdr-color: #ff6b6b;
    max-width: 420px;
    width: 100%;
    background: linear-gradient(160deg, #fff8f8, #fff);
    border: 1px solid #ffe0e0;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(255,107,107,.12);
}

.sdr-share-ico {
    font-size: 44px;
}

.sdr-share-card h1 {
    font-size: 22px;
    margin: 8px 0;
    color: #333;
}

.sdr-share-days b {
    font-size: 52px;
    color: var(--sdr-color);
    line-height: 1;
}

.sdr-share-days span {
    font-size: 14px;
    color: #999;
    margin-left: 4px;
}

.sdr-share-text {
    color: var(--sdr-color);
    font-size: 14px;
}

.sdr-share-date {
    font-size: 12px;
    color: #999;
}

.sdr-share-msg {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.sdr-share-user,
.sdr-share-site {
    font-size: 12px;
    color: #aaa;
}

/* 深色模式 */
body.dark-theme .warm-companion-widget .sdr-card,
body.night .warm-companion-widget .sdr-card,
body.dark-theme .sdr-sc-item,
body.night .sdr-sc-item,
body.dark-theme .sdr-wall-item,
body.night .sdr-wall-item,
body.dark-theme .warm-companion-widget .sdr-date-form,
body.night .warm-companion-widget .sdr-date-form,
body.dark-theme .warm-companion-widget .sdr-timeline-box,
body.night .warm-companion-widget .sdr-timeline-box,
body.dark-theme .warm-companion-widget .sdr-ical-box,
body.night .warm-companion-widget .sdr-ical-box {
    background: #262626;
    border-color: #3a3a3a;
    color: #ddd;
}

body.dark-theme .warm-companion-widget .sdr-card-title,
body.night .warm-companion-widget .sdr-card-title,
body.dark-theme .sdr-sc-title,
body.night .sdr-sc-title,
body.dark-theme .sdr-wall-title,
body.night .sdr-wall-title {
    color: #eee;
}

body.dark-theme .warm-companion-widget .sdr-card-message,
body.night .warm-companion-widget .sdr-card-message,
body.dark-theme .warm-companion-widget .sdr-timeline-form,
body.night .warm-companion-widget .sdr-timeline-form {
    background: #303030;
    color: #ccc;
}

@media (max-width: 768px) {
    .warm-companion-widget .sdr-date-form .author-set-left {
        width: 100%;
        margin-bottom: 8px;
    }
    .warm-companion-widget .sdr-date-form .author-set-right {
        width: 100%;
    }
    .warm-companion-widget .sdr-date-grid {
        grid-template-columns: 1fr;
    }
    .sdr-wall {
        grid-template-columns: repeat(2, 1fr);
    }
}

@keyframes sdr-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast */
#sdr-toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
}

.sdr-toast {
    padding: 10px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: sdr-fade-in 0.3s ease;
}

.sdr-toast-success {
    background: #28a745;
}

.sdr-toast-danger {
    background: #dc3545;
}
