/* 柯基日程 - 响应式样式表 */

/* CSS变量 */
:root {
    --primary: #F5A623;
    --primary-light: #FFD93D;
    --primary-dark: #E8913A;
    --secondary: #FFE4B5;
    --background: #FFF9F0;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --success: #7ED321;
    --danger: #FF6B6B;
    --border: #F0E6D8;
    --shadow: 0 4px 20px rgba(245, 166, 35, 0.15);
    --shadow-hover: 0 6px 25px rgba(245, 166, 35, 0.25);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --min-touch-height: 44px;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--background);
    position: relative;
}

.hidden {
    display: none !important;
}

/* 登录页 */
.auth-screen {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #FFF9F0 0%, #FFE8BE 100%);
}

.auth-panel {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-corgi {
    width: 108px;
    height: 108px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

.auth-copy {
    text-align: center;
    margin-bottom: 20px;
}

.auth-copy h1 {
    font-size: 24px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.auth-copy p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-message {
    min-height: 22px;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
    color: var(--text-secondary);
}

.auth-message.error {
    color: var(--danger);
}

.auth-message.success {
    color: #4B8E14;
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.auth-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* 页面容器 */
.page-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.page.active {
    display: flex;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 16px 16px 20px;
    padding-top: 64px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.sign-out-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}

.sign-out-btn:hover {
    background: rgba(255,255,255,0.28);
}

.sign-out-btn svg {
    width: 20px;
    height: 20px;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.corgi-decoration {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 60px;
    height: 60px;
    opacity: 0.38;
    pointer-events: none;
}

.corgi-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.today-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.today-heading {
    flex: 1 1 auto;
    min-width: 0;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-display {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 0;
}

.user-display {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 今日进度 */
.today-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.progress-ring {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: rgba(255,255,255,0.3);
    stroke-width: 8;
}

.progress-bar {
    fill: none;
    stroke: white;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-text span {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.progress-text small {
    font-size: 10px;
    opacity: 0.9;
}

.progress-stats {
    flex: 0 0 auto;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.stat-num.completed {
    color: #90EE90;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
    display: block;
}

/* 内容区域 */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.content-area::-webkit-scrollbar {
    display: none;
}

.stats-content {
    padding-bottom: 80px;
}

/* 日程列表 */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loading-state,
.error-state {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.error-state {
    color: var(--danger);
}

.schedule-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

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

.schedule-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.schedule-item.completed {
    opacity: 0.55;
    background: #F5F0EB;
}

.schedule-item.completed .schedule-title {
    text-decoration: line-through;
    color: var(--text-light);
}

.schedule-item.completed .schedule-time {
    color: var(--text-light);
}

.schedule-item.completed .schedule-note {
    color: #BBB;
}

.schedule-item.completed .checkbox {
    border-color: #CCC;
    background: #CCC;
}

.schedule-item.completed:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: none;
}

.checkbox {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-top: 2px;
    background: transparent;
    appearance: none;
}

.checkbox:hover {
    background: var(--secondary);
}

.checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.schedule-content {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    display: block;
    padding: 0;
}

.schedule-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.4;
}

.schedule-time {
    display: flex;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 4px;
    align-items: center;
    gap: 4px;
}

.schedule-note {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    word-break: break-word;
    line-height: 1.4;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-light);
}

.empty-state.hidden {
    display: none;
}

.empty-corgi {
    width: 120px;
    height: 120px;
    margin-bottom: 16px;
    opacity: 0.9;
    object-fit: contain;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 14px;
    opacity: 0.8;
}

/* 浮动按钮 */
.fab-btn {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    min-height: var(--min-touch-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.fab-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.5);
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-btn svg {
    width: 24px;
    height: 24px;
}

/* 底部导航 */
.bottom-nav {
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    min-height: var(--min-touch-height);
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    margin: 0 4px;
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary);
    background: var(--secondary);
}

.nav-item:active {
    transform: scale(0.95);
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 85vh;
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-corgi {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.close-btn {
    width: 36px;
    height: 36px;
    min-height: var(--min-touch-height);
    border: none;
    background: var(--background);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--border);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    max-height: 50vh;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--background);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
}

.form-group textarea {
    resize: none;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 12px 16px 24px;
    border-top: 1px solid var(--border);
}

.btn-secondary,
.btn-primary {
    flex: 1;
    padding: 14px 20px;
    min-height: var(--min-touch-height);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: var(--background);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(245, 166, 35, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 操作菜单 */
.action-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

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

.action-menu {
    background: var(--card-bg);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 16px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.action-btn {
    width: 100%;
    padding: 16px;
    min-height: var(--min-touch-height);
    border: none;
    background: none;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.action-btn.edit {
    color: var(--primary);
    background: var(--secondary);
}

.action-btn.delete {
    color: var(--danger);
    background: #FFE5E5;
}

.action-btn.cancel {
    color: var(--text-secondary);
    background: var(--background);
    margin-bottom: 0;
    margin-top: 8px;
}

.action-btn:hover {
    opacity: 0.9;
}

/* 统计页面样式 */
.header.compact {
    padding: 12px 16px;
    padding-top: 24px;
    border-radius: 0 0 var(--radius) var(--radius);
}

.week-range {
    font-size: 14px;
    opacity: 0.9;
}

.month-selector,
.year-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.month-nav,
.year-nav {
    width: 36px;
    height: 36px;
    min-height: var(--min-touch-height);
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.month-nav:hover,
.year-nav:hover {
    background: rgba(255,255,255,0.3);
}

#current-month-display,
#current-year-display {
    font-size: 16px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* 统计概览卡片 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.overview-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.overview-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.overview-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.overview-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 图表容器 */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.chart-container canvas {
    max-height: 220px;
    width: 100% !important;
}

/* 月统计样式 */
.month-stats {
    display: flex;
    justify-content: space-around;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 12px;
}

.month-stat-item {
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.month-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.month-stat-num.completed {
    color: var(--success);
}

.month-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 日历 */
.calendar-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.calendar-header span {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
}

.calendar-day:hover {
    background: var(--background);
}

.calendar-day.other-month {
    color: var(--text-light);
}

.calendar-day.today {
    background: var(--secondary);
    color: var(--primary);
    font-weight: 600;
}

.calendar-day.has-schedule::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}

.calendar-day.all-completed::after {
    background: var(--success);
}

/* 年统计样式 */
.year-overview {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.year-total-card {
    flex: 1;
    min-width: 140px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.year-total-icon {
    font-size: 32px;
}

.year-total-num {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.year-total-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.year-rate-card {
    min-width: 120px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow);
}

.year-rate-ring {
    position: relative;
    width: 70px;
    height: 70px;
    margin-bottom: 8px;
}

.year-rate-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.year-rate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.year-rate-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 柯基装饰 */
.corgi-week-decoration,
.corgi-month-decoration,
.corgi-year-decoration {
    text-align: center;
    margin-top: 16px;
    opacity: 0.85;
}

.corgi-img-deco,
.corgi-running,
.corgi-sleeping,
.corgi-celebrate {
    width: 100px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

/* 好友动态 */
.friends-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-panel,
.friend-add-panel,
.friends-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

.profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-head h3 {
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.profile-head p {
    max-width: 260px;
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-name-preview {
    max-width: 42%;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--secondary);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-edit-row,
.friend-add-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.profile-edit-row input,
.friend-add-row input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    font-size: 15px;
    font-family: inherit;
}

.profile-edit-row input:focus,
.friend-add-row input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
}

.btn-secondary.profile-save-btn,
.btn-primary.friend-add-btn {
    flex: 0 0 78px;
    padding: 0 14px;
    font-size: 15px;
}

.profile-hint {
    min-height: 18px;
    margin-top: 8px;
    color: var(--text-light);
    font-size: 12px;
    text-align: right;
}

.friends-message {
    min-height: 20px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.friends-message.error {
    color: var(--danger);
}

.friends-message.success {
    color: #4B8E14;
}

.friends-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.friends-section-header h3 {
    font-size: 16px;
    line-height: 1.3;
}

.friends-section-header span {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--secondary);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.refresh-feed-btn {
    font-size: 12px;
    padding: 2px 10px;
    white-space: nowrap;
}

.friend-request-list,
.friend-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-request,
.friend-card,
.friend-activity {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FFFCF8;
}

.friend-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
}

.friend-request-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friend-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mini-btn,
.icon-text-btn,
.reaction-btn {
    min-height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-btn {
    padding: 8px 12px;
    font-size: 13px;
}

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

.mini-btn.danger {
    background: #FFE5E5;
    color: var(--danger);
}

.mini-btn.ghost {
    background: var(--background);
    color: var(--text-secondary);
}

.friend-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.friend-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
}

.friend-card-main,
.friend-activity-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.friend-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 800;
}

.friend-avatar.compact {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.friend-card h4 {
    font-size: 15px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-card p {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-card-stats {
    text-align: right;
}

.friend-card-stats span {
    display: block;
    color: var(--primary);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.friend-card-stats small {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
}

.icon-text-btn {
    padding: 8px 10px;
    background: var(--background);
    color: var(--text-secondary);
    font-size: 13px;
}

.friend-activity {
    padding: 12px;
}

.friend-activity.completed {
    border-color: rgba(126, 211, 33, 0.35);
}

.friend-activity-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.friend-activity-meta strong,
.friend-activity-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-activity-meta strong {
    font-size: 14px;
}

.friend-activity-meta span {
    color: var(--text-secondary);
    font-size: 12px;
}

.activity-status {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--secondary);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.friend-activity.completed .activity-status {
    background: #E7F8D9;
    color: #4B8E14;
}

.friend-activity h4 {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
}

.friend-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reaction-btn {
    padding: 7px 10px;
    background: var(--background);
    color: var(--text-secondary);
    font-size: 13px;
}

.reaction-btn.active {
    background: var(--secondary);
    color: var(--primary-dark);
}

.mini-btn:hover,
.icon-text-btn:hover,
.reaction-btn:hover {
    transform: translateY(-1px);
}

.empty-friends {
    text-align: center;
    color: var(--text-light);
}

.empty-corgi.small {
    width: 84px;
    height: 84px;
    margin-bottom: 8px;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.schedule-item {
    animation: slideIn 0.3s ease;
}

.checkbox.checked {
    animation: bounce 0.3s ease;
}

/* ==================== 响应式媒体查询 ==================== */

/* 小屏手机 (≤360px) */
@media (max-width: 360px) {
    .header {
        padding: 12px 12px 16px;
        padding-top: 60px;
    }
    
    .corgi-decoration {
        width: 50px;
        height: 50px;
        top: 12px;
        right: 12px;
    }

    .today-header-content {
        gap: 10px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .date-display {
        font-size: 13px;
        margin-bottom: 0;
    }
    
    .progress-ring {
        width: 64px;
        height: 64px;
    }
    
    .progress-text span {
        font-size: 16px;
    }
    
    .stat-num {
        font-size: 20px;
    }
    
    .progress-stats {
        gap: 8px;
    }
    
    .schedule-item {
        padding: 12px;
        gap: 10px;
    }
    
    .checkbox {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }
    
    .schedule-title {
        font-size: 15px;
    }
    
    .schedule-time,
    .schedule-note {
        font-size: 13px;
    }
    
    .fab-btn {
        width: 50px;
        height: 50px;
        bottom: 70px;
        right: 12px;
    }
    
    .nav-item {
        padding: 8px 4px;
    }
    
    .nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
    
    .stats-overview {
        gap: 8px;
    }
    
    .overview-card {
        padding: 10px 8px;
    }
    
    .overview-icon {
        font-size: 20px;
    }
    
    .overview-num {
        font-size: 18px;
    }
    
    .month-stat-num {
        font-size: 20px;
    }
    
    .year-total-num {
        font-size: 22px;
    }
    
    .year-rate-ring {
        width: 60px;
        height: 60px;
    }
    
    .year-rate-text {
        font-size: 14px;
    }
    
    .corgi-img-deco {
        width: 80px;
    }
    
    .empty-corgi {
        width: 100px;
        height: 100px;
    }
}

/* 标准手机 (361px - 414px) */
@media (min-width: 361px) and (max-width: 414px) {
    .header {
        padding-top: 62px;
    }
    
    .corgi-decoration {
        width: 55px;
        height: 55px;
    }
    
    .progress-ring {
        width: 75px;
        height: 75px;
    }
}

/* 大屏手机/小平板 (415px - 768px) */
@media (min-width: 415px) and (max-width: 768px) {
    #app {
        max-width: 500px;
    }
    
    .header {
        padding: 20px;
        padding-top: 68px;
    }
    
    .corgi-decoration {
        width: 70px;
        height: 70px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .progress-ring {
        width: 85px;
        height: 85px;
    }
    
    .progress-text span {
        font-size: 20px;
    }
    
    .stat-num {
        font-size: 26px;
    }
    
    .fab-btn {
        bottom: 85px;
    }
    
    .chart-container canvas {
        max-height: 250px;
    }
}

/* 平板 (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    #app {
        max-width: 600px;
        margin-top: 20px;
        margin-bottom: 20px;
        height: calc(100% - 40px);
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    }
    
    .header {
        padding: 24px;
        padding-top: 76px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .header.compact {
        padding-top: 36px;
    }
    
    .corgi-decoration {
        width: 80px;
        height: 80px;
        top: 20px;
        right: 24px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .date-display {
        font-size: 16px;
    }
    
    .progress-ring {
        width: 100px;
        height: 100px;
    }
    
    .progress-text span {
        font-size: 24px;
    }
    
    .progress-text small {
        font-size: 12px;
    }
    
    .stat-num {
        font-size: 30px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .schedule-item {
        padding: 18px;
    }
    
    .schedule-title {
        font-size: 18px;
    }
    
    .schedule-time,
    .schedule-note {
        font-size: 15px;
    }
    
    .checkbox {
        width: 30px;
        height: 30px;
    }
    
    .fab-btn {
        width: 60px;
        height: 60px;
        bottom: 100px;
        right: calc(50% - 300px + 20px);
    }
    
    .nav-item {
        padding: 12px;
    }
    
    .nav-item svg {
        width: 26px;
        height: 26px;
    }
    
    .nav-item span {
        font-size: 14px;
    }
    
    .modal {
        max-width: 500px;
        border-radius: var(--radius-lg);
        margin: auto;
    }
    
    .modal-overlay {
        align-items: center;
    }
    
    .modal-overlay.active .modal {
        transform: translateY(0);
    }
    
    .action-menu {
        max-width: 400px;
        border-radius: var(--radius-lg);
        margin: auto;
    }
    
    .action-modal {
        align-items: center;
    }
    
    .stats-overview {
        gap: 16px;
    }
    
    .overview-card {
        padding: 16px;
    }
    
    .overview-icon {
        font-size: 32px;
    }
    
    .overview-num {
        font-size: 24px;
    }
    
    .overview-label {
        font-size: 14px;
    }
    
    .chart-container {
        padding: 24px;
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
    
    .month-stats {
        padding: 24px;
    }
    
    .month-stat-num {
        font-size: 28px;
    }
    
    .month-stat-label {
        font-size: 14px;
    }
    
    .calendar-container {
        padding: 20px;
    }
    
    .calendar-day {
        font-size: 16px;
    }
    
    .year-overview {
        gap: 20px;
    }
    
    .year-total-card {
        padding: 24px;
    }
    
    .year-total-icon {
        font-size: 40px;
    }
    
    .year-total-num {
        font-size: 32px;
    }
    
    .year-rate-card {
        min-width: 150px;
        padding: 20px;
    }
    
    .year-rate-ring {
        width: 90px;
        height: 90px;
    }
    
    .year-rate-text {
        font-size: 20px;
    }
    
    .corgi-img-deco {
        width: 120px;
    }
    
    .empty-corgi {
        width: 150px;
        height: 150px;
    }
}

/* 电脑/大屏 (>1024px) */
@media (min-width: 1025px) {
    #app {
        max-width: 480px;
        margin-top: 30px;
        margin-bottom: 30px;
        height: calc(100% - 60px);
        min-height: 700px;
        border-radius: var(--radius-lg);
        box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    }
    
    .header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .fab-btn {
        position: absolute;
        bottom: 100px;
        right: 20px;
    }
    
    .modal {
        border-radius: var(--radius-lg);
    }
    
    .action-menu {
        border-radius: var(--radius-lg);
    }
}

/* 横屏模式 */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding-top: 52px;
        padding-bottom: 12px;
    }
    
    .corgi-decoration {
        width: 40px;
        height: 40px;
        top: 10px;
    }
    
    .page-title {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .date-display {
        font-size: 12px;
        margin-bottom: 0;
    }
    
    .today-progress {
        gap: 10px;
    }
    
    .progress-ring {
        width: 60px;
        height: 60px;
    }
    
    .progress-text span {
        font-size: 14px;
    }
    
    .progress-text small {
        font-size: 9px;
    }
    
    .stat-num {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .content-area {
        padding: 8px;
    }
    
    .schedule-item {
        padding: 10px;
    }
    
    .empty-state {
        padding: 20px 16px;
    }
    
    .empty-corgi {
        width: 80px;
        height: 80px;
    }
    
    .fab-btn {
        width: 44px;
        height: 44px;
        bottom: 60px;
    }
    
    .nav-item {
        padding: 6px;
    }
    
    .nav-item svg {
        width: 18px;
        height: 18px;
    }
    
    .nav-item span {
        font-size: 10px;
    }
}

/* 高对比度/无障碍模式 */
@media (prefers-contrast: high) {
    .checkbox {
        border-width: 3px;
    }
    
    .schedule-title {
        font-weight: 700;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
