/* fc2.pro - ハッシュ変更ツール */

:root {
    --bg: #0a0e1a;
    --bg-elevated: #0f1420;
    --surface: #141a28;
    --surface-2: #1b2235;
    --surface-hover: #232b3f;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #e8ebf2;
    --text-muted: #8b92a8;
    --text-dim: #5c657d;
    --accent: #f471b5;
    --accent-glow: rgba(244, 113, 181, 0.35);
    --accent-soft: rgba(244, 113, 181, 0.12);
    --blue: #60a5fa;
    --blue-soft: rgba(96, 165, 250, 0.12);
    --green: #34d399;
    --green-soft: rgba(52, 211, 153, 0.14);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.14);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.14);
    --radius: 14px;
    --radius-sm: 10px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
                 "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI",
                 Meiryo, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
                 Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.mono { font-family: var(--font-mono); font-size: 0.82em; word-break: break-all; }

/* ===== Background orbs ===== */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orbs .orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.35; will-change: transform; }
.bg-orbs .orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(244,113,181,0.4), transparent 70%);
    top: -10%; right: 5%;
    animation: float-1 22s ease-in-out infinite;
}
.bg-orbs .orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(96,165,250,0.35), transparent 70%);
    top: 50%; left: -8%;
    animation: float-2 26s ease-in-out infinite;
}
@keyframes float-1 {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(-40px,60px) scale(1.05); }
}
@keyframes float-2 {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(50px,40px) scale(1.08); }
}

/* ===== Site Header (shared) ===== */
.site-header {
    position: sticky; top: 0; z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 28px;
    background: rgba(10, 14, 26, 0.72);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}
.site-brand { text-decoration: none; }
.site-brand .brand-mark {
    display: inline-block;
    font-size: 1.05rem; font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.3s, color 0.3s, transform 0.3s;
}
.site-brand:hover .brand-mark {
    border-color: var(--accent-soft); color: var(--text);
    transform: translateY(-1px);
}
.site-brand .brand-dot { color: var(--accent); text-shadow: 0 0 8px var(--accent-glow); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.navlink {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-muted);
    transition: background 0.18s, color 0.18s;
}
.navlink:hover { color: var(--text); background: var(--surface-2); }
.navlink.is-active { color: var(--accent); background: var(--accent-soft); }

/* ===== Layout ===== */
.app {
    position: relative; z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 28px 48px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.page-hero { padding: 6px 4px 0; }
.page-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700; letter-spacing: -0.02em;
    line-height: 1.15; margin-bottom: 8px;
}
.page-sub { color: var(--text-muted); font-size: 0.92rem; }
.page-sub .warn {
    color: var(--green);
    font-weight: 500;
    display: inline-block; margin-left: 4px;
}

/* ===== Grid ===== */
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 18px;
}
.main-col, .side-col { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 980px) {
    .grid { grid-template-columns: 1fr; }
}

/* ===== Panel ===== */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.panel-header h2 {
    font-size: 0.95rem; font-weight: 600;
    color: var(--text); letter-spacing: -0.005em;
}
.panel-header .panel-sub {
    font-size: 0.75rem; color: var(--text-dim);
}

/* ===== Dropzone ===== */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 38px 24px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.dropzone-icon { font-size: 2.4rem; margin-bottom: 10px; }
.dropzone-text { color: var(--text); font-size: 0.95rem; }
.dropzone-hint { color: var(--text-dim); font-size: 0.78rem; margin-top: 6px; }
.link-btn {
    background: none; border: none; padding: 0;
    color: var(--accent); cursor: pointer;
    font-weight: 600; font-size: inherit;
    text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--blue); }

/* ===== File info ===== */
.file-info {
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.file-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 0.85rem;
}
.file-label {
    flex-shrink: 0;
    width: 90px;
    color: var(--text-dim);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.file-value {
    flex: 1;
    color: var(--text);
    word-break: break-all;
}

/* ===== Form ===== */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}
.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text);
}
.form-row--check { gap: 8px; cursor: pointer; }
.form-label {
    min-width: 90px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.form-hint { color: var(--text-dim); font-size: 0.78rem; }
.num-input, .text-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.2s;
}
.num-input { width: 90px; }
.text-input { width: 200px; }
.num-input:focus, .text-input:focus {
    outline: none;
    border-color: var(--accent);
}
input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px; height: 16px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.18s, opacity 0.18s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(244, 113, 181, 0.3);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}
.btn-icon { font-size: 1rem; }
.btn-ghost { background: transparent; }
.btn-small { padding: 6px 12px; font-size: 0.8rem; }
.btn-danger:hover { color: var(--red); border-color: var(--red); }

.action-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.action-status {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* ===== Loading dot ===== */
.loading-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.2s ease-in-out infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50%      { opacity: 1; transform: scale(1.1); }
}

/* ===== Badge ===== */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 500;
}
.badge-warn   { background: var(--amber-soft); color: var(--amber); }
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-info   { background: var(--blue-soft); color: var(--blue); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; margin: -8px -12px; padding: 8px 12px; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table thead th {
    text-align: left;
    padding: 10px 14px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.data-table thead th.num { text-align: right; }
.data-table thead th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.data-table thead th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.data-table tbody td.num { text-align: right; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table .hash-cell { font-family: var(--font-mono); font-size: 0.78em; color: var(--text-muted); }

/* ===== History ===== */
.side-panel {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}
.history-search { margin-bottom: 12px; }
.history-search .text-input { width: 100%; }
.history-list {
    overflow-y: auto;
    flex: 1;
    margin: 0 -8px;
    padding: 0 8px;
    min-height: 200px;
}
.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}
.history-item:hover { border-color: var(--border-strong); }
.history-item-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 4px;
}
.history-item-name {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.history-item-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-shrink: 0;
}
.history-item-hash {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ===== Footer ===== */
.app-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 18px 0 8px;
    color: var(--text-dim);
    font-size: 0.74rem;
    flex-wrap: wrap;
}
.app-footer .sep { opacity: 0.5; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 999px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ===== Responsive ===== */
@media (max-width: 720px) {
    .app { padding: 18px 14px 32px; }
    .panel { padding: 16px 18px; }
    .form-row { flex-wrap: wrap; }
    .form-label { width: auto; min-width: auto; }
    .num-input, .text-input { width: 100%; }
    .side-panel { position: static; max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .bg-orbs { display: none; }
}
