/* 喝水记录页面专属样式 */

.container-fluid {
    padding: 20px;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 重要笔记区域样式 */
.important-note-card {
    margin: 0 auto 25px auto;
    max-width: 1200px;
    padding: 20px;
    border-left: 6px solid #0ea5e9;
}

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

.note-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #0369a1;
}

.note-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-save-note {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-save-note:hover {
    background: #0369a1;
}

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

#importantNoteDisplay,
#importantNote {
    width: 100%;
    min-height: 80px;
    border: 1px solid #e0f2fe;
    border-radius: 10px;
    padding: 12px;
    font-size: 1rem;
    color: #334155;
    resize: vertical;
    background: #f8fafc;
    transition: all 0.3s;
}

#importantNote:focus {
    outline: none;
    border-color: #0ea5e9;
    background: white;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.note-display {
    white-space: pre-line;
    word-break: break-word;
    background: #f8fafc;
    border: 1px solid #e0f2fe;
    border-radius: 10px;
    padding: 12px;
    color: #334155;
}

.btn-edit-note {
    background: white;
    color: #0369a1;
    border: 1px solid #0ea5e9;
    padding: 6px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s, color 0.3s;
}

.btn-edit-note:hover {
    background: #e0f2fe;
}

.header-left h1 {
    color: #0369a1;
    font-size: 1.8rem;
    margin: 0;
}

.btn-back {
    text-decoration: none;
    color: #0ea5e9;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-back:hover {
    transform: translateX(-5px);
}

.water-main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start; /* 确保左右两侧顶部对齐，防止左侧卡片被拉伸产生大片空白 */
}

.water-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* 今日饮水日志卡片居中显示并限制宽度，视觉更集中 */
.history-card {
    max-width: 700px;
    margin: 0 auto;
}

/* 进度卡片样式 */
.progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 50px;
    min-height: auto; /* 取消固定最小高度，由内容决定 */
}

.cup-container {
    position: relative;
    width: 180px; /* 稍微缩小一点水杯 */
    height: 260px;
    margin-bottom: 60px; /* 留出百分比文本的空间 */
}

.cup {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f0f9ff;
    border: 6px solid #0ea5e9;
    border-top: none;
    border-radius: 10px 10px 50px 50px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #38bdf8;
    transition: height 0.5s ease-out;
}

.water::after {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    width: 200%;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 40%;
    animation: wave 3s infinite linear;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

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

#currentAmount {
    font-size: 3rem;
    font-weight: bold;
    color: #0369a1;
    display: block;
}

.unit {
    font-size: 1.2rem;
    color: #0ea5e9;
}

.percentage {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #0369a1;
}

.quick-add {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.add-btn {
    padding: 12px 20px;
    border: 2px solid #0ea5e9;
    background: white;
    color: #0ea5e9;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    background: #0ea5e9;
    color: white;
    transform: translateY(-2px);
}

.add-btn.custom {
    border-style: dashed;
}

/* 按钮样式补全 */
.btn-icon-small {
    background: none;
    border: 1px solid #e0f2fe;
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: #f0f9ff;
    border-color: #0ea5e9;
    transform: scale(1.1);
}

.sound-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sound-select {
    padding: 4px 8px;
    border: 1px solid #e0f2fe;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #334155;
    outline: none;
}

.sound-select:focus {
    border-color: #0ea5e9;
}
.water-side {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.reminder-card h3, .history-card h3, .stats-card h3 {
    margin-top: 0;
    color: #0369a1;
    border-bottom: 2px solid #f0f9ff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

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

.stat-item {
    background: #f0f9ff;
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #0369a1;
}

.chart-container {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
}

.chart-header {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 15px;
    font-weight: bold;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    padding-top: 20px;
    gap: 8px;
}

.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.chart-bar {
    width: 100%;
    background: #bae6fd;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.5s ease;
    min-height: 2px;
}

.chart-bar.reached {
    background: #38bdf8;
}

.chart-bar:hover {
    background: #0ea5e9;
}

.chart-bar::before {
    content: attr(data-value);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #0369a1;
    white-space: nowrap;
}

.chart-label {
    font-size: 0.65rem;
    color: #94a3b8;
    white-space: nowrap;
}

.reminder-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sound-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #475569;
    outline: none;
    background: #f8fafc;
    cursor: pointer;
}

.sound-select:focus {
    border-color: #0ea5e9;
}

#testSoundBtn {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    color: #0ea5e9;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

#testSoundBtn:hover {
    background: #0ea5e9;
    color: white;
}

.next-reminder {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    color: #0369a1;
    font-weight: bold;
    margin-bottom: 10px;
}

.current-time-display {
    background: #f8fafc;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid #f0f9ff;
}

#currentTimeWithSeconds {
    font-family: monospace;
    font-weight: bold;
    color: #0ea5e9;
    font-size: 1.1rem;
    margin-left: 5px;
}

/* 定时提醒样式 */
.scheduled-reminders {
    border-top: 1px solid #f0f9ff;
    padding-top: 20px;
}

.scheduled-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.scheduled-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #0369a1;
}

.add-scheduled {
    display: flex;
    gap: 10px;
    align-items: center;
}

.add-scheduled input[type="time"] {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #475569;
    outline: none;
    background: #f8fafc;
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #f0f9ff;
    transition: all 0.2s;
}

.reminder-item:hover {
    border-color: #bae6fd;
    transform: translateX(5px);
}

.reminder-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reminder-time {
    font-weight: bold;
    color: #0369a1;
    font-size: 1.1rem;
}

.reminder-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-delete-reminder {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-delete-reminder:hover {
    opacity: 1;
}

/* Switch 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #0ea5e9;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 历史记录样式 */
.water-logs {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.log-date-header {
    font-size: 0.85rem;
    font-weight: bold;
    color: #64748b;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 6px;
    margin: 15px 0 8px 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.log-date-header:first-child {
    margin-top: 0;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.log-time {
    color: #888;
    font-size: 0.9rem;
}

.log-amount {
    color: #0369a1;
    font-weight: bold;
}

.log-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-small, .btn-delete-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-edit-small {
    color: #3b82f6;
}

.btn-delete-small {
    color: #ef4444;
}

.btn-edit-small:hover, .btn-delete-small:hover {
    background: #f1f5f9;
}

.empty-tip {
    text-align: center;
    color: #aaa;
    padding: 40px 0;
}

/* 弹窗样式调整 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.input-group {
    margin: 20px 0;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #f0f9ff;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
}

.input-group input:focus {
    border-color: #0ea5e9;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #0369a1; /* 深蓝色背景 */
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    display: none;
    z-index: 2000;
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 响应式调整 */
@media (max-width: 900px) {
    .water-main {
        grid-template-columns: 1fr;
    }
    
    .water-side {
        order: 2;
    }
}
