﻿@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@600;700&family=Zen+Kaku+Gothic+New:wght@400;600;700&display=swap');

:root {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-soft: #ffffff;
    --line: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent2: #111827;
    --danger: #111827;
    --success: #0f766e;
    --shadow: 0 16px 40px rgba(31, 41, 55, .08);
    --radius: 20px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Zen Kaku Gothic New", "Avenir Next", "Hiragino Sans", Meiryo, sans-serif;
    color: var(--text);
    background: #ffffff;
    min-height: 100vh;
}

a { color: inherit; }

.container {
    width: min(1440px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.hero {
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    animation: fadeUp .6s ease both;
}

.hero h1 {
    margin: 0 0 8px;
    font-family: "Shippori Mincho", "Yu Mincho", serif;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: .03em;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeUp .7s ease both;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.panel-title {
    margin: 0;
    font-size: 18px;
}

.panel-body { padding: 18px; }

.columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.category-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    padding: 14px;
    min-height: 220px;
    animation: fadeUp .8s ease both;
    display: flex;
    flex-direction: column;
}

.category-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.category-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .02em;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    border: 1px solid var(--line);
}

.link-list {
    display: grid;
    gap: 10px;
    grid-auto-rows: minmax(96px, auto);
    align-content: start;
}

.link-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(31, 41, 55, .06);
    animation: fadeUp .9s ease both;
    min-height: 96px;
}

.draggable {
    cursor: grab;
}

.dragging {
    opacity: 0.6;
    cursor: grabbing;
}

.drop-target {
    outline: 2px dashed rgba(15, 118, 110, .35);
    outline-offset: 4px;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    margin-right: 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--accent);
    background: #ffffff;
    border: 1px solid var(--line);
}

.drag-handle.small {
    font-size: 10px;
    padding: 1px 6px;
}

.drag-placeholder {
    border: 2px dashed rgba(15, 118, 110, .35);
    border-radius: 14px;
    background: #ffffff;
}

.link-item h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.link-item p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.link-url {
    display: block;
    color: var(--accent);
    font-size: 12px;
    text-decoration: none;
    word-break: break-all;
}

.link-url:hover {
    text-decoration: underline;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.controls form {
    margin: 0;
}

.controls form button {
    width: 100%;
}

button, .btn {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--accent);
    background: #ffffff;
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
}

button.tiny, .btn.tiny {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 10px;
    letter-spacing: .04em;
    min-width: 72px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 41, 55, .12);
}

button.secondary, .btn.secondary {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--text);
}

button.info {
    background: #ffffff;
    border-color: var(--accent);
    color: var(--accent);
}

button.danger {
    background: #ffffff;
    border-color: #111827;
    color: #111827;
}

.forms {
    display: grid;
    gap: 18px;
}

.form-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
}

.form-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
}

.field label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.field input, .field textarea, .field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.field textarea { min-height: 90px; resize: vertical; }

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    display: none;
}

.status.show { display: block; }

.status.ok {
    background: #ffffff;
    border: 1px solid rgba(15, 118, 110, .3);
}

.status.ng {
    background: #ffffff;
    border: 1px solid rgba(31, 41, 55, .3);
}

.debug {
    margin-top: 12px;
    border: 1px dashed rgba(31, 41, 55, .2);
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
}

.debug summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
    font-size: 12px;
}

.debug-box {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
}

.empty {
    color: var(--muted);
    font-size: 13px;
    padding: 12px;
    border: 1px dashed rgba(31, 41, 55, .2);
    border-radius: 12px;
    background: #ffffff;
}

@media (max-width: 1100px) {
    .grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 20px, 1440px); }
    .hero { padding: 22px; }
    .columns { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

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