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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #222;
    padding: 24px 16px;
    min-height: 100vh;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* ── 公開ページ ── */
.items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
}

.item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.item:hover { border-color: #aaa; }

.item.copied {
    background: #e6f4ea;
    border-color: #4caf50;
}

.item .label {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 4px;
}

.item .content {
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── 管理画面 ── */
.admin-wrap { max-width: 780px; margin: 0 auto; }

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.card h2 { font-size: 1.05rem; margin-bottom: 16px; color: #444; }

label { display: block; font-size: 0.85rem; color: #555; margin-bottom: 4px; }

input[type=text], textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.15s;
}

input[type=text]:focus, textarea:focus { border-color: #666; }

textarea { min-height: 80px; resize: vertical; }

button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: opacity 0.15s;
}

button:hover { opacity: 0.8; }

.btn-primary { background: #333; color: #fff; }
.btn-danger  { background: #e53935; color: #fff; padding: 5px 10px; font-size: 0.8rem; }
.btn-edit    { background: #1976d2; color: #fff; padding: 5px 10px; font-size: 0.8rem; }
.btn-up, .btn-down { background: #f0f0f0; color: #333; padding: 5px 9px; font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #eee; color: #555; font-weight: 600; }
td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; display: flex; gap: 4px; align-items: center; }

.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: min(480px, 92vw);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal h2 { margin-bottom: 16px; font-size: 1rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.btn-secondary { background: #eee; color: #333; }

.msg {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.msg.success { background: #e6f4ea; color: #2e7d32; }
.msg.error   { background: #fdecea; color: #c62828; }
