/* ========== 寵物日記頁 ========== */
.diary-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
}

.diary-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.diary-hero h1 {
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    font-size: 1.75rem;
    color: var(--forest);
    margin-bottom: 0.5rem;
}

.diary-hero p {
    color: var(--charcoal);
    opacity: 0.85;
    font-size: 1rem;
}

.diary-new {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(125, 155, 118, 0.15);
}

.diary-new h2 {
    font-size: 1.1rem;
    color: var(--forest);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.diary-upload {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.diary-upload #btnAnalyze {
    width: 100%;
    margin-top: 1.25rem;
    position: relative;
    z-index: 100;
}

.diary-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(125, 155, 118, 0.2);
}

.btn-save-diary {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
}

.diary-result h3 {
    font-size: 1rem;
    color: var(--forest);
    margin-bottom: 1rem;
    font-weight: 600;
}

.diary-form-card {
    background: var(--cream);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(125, 155, 118, 0.2);
}

.diary-edit-form .form-group {
    margin-bottom: 1.25rem;
}

.diary-edit-form .form-group:last-of-type {
    margin-bottom: 1.25rem;
}

.diary-edit-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 0.4rem;
}

.diary-edit-form input,
.diary-edit-form textarea,
.diary-edit-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid rgba(125, 155, 118, 0.3);
    border-radius: 10px;
    background: var(--cream);
    color: var(--charcoal);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.diary-edit-form input:focus,
.diary-edit-form textarea:focus,
.diary-edit-form select:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(125, 155, 118, 0.1);
}

.diary-edit-form textarea {
    resize: vertical;
    min-height: 80px;
}

.diary-list {
    margin-top: 2rem;
}

.diary-list h2 {
    font-size: 1.1rem;
    color: var(--forest);
    margin-bottom: 1rem;
    font-weight: 600;
}

.diary-list .count {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
}

.diary-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.diary-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: white;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(125, 155, 118, 0.15);
}

.diary-checkbox {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding-top: 0.2rem;
}

.diary-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--sage);
}

.diary-card-body {
    flex: 1;
    min-width: 0;
}

.diary-image-wrapper {
    margin-bottom: 1rem;
    max-width: 100%;
}

.diary-thumbnail {
    max-height: 200px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(125, 155, 118, 0.2);
}

.diary-card-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.diary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--charcoal);
    opacity: 0.75;
}

.diary-id {
    font-weight: 500;
    color: var(--forest);
}

.diary-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--forest);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.diary-emotion {
    font-size: 1rem;
    font-weight: 600;
    color: var(--terracotta);
    margin-bottom: 0.6rem;
}

.diary-describe {
    font-size: 0.95rem;
    color: var(--charcoal);
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

.diary-memo {
    font-size: 0.9rem;
    color: var(--forest);
    line-height: 1.6;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(125, 155, 118, 0.3);
}

.diary-error .error-msg {
    margin-top: 0.5rem;
}

/* ========== Tabs ========== */
.tabs-container {
    margin-top: 1rem;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid rgba(125, 155, 118, 0.2);
    margin-bottom: 2rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--charcoal);
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    opacity: 0.9;
    color: var(--forest);
}

.tab-btn.active {
    opacity: 1;
    color: var(--forest);
    font-weight: 600;
    border-bottom-color: var(--forest);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

.tab-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
