/* ========== Notepad — Warm Stone Typography ========== */

/* Date header */
.notepad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #EBE5DD;
}

.notepad-header .date-display {
    font-family: var(--font-sans);
    font-size: var(--text-xl);
    font-weight: 600;
    color: #2D2926;
    letter-spacing: var(--track-tight);
}

.notepad-header .date-display .weekday {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 400;
    color: #6E645A;
    margin-left: 12px;
    letter-spacing: var(--track-wide);
}

.notepad-header .actions {
    display: flex;
    gap: 10px;
}

.notepad-header .btn {
    padding: 9px 22px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: var(--track-wide);
    transition: all 200ms ease;
}
.notepad-header .btn:active { transform: scale(0.95); }

.notepad-header .btn-edit {
    background: rgba(194,133,91,0.06);
    color: #A66E47;
}
.notepad-header .btn-edit:hover { background: rgba(194,133,91,0.12); }

.notepad-header .btn-delete {
    background: rgba(196,114,110,0.06);
    color: #C4726E;
}
.notepad-header .btn-delete:hover { background: rgba(196,114,110,0.12); }

.notepad-header .btn-save {
    background: #C2855B;
    color: #FFF;
    box-shadow: 0 2px 6px rgba(194,133,91,0.2);
}
.notepad-header .btn-save:hover {
    background: #A66E47;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(194,133,91,0.22);
}

/* Note content area */
.notepad-content {
    flex: 1;
    overflow-y: auto;
}

/* View mode — paper card */
.notepad-view {
    background: #FFFCF8;
    border-radius: 18px;
    padding: 36px 40px;
    min-height: 200px;
    border: 1px solid #EBE5DD;
    box-shadow: 0 1px 2px rgba(45,41,38,0.02);
    animation: slideInRight 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notepad-view .note-line {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #F2EDE7;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 400;
    color: #3D3835;
    line-height: 1.8;
    letter-spacing: 0.01em;
}
.notepad-view .note-line:last-child { border-bottom: none; }

.notepad-view .line-number {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: #8F8478;
    min-width: 28px;
    flex-shrink: 0;
    letter-spacing: 0;
    padding-top: 2px;
}

/* ========== Line Editor — 逐行输入 ========== */
.line-editor {
    background: #FFFCF8;
    border: 2px solid #C2855B;
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 0 0 5px rgba(194,133,91,0.05);
    animation: slideInRight 300ms cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 200px;
}

.line-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #F2EDE7;
    animation: lineFadeIn 200ms ease;
}
.line-row:last-child { border-bottom: none; }

@keyframes lineFadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.line-row-num {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: #8F8478;
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
    padding-top: 2px;
    user-select: none;
}

.line-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 400;
    color: #2D2926;
    line-height: 1.7;
    letter-spacing: 0.01em;
    padding: 4px 0;
    caret-color: #C2855B;
}
.line-input::placeholder {
    color: #A89C90;
    font-weight: 400;
}

.line-row-del {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #A89C90;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all 180ms ease;
}
.line-row:hover .line-row-del { opacity: 1; }
.line-row-del:hover {
    background: rgba(196,114,110,0.08);
    color: #C4726E;
}

/* Enter hint */
.add-line-row {
    display: flex;
    justify-content: center;
    padding: 8px 0 0;
}

.add-line-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 10px;
    border: 1px dashed #B0A599;
    background: transparent;
    color: #8F8478;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: var(--track-wide);
    cursor: pointer;
    transition: all 200ms ease;
}
.add-line-btn:hover {
    border-color: #C2855B;
    color: #A66E47;
    background: rgba(194,133,91,0.04);
}

/* Save status */
.notepad-status {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 400;
    color: #8F8478;
    margin-top: 16px;
    text-align: right;
    min-height: 20px;
    letter-spacing: var(--track-wide);
}
.notepad-status .saving { color: #C2855B; }
.notepad-status .saved  { color: #7A9D7E; }
.notepad-status .error  { color: #C4726E; }

/* ========== Empty State — editorial invitation ========== */
.notepad-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    background: #FFFCF8;
    border-radius: 20px;
    border: 1px solid #EBE5DD;
    box-shadow: 0 1px 3px rgba(45,41,38,0.01);
    animation: slideInRight 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notepad-empty .empty-illustration {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    background: linear-gradient(135deg, #F7F3EF 0%, rgba(194,133,91,0.04) 100%);
    color: #8F8478;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: all 400ms ease;
}
.notepad-empty:hover .empty-illustration {
    transform: scale(1.05);
    color: #C2855B;
    background: linear-gradient(135deg, rgba(194,133,91,0.04) 0%, rgba(194,133,91,0.10) 100%);
}

.notepad-empty .empty-title {
    font-family: var(--font-sans);
    font-size: var(--text-lg);
    font-weight: 600;
    color: #2D2926;
    margin-bottom: 10px;
    letter-spacing: var(--track-wide);
}

.notepad-empty .empty-subtitle {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 400;
    color: #6E645A;
    margin-bottom: 36px;
    letter-spacing: var(--track-wider);
    line-height: 1.6;
}

.notepad-empty .btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: #2D2926;
    color: #FFF;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: var(--track-wide);
    transition: all 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.notepad-empty .btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(45,41,38,0.16);
    background: #3D3835;
}
.notepad-empty .btn-start:active { transform: scale(0.97); }

/* ========== Skeleton Loading ========== */
.notepad-skeleton {
    background: #FFFCF8;
    border-radius: 18px;
    padding: 36px 40px;
    border: 1px solid #EBE5DD;
    animation: slideInRight 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notepad-skeleton .skeleton-line {
    height: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #F2EDE7 25%, #E8E1D8 50%, #F2EDE7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.notepad-skeleton .skeleton-line:nth-child(2) { width: 78%; }
.notepad-skeleton .skeleton-line:nth-child(3) { width: 62%; }
.notepad-skeleton .skeleton-line:nth-child(4) { width: 84%; }
.notepad-skeleton .skeleton-line:nth-child(5) { width: 48%; }

/* ========== Delete Confirmation ========== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45,41,38,0.3);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 200ms ease;
}

.confirm-dialog {
    background: #FFFCF8;
    border-radius: 18px;
    padding: 38px;
    width: 360px;
    box-shadow: 0 1px 2px rgba(45,41,38,0.04),
                0 20px 48px rgba(45,41,38,0.1);
    animation: modalIn 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-dialog h3 {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: 600;
    color: #2D2926;
    margin-bottom: 10px;
    letter-spacing: var(--track-wide);
}

.confirm-dialog p {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 400;
    color: #6E645A;
    margin-bottom: 26px;
    line-height: 1.65;
    letter-spacing: var(--track-wide);
}

.confirm-dialog .btn-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-dialog .btn-cancel {
    padding: 10px 24px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    color: #6E645A;
    background: #F7F3EF;
    letter-spacing: var(--track-wide);
    transition: all 200ms ease;
}
.confirm-dialog .btn-cancel:hover { background: #EBE5DD; }

.confirm-dialog .btn-confirm {
    padding: 10px 24px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    color: #FFF;
    background: #C4726E;
    letter-spacing: var(--track-wide);
    transition: all 200ms ease;
}
.confirm-dialog .btn-confirm:hover {
    background: #B05A56;
    box-shadow: 0 4px 12px rgba(196,114,110,0.22);
}
.confirm-dialog .btn-cancel:active,
.confirm-dialog .btn-confirm:active { transform: scale(0.95); }

/* Network offline banner */
.network-banner {
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    background: rgba(194,133,91,0.1);
    color: #A66E47;
    text-align: center;
    padding: 10px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: var(--track-wide);
    z-index: 10002;
    animation: slideDown 300ms ease;
    backdrop-filter: blur(8px);
}
