:root {
    --primary-color: #00B51D; /* Douban Green */
    --primary-hover: #009e19;
    --bg-color: #f7f7f7;
    --text-color: #111;
    --text-secondary: #999;
    --white: #fff;
    --danger: #ff5252;
    --info: #42bd56; /* Douban lighter green */
    --border-radius: 8px; /* Slightly sharper radius */
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    font-size: 15px;
}

/* Auth Screen */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--white);
}

.auth-box {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.auth-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: bold;
}

.auth-slogan {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.auth-tabs button {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.auth-tabs button.active {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
    font-weight: bold;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:active {
    background-color: var(--primary-hover);
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 15px;
    min-height: 20px;
}

/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Space for input area */
}

header {
    background-color: var(--white);
    color: var(--text-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #f0f0f0;
}

header h1 {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Memo List */
.memo-list {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.memo-item {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow); /* Softer shadow */
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease-out;
    user-select: none;
    border: 1px solid #f0f0f0;
}

.memo-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
}

.memo-image {
    margin-top: 12px;
}

.memo-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

.memo-meta {
    font-size: 0.8rem;
    color: #ccc;
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-player {
    margin-top: 12px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 6px 16px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.voice-player i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* Swipe Actions */
.swipe-action {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: opacity 0.2s;
    opacity: 0; 
}

/* Input Area */
.input-area-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    border-top: 1px solid #eee;
    z-index: 20;
    max-width: 600px;
    margin: 0 auto;
}

.input-area {
    display: flex;
    padding: 10px 15px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 10px 15px;
    margin: 0 10px;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    font-size: 1rem;
    outline: none;
    max-height: 100px;
    color: #333;
}

.image-preview-container {
    position: relative;
    margin-bottom: 5px;
    width: fit-content;
}

.image-preview-container img {
    height: 60px;
    width: auto;
    border-radius: 4px;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.2s;
}

.image-btn {
    color: var(--text-secondary);
}

.icon-btn:active {
    color: var(--primary-color);
}

.send-btn {
    color: var(--primary-color);
}

/* Voice Overlay */
.voice-recording-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background-color: rgba(255,255,255,0.98);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 20px;
}

.recording-wave {
    display: flex;
    align-items: center;
    height: 40px;
    margin-bottom: 20px;
}

.recording-wave .bar {
    width: 5px;
    height: 10px;
    background-color: var(--primary-color);
    margin: 0 4px;
    border-radius: 3px;
    animation: wave 1s infinite ease-in-out;
}

.recording-wave .bar:nth-child(2) { animation-delay: 0.1s; }
.recording-wave .bar:nth-child(3) { animation-delay: 0.2s; }
.recording-wave .bar:nth-child(4) { animation-delay: 0.3s; }
.recording-wave .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 10px; }
    50% { height: 40px; }
}

.stop-btn {
    background-color: var(--primary-color); /* Green for stop/save in this context feels better */
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    margin-bottom: 15px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 181, 29, 0.3);
}

.cancel-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.modal-content p {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.05rem;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.modal-actions button {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-cancel {
    background-color: #f5f5f5;
    color: #666;
}

.btn-delete {
    background-color: var(--danger);
    color: white;
}

.loading-spinner {
    text-align: center;
    color: #ccc;
    margin-top: 40px;
}
