/* ================================================================
 * DS v4.7 用户成长系统 样式
 * - 签到日历
 * - 邀请页面
 * - 积分商城
 * - 排行榜
 * ================================================================ */

/* ========== 签到 ========== */
.ds-signin-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.ds-signin-stat { background: #f9f9f9; padding: 12px; border-radius: 6px; text-align: center; }
.ds-signin-stat span { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.ds-signin-stat strong { font-size: 18px; color: #FF7D00; }
.ds-signin-today { text-align: center; margin: 20px 0; }
.ds-signin-today .ds-btn-success { background: #10b981 !important; }

.ds-signin-calendar-title, .ds-signin-rules-title { margin: 24px 0 12px; font-size: 15px; color: #333; }
.ds-signin-calendar { width: 100%; border-collapse: collapse; }
.ds-signin-calendar th { background: #f5f5f5; padding: 8px; text-align: center; font-size: 12px; }
.ds-signin-calendar td { width: 14.28%; aspect-ratio: 1; text-align: center; border: 1px solid #ebeef5; padding: 4px; position: relative; vertical-align: top; }
.ds-signin-calendar td.is-signed { background: #fff7e6; }
.ds-signin-calendar td.is-today { background: #FF7D00; color: #fff; }
.ds-signin-calendar td.is-today.is-signed { background: linear-gradient(135deg, #FF7D00 50%, #fff7e6 50%); }
.ds-signin-day { display: block; font-size: 14px; font-weight: 600; }
.ds-signin-mark { display: block; font-size: 10px; color: #FF7D00; margin-top: 2px; }
.ds-signin-rules { list-style: none; padding: 0; margin: 0; background: #f9f9f9; padding: 12px 16px; border-radius: 6px; }
.ds-signin-rules li { padding: 4px 0; font-size: 13px; color: #555; }

/* ========== 邀请 ========== */
.ds-invite-desc { color: #666; }
.ds-invite-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.ds-invite-stat { background: linear-gradient(135deg, #FF7D00, #FFB347); color: #fff; padding: 16px; border-radius: 8px; text-align: center; }
.ds-invite-stat span { display: block; font-size: 12px; opacity: 0.9; }
.ds-invite-stat strong { font-size: 22px; display: block; margin-top: 4px; }
.ds-invite-code, .ds-invite-link { margin: 16px 0; }
.ds-invite-code h3 { font-size: 14px; margin: 0 0 8px; }
.ds-invite-code-box { display: flex; gap: 8px; }
.ds-invite-code-box code, .ds-invite-code-box input { flex: 1; padding: 12px 16px; font-size: 16px; font-weight: 600; background: #f9f9f9; border: 1px dashed #FF7D00; border-radius: 4px; color: #FF7D00; }
.ds-invite-code-box input { border-style: solid; }

/* ========== 商城 ========== */
.ds-shop-credit { background: linear-gradient(90deg, #FF7D00, #FFB347); color: #fff; padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.ds-shop-credit strong { font-size: 22px; }
.ds-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.ds-shop-card { background: #fff; border: 1px solid #ebeef5; border-radius: 8px; overflow: hidden; transition: all 0.2s; }
.ds-shop-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.ds-shop-card.is-disabled { opacity: 0.5; }
.ds-shop-card.is-disabled:hover { transform: none; box-shadow: none; }
.ds-shop-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f5f5f5; }
.ds-shop-img-empty { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #f5f5f5; font-size: 48px; }
.ds-shop-info { padding: 12px; }
.ds-shop-info h4 { font-size: 14px; margin: 0 0 6px; color: #333; }
.ds-shop-desc { font-size: 12px; color: #999; margin: 0 0 8px; min-height: 32px; }
.ds-shop-bottom { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.ds-shop-cost { color: #FF7D00; font-weight: 600; }
.ds-shop-stock { color: #999; }
.ds-shop-exchange { width: 100%; }
.ds-shop-empty { padding: 40px; text-align: center; color: #999; background: #f9f9f9; border-radius: 6px; }

/* ========== 排行榜 ========== */
.ds-top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ds-top-col h3 { font-size: 15px; margin: 0 0 12px; }
.ds-top-list { list-style: none; padding: 0; margin: 0; counter-reset: top; }
.ds-top-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.ds-top-item:last-child { border-bottom: 0; }
.ds-top-item.is-podium { background: linear-gradient(90deg, rgba(255,215,0,.1), transparent); }
.ds-top-rank { width: 28px; height: 28px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.ds-top-p1 .ds-top-rank { background: #FFD700; color: #fff; }
.ds-top-p2 .ds-top-rank { background: #C0C0C0; color: #fff; }
.ds-top-p3 .ds-top-rank { background: #CD7F32; color: #fff; }
.ds-top-name { flex: 1; font-size: 13px; }
.ds-top-score { font-size: 12px; color: #FF7D00; font-weight: 600; }

/* ========== 通用按钮 ========== */
.ds-btn { display: inline-block; padding: 8px 20px; background: #FF7D00; color: #fff; border: 0; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.ds-btn:hover { background: #ff6a00; transform: translateY(-1px); }
.ds-btn-primary { background: #FF7D00; }
.ds-btn-success { background: #10b981; }
.ds-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* 暗黑模式 */
[data-ds-theme="dark"] .ds-signin-calendar th { background: #2a2a2a; color: #ccc; }
[data-ds-theme="dark"] .ds-signin-calendar td { border-color: #333; }
[data-ds-theme="dark"] .ds-signin-calendar td.is-signed { background: #3a2a00; }
[data-ds-theme="dark"] .ds-signin-stat, [data-ds-theme="dark"] .ds-signin-rules { background: #2a2a2a; color: #ccc; }
[data-ds-theme="dark"] .ds-invite-code-box code, [data-ds-theme="dark"] .ds-invite-code-box input { background: #2a2a2a; color: #FFB347; }
[data-ds-theme="dark"] .ds-shop-card { background: #1e1e1e; border-color: #333; }
[data-ds-theme="dark"] .ds-shop-info h4 { color: #e0e0e0; }
[data-ds-theme="dark"] .ds-shop-img-empty { background: #2a2a2a; }
[data-ds-theme="dark"] .ds-shop-credit { background: linear-gradient(90deg, #d96b00, #FFB347); }
[data-ds-theme="dark"] .ds-top-item { border-color: #333; }
[data-ds-theme="dark"] .ds-top-item.is-podium { background: linear-gradient(90deg, rgba(255,215,0,.05), transparent); }
[data-ds-theme="dark"] .ds-top-rank { background: #2a2a2a; color: #ccc; }
[data-ds-theme="dark"] .ds-shop-empty { background: #2a2a2a; }

/* 移动端 */
@media (max-width: 768px) {
    .ds-signin-info, .ds-invite-stats { grid-template-columns: 1fr; }
    .ds-top-grid { grid-template-columns: 1fr; }
    .ds-shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .ds-invite-code-box { flex-direction: column; }
}
