/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:        #fafaf9;
    --surface:   #ffffff;
    --text:      #1a1a1a;
    --text-sub:  #888888;
    --border:    #e8e8e6;
    --accent:    #2c2c2c;
    --accent-h:  #000000;
    --danger:    #c0392b;
    --radius:    12px;
    --shadow:    0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
    --font:      "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, sans-serif;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    background:  var(--bg);
    color:       var(--text);
    line-height: 1.7;
    min-height:  100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

/* ===== Header ===== */
header {
    text-align: center;
    margin-bottom: 56px;
}
header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .02em;
}
header p {
    margin-top: 6px;
    font-size: .85rem;
    color: var(--text-sub);
}

/* ===== Editor ===== */
.editor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 48px;
}

textarea {
    width: 100%;
    min-height: 160px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: var(--font);
    font-size: .95rem;
    line-height: 1.8;
    color: var(--text);
    background: transparent;
}
textarea::placeholder { color: #c0c0c0; }

.editor-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn-save {
    padding: 10px 32px;
    font-size: .85rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: .03em;
}
.btn-save:hover { background: var(--accent-h); }
.btn-save:active { transform: scale(.97); }

/* ===== History ===== */
.history-section h2 {
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-sub);
    margin-bottom: 20px;
}

.memo-list { list-style: none; }

.memo-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
    position: relative;
}
.memo-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.memo-time {
    font-size: .75rem;
    color: var(--text-sub);
    margin-bottom: 8px;
}
.memo-content {
    font-size: .92rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.memo-delete {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: #ccc;
    font-size: .8rem;
    cursor: pointer;
    transition: color .2s;
    padding: 4px 8px;
}
.memo-delete:hover { color: var(--danger); }

/* ===== Empty State ===== */
.empty {
    text-align: center;
    padding: 48px 0;
    color: var(--text-sub);
    font-size: .88rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: .84rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    z-index: 100;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container { padding: 36px 16px 60px; }
    header { margin-bottom: 36px; }
    header h1 { font-size: 1.25rem; }
    .editor-card { padding: 20px 16px 16px; }
    textarea { min-height: 120px; }
}