/* ========================================
 * 那几天 - Premium Design System
 * 勃艮第 + 玫瑰金 高端配色
 * ======================================== */

/* ===== 设计变量 ===== */
:root {
    /* 主色系 - 勃艮第 */
    --primary: #7A2E3B;
    --primary-light: #A05A66;
    --primary-lighter: #C98B95;
    --primary-dark: #5A1E29;
    --primary-bg: #F7EEF0;
    --primary-bg-soft: #FBF5F6;

    /* 强调色 - 玫瑰金 */
    --accent: #D9A395;
    --accent-light: #EBC9BF;
    --accent-bg: #FBF1EE;

    /* 背景 */
    --bg: #F7F2F4;
    --card-bg: #FFFFFF;
    --surface: #F3EAEC;

    /* 文字 */
    --text-primary: #2A1A1E;
    --text-secondary: #7A5E63;
    --text-tertiary: #B39CA1;

    /* 边框与阴影 */
    --border: #EFE4E6;
    --border-strong: #E0D0D3;
    --shadow-xs: 0 1px 2px rgba(80, 25, 35, 0.04);
    --shadow-sm: 0 1px 3px rgba(80, 25, 35, 0.05), 0 4px 12px rgba(80, 25, 35, 0.03);
    --shadow-md: 0 2px 8px rgba(80, 25, 35, 0.06), 0 8px 24px rgba(80, 25, 35, 0.04);
    --shadow-lg: 0 8px 30px rgba(122, 46, 59, 0.12);
    --shadow-primary: 0 4px 20px rgba(122, 46, 59, 0.25);

    /* 圆角 */
    --radius-xl: 20px;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;

    /* 尺寸 */
    --nav-height: 62px;
    --header-height: 54px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== 重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #E8E4EE;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    letter-spacing: 0.2px;
}

#app {
    max-width: 430px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(45, 30, 60, 0.08);
}

/* ===== 页面切换 ===== */
.page {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    background: var(--bg);
}

.page.active {
    display: flex;
    animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 页面头部 ===== */
.page-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.header-date {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.header-action-btn {
    background: var(--primary-bg);
    border: none;
    color: var(--primary);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.header-action-btn:active {
    transform: scale(0.92);
    background: var(--primary-lighter);
}

/* ===== 滚动区域 ===== */
.scroll-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
}

.scroll-content::-webkit-scrollbar {
    display: none;
}

.bottom-spacer {
    height: calc(var(--nav-height) + var(--safe-bottom) + 24px);
}

/* ===== 日历卡片 ===== */
.calendar-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 22px 18px 18px;
    margin-top: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.cal-btn {
    background: var(--surface);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s;
}

.cal-btn:active {
    transform: scale(0.88);
    background: var(--primary-lighter);
}

.cal-month-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}

.calendar-weekdays span {
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 4px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    cursor: pointer;
    position: relative;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.cal-day:active {
    transform: scale(0.9);
}

.cal-day.empty {
    cursor: default;
}

.cal-day.today {
    font-weight: 700;
    color: var(--primary);
}

.cal-day.today::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.cal-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow-primary);
}

.cal-day.selected::after {
    background: var(--accent-light);
}

/* 经期 */
.cal-day.period {
    background: rgba(93, 62, 140, 0.1);
    color: var(--primary-dark);
    font-weight: 600;
}

.cal-day.period::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

/* 经期第一天（初始化标记日期） */
.cal-day.period-start {
    background: var(--primary);
    color: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1px;
}

.cal-day.period-start span:first-child {
    font-weight: 700;
}

.cal-day.period-start::before {
    display: none;
}

.period-start-label {
    font-size: 9px;
    line-height: 1;
    font-weight: 600;
    opacity: 0.9;
}

/* 排卵日 */
.cal-day.ovulation {
    background: rgba(200, 165, 91, 0.12);
    color: #A6843C;
}

.cal-day.ovulation::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* 易孕期 */
.cal-day.fertile {
    background: rgba(200, 165, 91, 0.06);
    color: #A6843C;
}

/* 预测 */
.cal-day.predicted {
    color: var(--primary-lighter);
}

.cal-day.predicted::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px dashed var(--primary-light);
}

.cal-day.selected.period,
.cal-day.selected.ovulation,
.cal-day.selected.fertile,
.cal-day.selected.predicted {
    background: var(--primary);
    color: #fff;
}

.cal-day.selected.period::before,
.cal-day.selected.ovulation::before,
.cal-day.selected.fertile::before,
.cal-day.selected.predicted::before {
    background: var(--accent-light);
    border: none;
}

/* 图例 */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.period-dot { background: var(--primary); }
.legend-dot.ovulation-dot { background: var(--accent); }
.legend-dot.fertile-dot { background: var(--accent-light); }
.legend-dot.predicted-dot { border: 1px dashed var(--primary-light); }

/* ===== 快捷操作 ===== */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.quick-btn {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
    color: var(--primary);
}

.quick-btn:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-sm);
}

.quick-btn span {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

.mark-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.mark-btn span {
    color: #fff;
}

/* ===== 周期信息卡 ===== */
.cycle-info-card {
    background: linear-gradient(145deg, #4A1822 0%, #7A2E3B 50%, #A05A66 100%);
    border-radius: var(--radius-xl);
    padding: 26px 22px;
    margin-top: 14px;
    color: #fff;
    box-shadow: 0 8px 30px rgba(90, 30, 41, 0.3);
    position: relative;
    overflow: hidden;
}

.cycle-info-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 165, 91, 0.15), transparent 70%);
}

.cycle-info-empty {
    text-align: center;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

.cycle-info-empty .empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.cycle-info-empty p {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.7;
}

.cycle-day-big {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cycle-day-big .day-num {
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #fff, #EBC9BF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cycle-day-big .day-label {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.cycle-phase-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 13px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.cycle-info-detail {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 1;
}

.cycle-info-detail .detail-item {
    text-align: center;
}

.cycle-info-detail .detail-value {
    font-size: 15px;
    font-weight: 700;
}

.cycle-info-detail .detail-label {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 3px;
    letter-spacing: 0.3px;
}

/* 经期结束时间横幅 */
.period-end-banner {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(224, 198, 138, 0.35);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.period-end-banner .pe-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.period-end-banner .pe-row + .pe-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.period-end-banner .pe-label {
    font-size: 12px;
    opacity: 0.75;
    white-space: nowrap;
}

.period-end-banner .pe-value {
    font-size: 13px;
    font-weight: 600;
    color: #F3E2B3;
    text-align: right;
}

.period-end-banner .pe-value b {
    color: #FFE7A8;
    font-size: 15px;
}

/* ===== 分析卡片 ===== */
.analysis-card,
.history-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 22px 18px;
    margin-top: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.analysis-item {
    background: var(--primary-bg-soft);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--border);
}

.analysis-item .a-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.analysis-item .a-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.1;
}

.analysis-item .a-unit {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.analysis-item .a-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ===== 历史记录 ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--primary-bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.history-item:active {
    background: var(--primary-bg);
}

.history-item .h-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.history-item .h-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.history-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ===== 几天（社区）页面 ===== */
.topic-tabs {
    display: flex;
    gap: 8px;
    padding: 14px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.topic-tabs::-webkit-scrollbar {
    display: none;
}

.topic-tab {
    flex-shrink: 0;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid var(--border);
    font-weight: 500;
}

.topic-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.post-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.post-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.post-topic-tag {
    margin-left: auto;
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid rgba(200, 165, 91, 0.2);
}

.post-content {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 12px;
    word-break: break-word;
}

.post-footer {
    display: flex;
    gap: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.post-action:active {
    transform: scale(0.9);
}

.post-action.liked {
    color: var(--primary);
}

.post-action.liked svg {
    fill: var(--primary);
}

.community-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.community-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ===== 我的页面 ===== */
.profile-header {
    position: relative;
    padding-bottom: 20px;
    text-align: center;
}

.profile-bg {
    height: 150px;
    background: linear-gradient(145deg, #4A1822 0%, #7A2E3B 40%, #A05A66 100%);
    border-radius: 0 0 28px 28px;
    position: relative;
    overflow: hidden;
}

.profile-bg::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 165, 91, 0.2), transparent 65%);
}

.profile-bg::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 111, 181, 0.3), transparent 65%);
}

.profile-avatar-wrap {
    position: relative;
    margin-top: -52px;
    display: inline-block;
    z-index: 1;
}

.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: 4px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    margin-top: 12px;
}

.profile-name {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.profile-bio {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.edit-profile-btn {
    margin-top: 12px;
    padding: 7px 22px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-profile-btn:active {
    background: var(--primary);
    color: #fff;
}

.profile-stats {
    display: flex;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    margin: 16px 0;
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.stat-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    width: 1px;
    background: var(--border);
}

.stat-num {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 3px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===== 菜单 ===== */
.menu-section {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 16px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.menu-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 56px;
    right: 16px;
    height: 1px;
    background: var(--border);
}

.menu-item:active {
    background: var(--primary-bg-soft);
}

.menu-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.menu-icon-wrap.pink { background: rgba(93, 62, 140, 0.1); color: var(--primary); }
.menu-icon-wrap.orange { background: rgba(200, 165, 91, 0.12); color: var(--accent); }
.menu-icon-wrap.purple { background: rgba(93, 62, 140, 0.1); color: var(--primary-light); }
.menu-icon-wrap.blue { background: rgba(58, 120, 177, 0.1); color: #3A78B1; }
.menu-icon-wrap.green { background: rgba(217, 163, 149, 0.12); color: #D9A395; }
.menu-icon-wrap.gray { background: rgba(100, 91, 115, 0.08); color: var(--text-secondary); }

.menu-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.menu-arrow {
    color: var(--text-tertiary);
}

.logout-btn {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: #C44A4A;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
}

.logout-btn:active {
    background: #FBF0F0;
    border-color: #E8C8C8;
}

.version-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 16px;
    letter-spacing: 0.5px;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--border);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
    padding-top: 8px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.95);
}

/* ===== 弹窗通用 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 22, 34, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: overlayIn 0.25s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes overlayIn {
    from { background: rgba(28, 22, 34, 0); }
    to { background: rgba(28, 22, 34, 0.45); }
}

.modal-content {
    background: var(--card-bg);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 430px;
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

.modal-submit {
    background: var(--primary);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 7px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-primary);
}

.modal-submit:active {
    transform: scale(0.94);
    background: var(--primary-dark);
}

.modal-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== 发帖弹窗 ===== */
.topic-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.topic-select-item {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.topic-select-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.post-textarea {
    width: 100%;
    min-height: 150px;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    font-family: inherit;
}

.post-textarea::placeholder {
    color: var(--text-tertiary);
}

.post-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ===== 症状弹窗 ===== */
.symptom-section {
    margin-bottom: 20px;
}

.symptom-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.symptom-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.symptom-option {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    font-weight: 500;
}

.symptom-option.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: border 0.2s;
    font-family: inherit;
    background: var(--card-bg);
}

.form-input:focus {
    border-color: var(--primary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.number-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.num-btn {
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--border-strong);
    background: var(--card-bg);
    border-radius: 11px;
    font-size: 20px;
    color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.num-btn:active {
    background: var(--primary-bg);
    border-color: var(--primary);
}

.num-input {
    text-align: center;
    flex: 1;
}

/* ===== 评论弹窗 ===== */
.comment-overlay {
    align-items: flex-end;
}

.comment-modal-content {
    max-height: 70vh;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
    -webkit-overflow-scrolling: touch;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.comment-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 4px;
    line-height: 1.5;
}

.comment-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.comment-input-bar {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    padding-bottom: calc(12px + var(--safe-bottom));
}

.comment-input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: var(--surface);
}

.comment-input:focus {
    border-color: var(--primary);
    background: var(--card-bg);
}

.comment-send {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 0 20px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-primary);
}

.comment-send:active {
    transform: scale(0.94);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(28, 22, 34, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    padding: 13px 30px;
    border-radius: 14px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    max-width: 80%;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* ===== 子列表项 ===== */
.sub-list-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}

.sub-list-item .item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.sub-list-item .item-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sub-list-item .item-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ===== 登录 / 注册 ===== */
.login-overlay {
    background: rgba(28, 22, 34, 0.55);
    align-items: center;
    z-index: 2000;
}
.login-overlay.show { display: flex; }
.login-box {
    background: var(--card-bg);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    margin: 0 24px;
    padding: 36px 26px 28px;
    box-shadow: 0 20px 60px rgba(122, 46, 59, 0.28);
    animation: loginPop 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    text-align: center;
}
@keyframes loginPop {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fff, #EBC9BF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-color: #7A2E3B;
    -webkit-text-fill-color: #7A2E3B;
}
.login-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 28px;
}
.login-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text-tertiary);
    transition: border-color 0.2s;
}
.login-field:focus-within {
    border-color: var(--primary);
    color: var(--primary);
}
.login-field input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: 1px;
}
.login-code-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.login-code-input { flex: 1; }
.login-code-btn {
    flex-shrink: 0;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 14px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.login-code-btn:active { transform: scale(0.96); }
.login-code-btn:disabled {
    border-color: var(--border-strong);
    color: var(--text-tertiary);
    cursor: not-allowed;
}
.login-tip {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: left;
    margin: 14px 2px 18px;
}
.login-submit {
    width: 100%;
    border: none;
    background: linear-gradient(145deg, #7A2E3B 0%, #A05A66 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    padding: 14px 0;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(122, 46, 59, 0.28);
    transition: transform 0.15s;
}
.login-submit:active { transform: scale(0.98); }
.login-privacy {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 16px;
}

/* ===== 我的页手机号 ===== */
.profile-phone {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    letter-spacing: 1px;
}
