* {
    box-sizing: border-box;
}

:root {
    font-family: "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    color: #263238;
    background: #f3f6f7;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #f3f6f7;
}

.container {
    width: 100%;
    max-width: 760px;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid #dce4e7;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(31, 55, 65, 0.08);
    text-align: center;
}

h1 {
    margin: 0 0 24px;
    color: #176b73;
    font-size: 26px;
    line-height: 1.35;
}

h3 {
    margin: 18px 0 12px;
    color: #344b50;
    font-size: 16px;
    text-align: left;
}

form {
    margin: 0 0 20px;
}

input[type="text"],
.link-input,
textarea {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #cbd5d8;
    border-radius: 5px;
    outline: none;
    font: inherit;
}

input[type="text"] {
    width: min(70%, 520px);
}

input[type="text"]:focus,
textarea:focus {
    border-color: #16818a;
    box-shadow: 0 0 0 3px rgba(22, 129, 138, 0.14);
}

button {
    min-height: 42px;
    padding: 9px 18px;
    border: 0;
    border-radius: 5px;
    background: #176b73;
    color: #fff;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

button:hover {
    background: #10545b;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(22, 129, 138, 0.3);
    outline-offset: 2px;
}

.summary {
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid #c7e5e2;
    border-radius: 6px;
    background: #edf8f6;
    color: #315957;
}

.summary p {
    margin: 0;
}

.summary span {
    color: #176b73;
    font-size: 1.3rem;
    font-weight: 700;
}

.message {
    margin: 0 0 16px;
    padding: 11px 14px;
    border: 1px solid #edcf9b;
    border-radius: 5px;
    background: #fff7e8;
    color: #76501b;
    text-align: left;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.quick-links a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 5px;
    background: #176b73;
    color: #fff;
    text-decoration: none;
}

.quick-links a:nth-child(2) {
    background: #397b50;
}

.quick-links a:nth-child(3) {
    background: #ad5c35;
}

.notice-frame {
    margin: 20px 0;
}

.notice-frame iframe {
    display: block;
    width: 100%;
    height: 560px;
    border: 1px solid #d5dfe2;
    border-radius: 6px;
}

.result {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #dce4e7;
    border-radius: 6px;
    background: #f8fafb;
    text-align: left;
}

.result p {
    overflow-wrap: anywhere;
}

.result hr {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid #dce4e7;
}

.subscription-note {
    padding: 12px;
    border-left: 3px solid #397b50;
    background: #f0f7f1;
    color: #3f5e46;
    line-height: 1.6;
}

.link-item {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 9px 0;
}

.link-input {
    flex: 1;
    width: 100%;
    background: #fff;
    color: #344b50;
    font-size: 13px;
}

.copy-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    background: #397b50;
}

.copy-btn:hover {
    background: #2d633f;
}

.profile-list {
    display: grid;
    gap: 8px;
}

.profile-option {
    display: grid;
    grid-template-columns: 18px minmax(0, auto) 1fr;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid #dce4e7;
    border-radius: 5px;
    background: #fff;
}

.profile-option input {
    accent-color: #176b73;
}

.profile-option small {
    overflow-wrap: anywhere;
    color: #64777b;
    text-align: right;
}

.node-settings-form {
    margin-top: 12px;
}

.node-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin: 12px 0 16px;
}

.node-option {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    border: 1px solid #dce4e7;
    border-radius: 5px;
    background: #fff;
    overflow-wrap: anywhere;
}

.node-option input {
    flex: 0 0 auto;
    margin: 3px 0 0;
    accent-color: #397b50;
}

.node-settings-hint {
    color: #64777b;
}

.node-settings-form > button {
    background: #397b50;
}

.node-settings-form > button:hover {
    background: #2d633f;
}

.custom-ips-label {
    display: block;
    margin: 16px 0 7px;
    font-weight: 600;
}

textarea {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    resize: vertical;
}

@media (max-width: 600px) {
    body {
        padding: 14px 10px;
    }

    .container {
        padding: 22px 16px;
    }

    h1 {
        font-size: 22px;
    }

    input[type="text"] {
        width: 100%;
        margin-bottom: 9px;
    }

    form > button {
        width: 100%;
    }

    .quick-links a {
        flex: 1 1 140px;
    }

    .notice-frame iframe {
        height: 420px;
    }

    .result {
        padding: 14px 11px;
    }

    .link-item {
        gap: 6px;
    }

    .link-input {
        padding: 9px 7px;
        font-size: 11px;
    }

    .copy-btn {
        padding: 7px 9px;
    }

    .profile-option {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .profile-option small {
        grid-column: 2;
        text-align: left;
    }
}
