/* =============================================
   百日打卡 - 减肥打卡网站样式表
   设计语言：清新薄荷绿渐变 / 圆角卡片 / 柔和阴影
   ============================================= */

/* ==================== 设计变量 ==================== */
:root {
    --green-50: #f1fff8;
    --green-100: #deffee;
    --green-200: #7fecb5;
    --green-500: #37d786;
    --green-600: #10b981;
    --green-700: #059669;
    --green-900: #00773b;
    --green-soft: #f0f9f4;

    --ink: #0f172a;
    --ink-2: #334155;
    --ink-3: #64748b;
    --ink-4: #94a3b8;
    --line: #e2e8f0;
    --bg: #f8fafc;

    --red: #dc2626;
    --red-bg: #fee2e2;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --amber: #f59e0b;
    --gold: #ffbd02;

    --grad: linear-gradient(135deg, #7fecb5 0%, #37d786 100%);
    --grad-soft: linear-gradient(135deg, #f1fff8 0%, #deffee 100%);
    --grad-bar: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    --glow: 11px 6px 44px rgba(36, 142, 88, .22), inset 0 1px 13px rgba(255, 255, 255, .5);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .1);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 26px;

    --nav-h: 60px;
}

.icon {
    display: inline-block;
    font-style: normal;
    vertical-align: -0.15em;
}

/* 内联 SVG 图标默认尺寸：跟随字号 */
svg.svgi {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.125em;
    fill: none;
}

/* 各场景的图标大小 */
.logo-mark svg.svgi { width: 19px; height: 19px; }
.hero-logo svg.svgi { width: 30px; height: 30px; }
.section-title svg.svgi { width: 28px; height: 28px; vertical-align: -4px; }
.feature-icon svg.svgi { width: 32px; height: 32px; }
.btn svg.svgi { width: 15px; height: 15px; }
.btn-lg svg.svgi { width: 17px; height: 17px; }
.btn-sm svg.svgi { width: 13px; height: 13px; }
.link-logo-default svg.svgi { width: 22px; height: 22px; }
.empty-state .empty-icon svg.svgi,
.empty-state svg.svgi:first-child { width: 40px; height: 40px; color: var(--green-200); }
.social-btn svg.svgi { width: 22px; height: 22px; }
.ts-icon svg.svgi { width: 20px; height: 20px; }
.tip-row svg.svgi { width: 16px; height: 16px; color: var(--green-600); margin-top: 3px; }
.qrcode-close svg.svgi { width: 14px; height: 14px; }
.page-header svg.svgi { width: 30px; height: 30px; vertical-align: -5px; }
.mobile-nav-item svg.svgi { width: 19px; height: 19px; margin-bottom: 3px; }
.medal svg.svgi { width: 14px; height: 14px; }
.auth-header .hero-logo svg.svgi { width: 30px; height: 30px; }
.friendly-links-header h2 svg.svgi { width: 20px; height: 20px; vertical-align: -3px; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    padding-top: var(--nav-h);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 标题右侧的薄荷圆点装饰 */
h2.dot-after:after {
    position: relative;
    z-index: 0;
    top: 1px;
    left: 6px;
    display: inline-block;
    content: "";
    width: 22px;
    height: 22px;
    background: linear-gradient(180deg, #37d786, rgba(104, 237, 187, .16));
    opacity: .52;
    border-radius: 50%;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--grad);
    box-shadow: var(--glow);
    border-radius: var(--r-pill);
    color: var(--green-900);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 215, 134, .4);
}

.btn-ghost {
    background: white;
    border: 2px solid var(--line);
    color: var(--ink-3);
    border-radius: var(--r-pill);
    padding: 8px 18px;
}

.btn-ghost:hover {
    border-color: var(--green-600);
    color: var(--green-700);
}

.btn-outline {
    background: white;
    border: 2px solid var(--line);
    color: var(--green-600);
    padding: 12px 32px;
    border-radius: 24px;
    transition: all .3s;
}

.btn-outline:hover {
    background: var(--grad);
    box-shadow: var(--glow);
    border-radius: var(--r-pill);
    color: var(--green-900);
    border-color: transparent;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 20px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-radius: 20px;
}

.btn-danger:hover {
    background: #fecaca;
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    height: var(--nav-h);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink);
    letter-spacing: .3px;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--grad);
    color: var(--green-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 3px 10px rgba(36, 142, 88, .28);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink-3);
    font-size: 14px;
    transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
}

.nav-links a.active {
    font-weight: 600;
}

.nav-links a.btn-primary {
    color: var(--green-900);
    padding: 8px 18px;
    font-size: 13px;
}

/* ==================== Hero ==================== */
.hero {
    background: var(--grad-soft);
    color: #282828;
    text-align: center;
    padding: 88px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero:before,
.hero:after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(55, 215, 134, .18), transparent 68%);
    pointer-events: none;
}

.hero:before {
    width: 420px;
    height: 420px;
    top: -160px;
    left: -120px;
}

.hero:after {
    width: 520px;
    height: 520px;
    bottom: -260px;
    right: -140px;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 16px;
    justify-content: center;
    font-weight: 800;
    letter-spacing: -.5px;
}

.hero-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--grad);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: var(--glow);
    flex-shrink: 0;
}

.hero p {
    font-size: 18px;
    color: #475569;
    margin-bottom: 30px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid rgba(55, 215, 134, .35);
    color: var(--green-900);
    padding: 6px 16px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 22px;
}

.hero-badge .dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green-600);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 46px;
    justify-content: center;
    margin-top: 44px;
    flex-wrap: wrap;
}

.hero-stat b {
    display: block;
    font-size: 28px;
    color: var(--green-900);
    font-weight: 800;
    line-height: 1.2;
}

.hero-stat span {
    font-size: 13px;
    color: var(--ink-3);
}

/* ==================== 功能介绍 ==================== */
.features {
    padding: 56px 0;
}

.section-head {
    text-align: center;
    margin-bottom: 36px;
}

.section-head h2 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.3px;
    margin-bottom: 8px;
}

.section-head p {
    color: var(--ink-3);
    font-size: 15px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--green-soft);
    padding: 38px 26px;
    border-radius: var(--r-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all .3s;
    border: 1px solid rgba(55, 215, 134, .1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    color: #27ae60;
    font-size: 34px;
    margin-bottom: 16px;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(55, 215, 134, .14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.feature-card h3 {
    font-size: 19px;
    color: #27ae60;
    margin-bottom: 8px;
    font-weight: 700;
}

.feature-card p {
    color: var(--ink-3);
    font-size: 14px;
}

/* ==================== 排行榜 ==================== */
.ranking-section {
    padding: 56px 0;
    background: white;
}

.section-title {
    position: relative;
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 36px;
    letter-spacing: -.3px;
}

.section-title i {
    color: var(--gold);
    margin-right: 6px;
}

.ranking-table {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    overflow: hidden;
}

.ranking-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 150px;
    padding: 16px 20px;
    background: var(--bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-3);
}

.ranking-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 150px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    align-items: center;
    transition: background .2s;
}

.ranking-item:hover {
    background: #fbfdfc;
}

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

.ranking-item.current-user {
    background: var(--blue-bg);
}

.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.medal .icon {
    font-size: 14px;
}

.medal-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 2px 8px rgba(255, 215, 0, .4);
}

.medal-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    box-shadow: 0 2px 8px rgba(192, 192, 192, .4);
}

.medal-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    box-shadow: 0 2px 8px rgba(205, 127, 50, .4);
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--ink-3);
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--green-200);
}

.avatar-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green-200);
    font-size: 16px;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
}

.nickname {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.days-badge {
    background: var(--blue-bg);
    color: var(--blue);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.weight-loss {
    color: var(--green-600);
    font-weight: 600;
}

.weight-gain {
    color: var(--red);
    font-weight: 600;
}

.progress-mini {
    width: 80px;
    height: 6px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.progress-bar-mini {
    height: 100%;
    background: var(--green-600);
    border-radius: 3px;
    transition: width .6s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--ink-3);
    display: inline-block;
    min-width: 34px;
}

.view-all-container {
    text-align: center;
    margin-top: 30px;
}

/* ==================== 友情链接 ==================== */
.friendly-links-section {
    padding: 48px 0;
    background: var(--bg);
    margin-top: 30px;
}

.friendly-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.friendly-links-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
}

.friendly-links-header h2 i {
    color: var(--green-600);
    margin-right: 6px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--ink);
    transition: all .3s;
    gap: 12px;
}

.link-card:hover {
    border-color: var(--green-600);
    box-shadow: 0 4px 12px rgba(16, 185, 129, .13);
    transform: translateY(-2px);
}

.link-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--r-sm);
    background: var(--bg);
    flex-shrink: 0;
}

.link-logo-default {
    width: 48px;
    height: 48px;
    background: var(--grad);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-info p {
    font-size: 12px;
    color: var(--ink-3);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-arrow {
    opacity: 0;
    transition: opacity .3s;
    color: var(--ink-4);
}

.link-card:hover .link-arrow {
    opacity: 1;
}

.apply-link-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.section-desc {
    color: var(--ink-3);
    margin-bottom: 24px;
}

.apply-tips {
    margin-top: 24px;
    padding: 20px;
    background: #fef3c7;
    border-radius: var(--r-sm);
    border-left: 4px solid var(--amber);
}

.apply-tips h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #b45309;
}

.apply-tips ul {
    list-style: none;
}

.apply-tips li {
    font-size: 13px;
    color: #92400e;
    padding: 4px 0 4px 20px;
    position: relative;
}

.apply-tips li:before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--amber);
}

/* ==================== 页脚 ==================== */
.footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--ink-4);
    font-size: 14px;
    background: var(--bg);
}

.footer a {
    color: var(--ink-4);
    text-decoration: none;
}

.footer a:hover {
    color: var(--green-600);
}

/* ==================== 侧边栏社交 ==================== */
.sidebar-social {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.social-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all .3s;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    border: none;
}

.social-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.social-btn .icon {
    font-size: 22px;
}

.social-tooltip {
    position: absolute;
    right: 60px;
    background: var(--ink);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    pointer-events: none;
}

.social-btn:hover .social-tooltip {
    opacity: 1;
    visibility: visible;
    right: 55px;
}

/* ==================== 微信二维码弹窗 ==================== */
.wechat-qrcode-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, .45);
}

.wechat-qrcode-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-modal-content {
    background: white;
    border-radius: var(--r-lg);
    padding: 0;
    max-width: 260px;
    width: calc(100% - 40px);
    animation: slideIn .3s ease;
    box-shadow: var(--shadow-xl);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.qrcode-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.qrcode-modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.qrcode-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--ink-3);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-close:hover {
    background: #f1f5f9;
    color: var(--ink);
}

.qrcode-modal-body {
    padding: 18px;
    text-align: center;
}

.qrcode-modal-body img,
.qrcode-modal-body svg {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 2px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 14px;
    background: white;
}

.qrcode-modal-body p {
    color: var(--ink-3);
    font-size: 13px;
}

/* ==================== 移动端底部导航 ==================== */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--line);
    display: none;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--ink-3);
    padding: 4px 12px;
    transition: all .3s;
    min-width: 0;
    font-size: 11px;
}

.mobile-nav-item .icon {
    font-size: 18px;
    margin-bottom: 3px;
}

.mobile-nav-item.active {
    color: var(--green-600);
    font-weight: 600;
}

/* ==================== 汉堡菜单 ==================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all .3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 999;
    opacity: 0;
    transition: opacity .3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* ==================== 内容包装 ==================== */
.content-wrapper {
    padding-top: 30px;
    padding-bottom: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.main-content {
    min-width: 0;
}

.page-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--grad);
    color: var(--green-900);
    border-radius: var(--r-md);
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 30px;
    margin-bottom: 8px;
    font-weight: 800;
}

.page-header p {
    font-size: 15px;
    opacity: .88;
}

.content-card {
    background: white;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    overflow: hidden;
}

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.card-body {
    padding: 22px;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group .required {
    color: var(--red);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: white;
    transition: all .2s;
}

.form-group textarea {
    resize: vertical;
    min-height: 96px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(55, 215, 134, .16);
}

.form-group input:disabled {
    background: var(--bg);
    color: var(--ink-3);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink-3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
    color: var(--ink-3);
    font-size: 13px;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--green-600);
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: var(--r-sm);
    margin-bottom: 18px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: var(--green-700);
    border: 1px solid #a7f3d0;
}

.alert-info {
    background: var(--blue-bg);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.alert.hidden {
    display: none;
}

/* ==================== 认证页 ==================== */
.auth-page {
    background: var(--grad);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    padding-top: calc(var(--nav-h) + 30px);
}

.auth-container {
    width: 100%;
    max-width: 460px;
}

.auth-header {
    text-align: center;
    color: white;
    margin-bottom: 24px;
}

.auth-header .hero-logo {
    margin: 0 auto 14px;
}

.auth-header h1 {
    font-size: 22px;
    color: var(--green-900);
    margin-bottom: 6px;
    font-weight: 800;
}

.auth-header p {
    color: rgba(0, 119, 59, .78);
    font-size: 14px;
}

.auth-form {
    background: white;
    padding: 34px;
    border-radius: var(--r-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 20px;
}

.auth-form hr {
    margin: 22px 0;
    border: none;
    border-top: 1px solid var(--line);
}

.auth-footer {
    text-align: center;
    margin-top: 18px;
    color: var(--ink-3);
    font-size: 14px;
}

.auth-footer a {
    color: var(--green-600);
    text-decoration: none;
    font-weight: 600;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 22px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    text-align: center;
}

.stat-label {
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 27px;
    font-weight: 800;
    line-height: 1.25;
}

.stat-value small {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-4);
    margin-left: 2px;
}

.trend-down {
    color: var(--green-600);
}

.trend-up {
    color: var(--red);
}

/* ==================== 个人头部卡片 ==================== */
.header {
    text-align: center;
    padding: 34px 20px;
    background: var(--grad);
    color: var(--green-900);
    border-radius: var(--r-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.header h1 {
    margin-bottom: 10px;
    font-size: 30px;
    font-weight: 800;
}

.header p {
    opacity: .88;
    font-size: 15px;
}

/* ==================== 进度条 ==================== */
.progress-section {
    background: white;
    padding: 24px;
    border-radius: var(--r-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
}

.progress-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.progress-title span {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
}

.progress-bar-container {
    background: var(--line);
    border-radius: 999px;
    height: 24px;
    overflow: hidden;
    margin: 16px 0 12px;
}

.progress-bar {
    height: 100%;
    background: var(--grad-bar);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    min-width: 40px;
    transition: width .5s ease;
    white-space: nowrap;
}

.progress-legend {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-4);
}

/* ==================== 明细 summary ==================== */
.summary-section {
    background: white;
    padding: 24px;
    border-radius: var(--r-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
}

.summary-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--ink);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.summary-item {
    text-align: center;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--r-md);
}

.summary-label {
    font-size: 12px;
    color: var(--ink-3);
    margin-bottom: 6px;
}

.summary-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

/* ==================== 打卡记录网格 ==================== */
.records-container {
    background: white;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    overflow-x: auto;
}

.records-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
}

.record-item {
    flex: 0 0 calc(10% - 8px);
    max-width: 125px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--line);
    aspect-ratio: 1 / 1;
    transition: all .2s;
    gap: 4px;
}

.record-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    z-index: 1;
}

.record-item.today {
    border-color: var(--green-600);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}

.record-item.future {
    opacity: .55;
}

.record-item.future:hover {
    transform: none;
    box-shadow: none;
}

.record-day-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--grad);
    color: white;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.day-badge.today {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.day-badge.future {
    background: #cbd5e1;
}

.record-date {
    font-size: 10px;
    color: var(--ink-3);
}

.today-label {
    color: var(--green-600);
    font-size: 10px;
    font-weight: 700;
}

.future-label {
    color: var(--ink-4);
    font-size: 10px;
}

.record-weight-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.record-weight-label {
    font-size: 11px;
    color: var(--ink-4);
}

.weight-input {
    width: 100%;
    max-width: 72px;
    padding: 4px 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    color: var(--ink);
    transition: all .2s;
    -moz-appearance: textfield;
}

.weight-input::-webkit-outer-spin-button,
.weight-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.weight-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.weight-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    color: var(--ink-4);
}

.weight-input.saving {
    border-color: var(--blue) !important;
}

.weight-input.saved {
    border-color: var(--green-600) !important;
}

.weight-input.error {
    border-color: #ef4444 !important;
}

.record-change-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    margin-top: auto;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    gap: 2px;
    white-space: nowrap;
}

.change-down {
    background: #d1fae5;
    color: var(--green-700);
}

.change-up {
    background: var(--red-bg);
    color: var(--red);
}

.change-same {
    background: #e0e7ff;
    color: #4f46e5;
}

.pending-badge {
    background: #f1f5f9;
    color: var(--ink-4);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
}

.waiting-badge {
    color: var(--ink-4);
    font-size: 11px;
}

/* ==================== 趋势图 ==================== */
.chart-box {
    background: white;
    padding: 22px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    margin-bottom: 24px;
}

.chart-box svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-empty {
    text-align: center;
    color: var(--ink-4);
    padding: 40px 10px;
    font-size: 14px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--ink-3);
}

.empty-state .empty-icon {
    font-size: 40px;
    color: var(--green-200);
    margin-bottom: 14px;
}

.empty-state p {
    margin-bottom: 18px;
    font-size: 14px;
}

/* ==================== 建议卡片 ==================== */
.tips-list {
    display: grid;
    gap: 12px;
}

.tip-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--green-soft);
    border-radius: var(--r-md);
    font-size: 14px;
    color: var(--ink-2);
    border-left: 3px solid var(--green-500);
}

.tip-row .icon {
    color: var(--green-600);
    margin-top: 2px;
}

/* ==================== Toast ==================== */
.toast-wrap {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, .92);
    color: white;
    padding: 10px 20px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    animation: toastIn .25s ease;
    backdrop-filter: blur(6px);
    max-width: 88vw;
    text-align: center;
}

.toast.ok {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.err {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 海报弹窗 ==================== */
.poster-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.poster-modal.active {
    display: flex;
}

.poster-inner {
    background: white;
    border-radius: var(--r-lg);
    padding: 18px;
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: slideIn .3s ease;
}

.poster-inner canvas {
    width: 100%;
    height: auto;
    border-radius: var(--r-md);
    display: block;
    border: 1px solid var(--line);
}

.poster-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.poster-actions .btn {
    flex: 1;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .records-grid {
        flex-wrap: wrap;
    }

    .record-item {
        flex: 0 0 calc(20% - 8px);
        max-width: none;
        aspect-ratio: auto;
        min-height: 130px;
    }

    .record-day-info {
        flex-direction: row;
        gap: 8px;
    }

    .day-badge {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .record-date {
        font-size: 12px;
    }

    .weight-input {
        max-width: none;
        padding: 7px 10px;
        font-size: 14px;
    }

    .sidebar-social {
        display: none;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        transition: all .3s ease;
        z-index: 1000;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid var(--line);
        font-size: 15px;
        color: var(--ink-2);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a.btn-primary {
        margin: 12px 20px;
        padding: 12px 20px;
        text-align: center;
        border-bottom: none;
        border-radius: var(--r-pill);
    }

    .hero {
        padding: 56px 18px 52px;
    }

    .hero h1 {
        font-size: 30px;
        gap: 10px;
    }

    .hero-logo {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 22px;
    }

    .hero p {
        font-size: 15px;
    }

    .hero-stats {
        gap: 26px;
        margin-top: 32px;
    }

    .hero-stat b {
        font-size: 22px;
    }

    .section-title,
    .section-head h2 {
        font-size: 23px;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .feature-card {
        padding: 24px 14px;
    }

    .feature-icon {
        width: 52px;
        height: 52px;
        font-size: 26px;
        border-radius: 16px;
        margin-bottom: 12px;
    }

    .feature-card h3 {
        font-size: 16px;
    }

    .feature-card p {
        font-size: 12.5px;
    }

    .features,
    .ranking-section,
    .friendly-links-section {
        padding: 40px 0;
    }

    /* 排行榜：隐藏进度列，收窄 */
    .ranking-header,
    .ranking-item {
        grid-template-columns: 46px 1fr 82px 78px;
        padding: 12px 14px;
        gap: 4px;
    }

    .col-progress {
        display: none;
    }

    .col-weight,
    .col-days {
        text-align: right;
    }

    .nickname {
        max-width: 90px;
        font-size: 13.5px;
    }

    .avatar-sm,
    .avatar-default {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .days-badge {
        padding: 3px 9px;
        font-size: 12px;
    }

    .weight-loss,
    .weight-gain {
        font-size: 13.5px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-form {
        padding: 24px 20px;
    }

    .content-wrapper {
        padding-left: 14px;
        padding-right: 14px;
        padding-top: 18px;
    }

    .page-header {
        padding: 28px 16px;
    }

    .page-header h1 {
        font-size: 23px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    .record-item {
        flex: 0 0 calc(50% - 8px);
        min-height: 120px;
        padding: 12px;
    }

    .records-grid {
        padding: 12px;
        gap: 10px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-body {
        padding: 16px;
    }

    .header {
        padding: 26px 16px;
    }

    .header h1 {
        font-size: 23px;
    }

    .friendly-links-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* 移动端悬浮胶囊底栏 */
    .mobile-nav {
        flex-flow: nowrap;
        align-items: center;
        justify-content: space-around;
        margin: 0 16px 2vh;
        padding: 10px 8px;
        border-radius: 50vh;
        border-top: none;
        background: rgba(255, 255, 255, .72);
        -webkit-backdrop-filter: saturate(2) blur(12px);
        backdrop-filter: saturate(2) blur(12px);
        box-shadow: 0 4px 6px -2px rgba(0, 0, 0, .1), 4px 0 6px -2px rgba(0, 0, 0, .1);
        display: flex;
        bottom: 0;
        left: 0;
        right: 0;
    }

    body {
        padding-bottom: 78px;
    }

    .toast-wrap {
        bottom: 100px;
    }

    .qrcode-modal-content {
        max-width: 280px;
    }
}

@media (max-width: 400px) {
    .hero h1 {
        font-size: 25px;
    }

    .record-item {
        flex: 0 0 100%;
    }

    .ranking-header,
    .ranking-item {
        grid-template-columns: 40px 1fr 74px 70px;
        padding: 10px 10px;
    }
}

/* ==================== 打印 / 动效偏好 ==================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
