:root {
    --paper-bg: #fffef0;
    --text-color: #5a5a5a;
    --accent-color: #ff9fb2; /* Pastel Pink */
    --accent-secondary: #a0e1e1; /* Pastel Cyan */
    --accent-tertiary: #ffe181; /* Pastel Yellow */
    --border-color: #e8e4d9;
    --hole-color: #d1d1d1;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --border-radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background-color: #f2efe4;
    background-image: 
        radial-gradient(#dcdcdc 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: var(--paper-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
}

/* Notebook Holes Decoration */
.notebook-holes {
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px 0;
    z-index: 10;
    pointer-events: none;
}

.notebook-holes::before {
    content: '';
    display: block;
    height: 100%;
    width: 100%;
    background-image: radial-gradient(var(--hole-color) 6px, transparent 6px);
    background-size: 20px 40px;
}

header {
    background: var(--accent-tertiary);
    padding: 40px 20px 30px 45px;
    text-align: center;
    border-bottom: 2px dashed var(--border-color);
    position: relative;
}

/* BGM Control */
.bgm-control {
    position: absolute;
    top: 15px;
    right: 15px;
}

#bgm-toggle {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

#bgm-toggle.playing {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #7a6e5a;
    text-shadow: 1px 1px 0 white;
}

nav {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.tab-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #e68a9c;
}

main {
    padding: 30px 25px 30px 50px;
    flex-grow: 1;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mood Selector */
.mood-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mood-btn {
    font-size: 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mood-btn:hover {
    transform: scale(1.1);
}

.mood-btn.active {
    background: var(--accent-tertiary);
    border-color: #f0d060;
    transform: scale(1.1);
}

/* Input Styles */
.input-group {
    position: relative;
    margin-bottom: 30px;
}

.input-group::before {
    content: 'Tape';
    position: absolute;
    top: -15px;
    right: 20px;
    background: rgba(160, 225, 225, 0.6);
    color: transparent;
    padding: 5px 20px;
    transform: rotate(5deg);
    z-index: 1;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    background: white;
}

textarea {
    min-height: 150px;
    background-image: linear-gradient(transparent 31px, #f0ede0 31px);
    background-size: 100% 32px;
    line-height: 32px;
}

button#save-diary, button#add-todo {
    background: var(--accent-secondary);
    color: #4a8a8a;
    border: 2px solid #8ecaca;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    width: 100%;
    margin-top: 10px;
    transition: all 0.2s;
}

button#save-diary:hover, button#add-todo:hover {
    background: #8ecaca;
}

/* List Styles */
.list-container {
    list-style: none;
}

.diary-item, .todo-item {
    background: white;
    border: 2px solid var(--border-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.diary-item .date {
    font-size: 0.8rem;
    color: #999;
    display: block;
    margin-bottom: 5px;
}

.diary-item .mood-icon {
    position: absolute;
    top: 15px;
    right: 40px;
    font-size: 1.2rem;
}

.diary-item .content {
    white-space: pre-wrap;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.diary-reply {
    margin-top: 15px;
    padding: 10px 12px;
    background: var(--paper-bg);
    border: 1px dashed var(--accent-color);
    border-radius: 10px;
    font-size: 0.85rem;
    color: #777;
    position: relative;
}

.diary-reply::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid var(--accent-color);
    opacity: 0.3;
}

.diary-reply span {
    font-weight: bold;
    color: var(--accent-color);
    margin-right: 5px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.todo-item.completed .content {
    text-decoration: line-through;
    color: #bbb;
}

.delete-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    color: #ff9999;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
}

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

.progress-container {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #999;
    text-align: right;
}
