/* =========================================
   每日减脂计划 - 全局样式
   ========================================= */

/* CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 品牌色：低饱和墨绿，避免高亮渐变 */
    --brand: #1f6f5c;
    --brand-dark: #185748;
    --brand-soft: #e9f1ee;

    /* 中性色 */
    --ink: #23262b;        /* 标题 */
    --body: #4c525a;       /* 正文 */
    --muted: #828a93;      /* 次要信息 */
    --line: #e3e1dc;       /* 分隔线 */
    --line-strong: #d3d0ca;
    --page: #fafaf8;       /* 页面底色（暖白） */
    --surface: #ffffff;
    --surface-alt: #f4f3f0;/* 交替分区底色 */

    /* 兼容后台内联引用的变量 */
    --gray-50: #f6f6f5;
    --gray-100: #ececeb;
    --gray-200: #e0dfdc;
    --gray-300: #c9c8c3;
    --gray-400: #989da3;
    --gray-500: #71767d;
    --gray-600: #565b62;
    --gray-700: #43474d;
    --gray-800: #303337;
    --gray-900: #23262b;
    --emerald-50: #eef4f2;
    --emerald-100: #d7e8e3;
    --emerald-200: #b2d2ca;
    --emerald-300: #7db3a6;
    --emerald-500: var(--brand);
    --emerald-600: var(--brand-dark);
    --emerald-700: #14493c;

    --shadow-sm: 0 1px 2px rgba(35, 38, 43, 0.05);
    --shadow-md: 0 4px 12px rgba(35, 38, 43, 0.08);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    line-height: 1.65;
    color: var(--body);
    background: var(--page);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 容器 */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* =========================================
   入场动画（滚动可见时淡入，尊重系统减弱动效设置）
   ========================================= */

html.js .animate-fade-in {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js .animate-fade-in.is-in {
    opacity: 1;
    transform: none;
}

.delay-100 { transition-delay: 0.08s; animation-delay: 0.1s; }
.delay-200 { transition-delay: 0.16s; animation-delay: 0.2s; }
.delay-300 { transition-delay: 0.24s; animation-delay: 0.3s; }
.delay-400 { transition-delay: 0.32s; animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html.js .animate-fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .btn-click:active { transform: none; }
}

/* 按钮点击反馈 */
.btn-click:active {
    transform: scale(0.98);
}

/* =========================================
   Header
   ========================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(250, 250, 248, 0.96);
    border-bottom: 1px solid var(--line);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    max-width: 1120px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.logo-icon {
    width: 1.75rem;
    height: 1.75rem;
    background: var(--brand);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

/* 后台上传的 APP 图标（顶部 Logo 位置） */
.logo-icon-img {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    background: var(--surface-alt);
}

.logo-text {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.nav {
    display: none;
}

@media (min-width: 768px) {
    .nav {
        display: flex;
        gap: 1.75rem;
    }
}

.nav a {
    color: var(--body);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: var(--brand);
}

/* =========================================
   Hero
   ========================================= */

.hero {
    padding: 9rem 0 4.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--page);
}

.hero-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--brand);
    margin-bottom: 1rem;
}

/* 后台上传的 APP 图标（hero 位置） */
.hero-icon {
    margin-bottom: 1.5rem;
}

.hero-icon img {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1rem;
    object-fit: cover;
    display: block;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 2.875rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.hero-desc {
    font-size: 1.0625rem;
    color: var(--body);
    max-width: 40rem;
    margin-bottom: 2.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* 前台按钮 */
.site-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.site-btn--primary {
    background: var(--brand);
    color: #fff;
}

.site-btn--primary:hover {
    background: var(--brand-dark);
}

.site-btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}

.site-btn--ghost:hover {
    border-color: var(--muted);
    background: var(--surface);
}

/* =========================================
   Features Section
   ========================================= */

.features {
    padding: 4.5rem 0;
    background: var(--surface);
}

.features-header {
    margin-bottom: 2.5rem;
}

.features-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.features-desc {
    color: var(--muted);
    font-size: 0.9375rem;
    max-width: 40rem;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    overflow: hidden;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-card {
    background: var(--surface);
    padding: 1.75rem 1.5rem;
    transition: background 0.2s ease;
}

.feature-card:hover {
    background: #fbfbfa;
}

.feature-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    margin-bottom: 1.125rem;
}

.feature-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.feature-desc {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.65;
}

/* =========================================
   Screenshots Section
   ========================================= */

.screenshots {
    padding: 4.5rem 0;
    background: var(--surface-alt);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.screenshots-header {
    margin-bottom: 2.5rem;
}

.screenshots-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.screenshots-desc {
    color: var(--muted);
    font-size: 0.9375rem;
}

.screenshots-grid {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

@media (min-width: 900px) {
    .screenshots-grid {
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: visible;
    }
}

.screenshot-item {
    flex-shrink: 0;
    width: 180px;
}

.screenshot-frame {
    background: var(--ink);
    border-radius: 1.25rem;
    padding: 0.4375rem;
    box-shadow: var(--shadow-md);
}

.screenshot-screen {
    border-radius: 0.875rem;
    background: #e9e8e4;
    aspect-ratio: 9/16;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 截图缺失时的占位文案 */
.screenshot-empty {
    font-size: 0.75rem;
    color: var(--muted);
}

.screenshot-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
}

/* =========================================
   About Section
   ========================================= */

.about {
    padding: 4.5rem 0;
    background: var(--surface);
}

.about-content {
    max-width: 44rem;
}

.about-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.25rem;
}

.about-card {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    padding: 1.5rem;
}

.about-company {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.625rem;
}

.about-desc {
    color: var(--body);
    font-size: 0.9375rem;
    line-height: 1.8;
}

/* =========================================
   Download Section
   ========================================= */

.download {
    padding: 4.5rem 0;
    background: var(--surface-alt);
    border-top: 1px solid var(--line);
}

.download-content {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .download-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.download-text {
    max-width: 32rem;
}

/* 后台上传的 APP 图标（下载区位置） */
.download-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    object-fit: cover;
    display: block;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
}

.download-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.download-desc {
    color: var(--muted);
    font-size: 0.9375rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--brand);
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.download-btn:hover {
    background: var(--brand-dark);
}

.download-contact {
    margin-top: 0.875rem;
    color: var(--muted);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .download-contact {
        margin-top: 1rem;
    }
}

/* =========================================
   Footer
   ========================================= */

.footer {
    padding: 3rem 1rem 2.5rem;
    background: #2a2e33;
    color: #9aa1a8;
    font-size: 0.875rem;
}

.footer-content {
    max-width: 1120px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.footer-logo-icon {
    width: 1.5rem;
    height: 1.5rem;
    background: var(--brand);
    border-radius: 0.3125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* 后台上传的 APP 图标（页脚位置） */
.footer-logo-icon-img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.3125rem;
    object-fit: cover;
    display: block;
    background: #3a3f45;
}

.footer-logo-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #e6e8ea;
}

.footer-contact {
    margin-bottom: 1.5rem;
}

.footer-contact p {
    margin-bottom: 0.25rem;
}

.footer-divider {
    border-top: 1px solid #3a3f45;
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .footer-divider {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-filings p {
    margin-bottom: 0.125rem;
}

.footer-copy {
    color: #6f767d;
}

/* =========================================
   后台/通用组件（dashboard.php、login.php 依赖）
   ========================================= */

.admin-body {
    background: var(--gray-100);
}

.admin-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* 卡片 */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
}

.card-body {
    padding: 1.5rem;
}

/* 表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 92, 0.12);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* 按钮（后台） */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--brand);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--surface);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-sm {
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-danger {
    background: #b94a4a;
    color: white;
}

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

/* 警告框 */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.alert-warning {
    background: #faf3e3;
    border: 1px solid #e5d3a8;
    color: #7a5a22;
}

.alert-success {
    background: var(--brand-soft);
    border: 1px solid var(--emerald-200);
    color: var(--emerald-700);
}

.alert-error {
    background: #f9e9e9;
    border: 1px solid #e3bcbc;
    color: #8f3636;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}

.tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
}

.tab:hover {
    color: var(--ink);
}

.tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
}

.table tr:hover td {
    background: var(--gray-50);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--emerald-100);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.25s ease;
    max-width: calc(100vw - 2rem);
}

@keyframes slideIn {
    from {
        transform: translateY(-0.5rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-success {
    background: var(--brand-dark);
}

.toast-error {
    background: #b94a4a;
}
