* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: #172033;
    background: #f4f6f8;
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.panel {
    width: min(100%, 520px);
    padding: 28px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

.brand {
    margin-bottom: 14px;
    color: #0f766e;
    font-size: 14px;
    font-weight: 700;
}

h1 {
    margin: 0 0 10px;
    font-size: 28px;
    letter-spacing: 0;
}

h2 {
    margin: 0 0 12px;
    font-size: 20px;
    letter-spacing: 0;
}

.hint,
.footnote {
    margin: 0;
    color: #5b677a;
    line-height: 1.7;
}

form {
    margin-top: 22px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

textarea {
    width: 100%;
    resize: vertical;
    min-height: 160px;
    padding: 12px;
    border: 1px solid #cfd7e3;
    border-radius: 6px;
    font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cfd7e3;
    border-radius: 6px;
    font-size: 15px;
}

textarea:focus {
    outline: 2px solid #99f6e4;
    border-color: #0f766e;
}

input:focus {
    outline: 2px solid #99f6e4;
    border-color: #0f766e;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    border: 0;
    border-radius: 6px;
    background: #0f766e;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: #115e59;
}

.footnote {
    margin-top: 18px;
    font-size: 13px;
}

.error-list {
    margin: 18px 0;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #991b1b;
}

.error-list p {
    margin: 0 0 8px;
}

.error-list p:last-child {
    margin-bottom: 0;
}

.admin-page {
    align-items: start;
}

.admin-panel {
    width: min(100%, 860px);
}

.admin-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.small-link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

.section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-form label {
    margin-bottom: 0;
}

.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.checkline input {
    width: auto;
    min-height: 0;
}

.success-box,
.result-box {
    margin: 18px 0;
    padding: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #f0fdf4;
    color: #166534;
}

.success-box textarea,
.result-box textarea {
    margin-top: 10px;
    background: #fff;
}

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

.result-head strong,
.result-head span {
    display: block;
}

.result-head span {
    margin-top: 4px;
    color: #3f6f53;
    font-size: 14px;
}

.result-box label {
    margin-bottom: 8px;
}

.detail-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.detail-result-head label {
    margin-bottom: 0;
}

.result-textarea {
    color: #172033;
}

.detail-textarea {
    min-height: 120px;
}

.copy-button {
    width: auto;
    min-height: 36px;
    margin-top: 0;
    padding: 0 14px;
    white-space: nowrap;
    font-size: 14px;
}

.copy-button.secondary {
    background: #334155;
}

.copy-button.secondary:hover {
    background: #1f2937;
}

.small-action {
    width: auto;
    min-height: 36px;
    margin-top: 0;
    padding: 0 14px;
    font-size: 14px;
    white-space: nowrap;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 10px;
    margin-top: 16px;
}

.search-form button {
    margin-top: 0;
}

.cards-summary {
    margin-top: 12px;
    color: #5b677a;
    font-size: 14px;
}

.table-wrap {
    width: 100%;
    margin-top: 14px;
    overflow-x: auto;
    border: 1px solid #dce2ea;
    border-radius: 6px;
    background: #fff;
}

.cards-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 14px;
}

.cards-table th,
.cards-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
    vertical-align: top;
}

.cards-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.cards-table tr:last-child td {
    border-bottom: 0;
}

.cards-table code {
    font-size: 13px;
    word-break: break-all;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e6f7f2;
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
}

.empty-cell {
    color: #5b677a;
    text-align: center;
}

.mode-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid #e5eaf0;
}

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

    .panel {
        padding: 20px;
    }

    .result-head {
        display: grid;
    }

    .copy-button {
        width: 100%;
    }

    .section-head {
        display: grid;
    }

    .small-action {
        width: 100%;
    }

    .search-form {
        grid-template-columns: 1fr;
    }
}
