/* n.af — 暗色主题 */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-input: #16162a;
    --border: #2a2a4a;
    --border-focus: #6c5ce7;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --success: #00d2a0;
    --error: #ff6b6b;
    --warning: #ffa94d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====== Header ====== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--text-secondary);
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* ====== Main ====== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ====== Shorten Form ====== */
.shorten-box {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group input {
    flex: 1;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.btn-shorten {
    padding: 0.85rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-shorten:hover {
    background: var(--accent-hover);
}

.btn-shorten:active {
    transform: scale(0.97);
}

.btn-shorten:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom code toggle */
.custom-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    user-select: none;
}

.custom-toggle:hover {
    color: var(--text-primary);
}

.custom-input {
    display: none;
    margin-bottom: 1rem;
}

.custom-input.show {
    display: block;
}

.custom-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-input input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-input .hint {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Result */
.result {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.result.show {
    display: block;
}

.result-url {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.result-url a {
    color: var(--success);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}

.result-url a:hover {
    text-decoration: underline;
}

.btn-copy {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-copy.copied {
    border-color: var(--success);
    color: var(--success);
}

.result-stats {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.result-stats a {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Error */
.error-msg {
    display: none;
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.85rem;
}

.error-msg.show {
    display: block;
}

/* ====== Features ====== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin-top: 2rem;
}

.feature {
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.feature h3 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.feature p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ====== Footer ====== */
.footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ====== Docs Page ====== */
.docs-container {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
    margin: 0 auto;
}

.docs-container h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-container h2 {
    font-size: 1.3rem;
    margin: 2rem 0 0.8rem;
    color: var(--text-primary);
}

.docs-container h3 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--accent);
}

.docs-container p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.docs-container code {
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--success);
}

.docs-container pre {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.docs-container pre code {
    background: none;
    padding: 0;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.endpoint {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.endpoint .method {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.method-get { background: rgba(0, 210, 160, 0.15); color: var(--success); }
.method-post { background: rgba(108, 92, 231, 0.15); color: var(--accent); }

.endpoint .path {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.endpoint .desc {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ====== Responsive ====== */
@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .input-group { flex-direction: column; }
    .btn-shorten { width: 100%; }
    .header { padding: 1rem; }
    .shorten-box { padding: 1.5rem; }
    .nav-links { gap: 0.8rem; }
    .lang-btn { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
}

/* ====== Language Switcher ====== */
.lang-switcher {
    position: relative;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lang-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem;
    min-width: 120px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.lang-option:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--accent);
    font-weight: 600;
}

/* ====== Feature Clickable ====== */
.feature-clickable {
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.feature-clickable:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ====== Tools Page ====== */
.tools-container {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
    margin: 0 auto;
}

.tools-container h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tools-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.tools-intro code {
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--success);
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.tool-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tool-title h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.tool-icon {
    font-size: 1.3rem;
}

.tool-endpoint {
    background: var(--bg-input);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--success);
}

.tool-result {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    font-family: monospace;
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.8rem;
    word-break: break-all;
}

.tool-result-small {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-primary);
}

.tool-result-pre {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-primary);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.tool-result .loading {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
}

.tool-usage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-usage code {
    flex: 1;
    background: var(--bg-input);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.btn-tool {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-tool:hover {
    background: var(--accent-hover);
}

.btn-copy-small {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy-small:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* ====== Redirect Warning Page ====== */
.warning-box {
    max-width: 500px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.warning-box h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.warning-desc {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.target-url {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--warning);
    word-break: break-all;
    margin-bottom: 0.8rem;
}

.warning-note {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
}

.warning-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.btn-continue {
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-continue:hover {
    background: var(--accent-hover);
}

.btn-back {
    padding: 0.7rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.report-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-report {
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    color: var(--error);
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-report:hover {
    background: rgba(255, 107, 107, 0.1);
}

.btn-report:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.report-status {
    font-size: 0.82rem;
}

/* ====== IP Info Page ====== */
.ip-container {
    max-width: 700px;
    width: 100%;
    padding: 2rem;
    margin: 0 auto;
}

.ip-page-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ip-search-box {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.ip-search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: monospace;
    outline: none;
    transition: border-color 0.2s;
}

.ip-search-input:focus {
    border-color: var(--accent);
}

.ip-search-input::placeholder {
    color: var(--text-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ip-search-btn {
    padding: 0.8rem 1.5rem;
    white-space: nowrap;
}

.ip-my-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.ip-my-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.ip-my-value {
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    flex: 1;
}

/* Detail Card */
.ip-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

.ip-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.ip-detail-ip {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ip-detail-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.ip-detail-badge.success {
    background: rgba(0, 210, 160, 0.15);
    color: var(--success);
}

.ip-detail-badge.error {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error);
}

.ip-detail-badge.loading {
    background: rgba(255, 169, 77, 0.15);
    color: var(--warning);
}

.ip-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ip-info-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

.ip-info-row:last-child {
    border-bottom: none;
}

.ip-info-label {
    width: 120px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ip-info-value {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-all;
}

/* API usage section */
.ip-api-usage {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
}

.ip-api-usage h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.ip-api-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.ip-api-item code {
    background: var(--bg-input);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--success);
    white-space: nowrap;
}

.ip-api-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .ip-search-box { flex-direction: column; }
    .ip-my-card { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .ip-detail-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .ip-info-label { width: 100px; font-size: 0.82rem; }
    .ip-detail-ip { font-size: 1.2rem; }
}
