/* === Reset & base === */
html {
    height: 100%;
    background: #1a1a2e;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 40px 20px;
    overscroll-behavior: none;
}
.container {
    max-width: 800px;
    margin: 0 auto;
}

/* === Shared components === */
.subtitle {
    font-size: 1rem;
    color: #888;
}

/* === Page: home (index.php) === */
.page-home header {
    text-align: center;
    margin-bottom: 40px;
}
.page-home h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.page-home .card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, background 0.2s;
}
.page-home .card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
}
.page-home .card h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #00d4ff;
}
.page-home .card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
}
.page-home .card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 8px;
}
.page-home .card.affiliate {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    border-color: rgba(0, 212, 255, 0.3);
}
.page-home .intro {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 16px;
}
.page-home .ip-display {
    font-size: clamp(1.5rem, 8vw, 3.5rem);
    font-weight: 700;
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    margin: 20px 0 5px 0;
}
.page-home .geo {
    font-size: 0.9rem;
    color: #666;
    margin-top: 36px;
}
.page-home .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.page-home .affiliate-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background: #00d4ff;
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.page-home .affiliate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}
.page-home .card code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    color: #00d4ff;
    word-break: break-all;
}
.page-home .card .code-block {
    display: block;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: clamp(0.7rem, 2.5vw, 0.82rem);
    color: #00d4ff;
    white-space: nowrap;
    overflow-x: auto;
}
.page-home footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8rem;
    color: #999;
}

/* === Page: api (api.php) === */
.page-api header {
    margin-bottom: 40px;
}
.page-api h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.page-api .card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}
.page-api .card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #ccc;
}
.page-api .card-table {
    padding: 0;
    overflow: hidden;
}
.page-api nav {
    margin-bottom: 32px;
    font-size: 0.9rem;
}
.page-api nav a {
    color: #00d4ff;
    text-decoration: none;
}
.page-api nav a:hover {
    text-decoration: underline;
}
.page-api nav span {
    color: #555;
    margin: 0 8px;
}
.page-api .section {
    margin-top: 40px;
}
.page-api .section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}
.page-api .endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.95rem;
    overflow-x: auto;
}
.page-api .method {
    background: #00d4ff;
    color: #1a1a2e;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.page-api .url {
    color: #00d4ff;
    white-space: nowrap;
}
.page-api pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #ccc;
    margin-top: 12px;
}
.page-api .pre-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
    margin-bottom: 6px;
}
.page-api .key  { color: #79b8ff; }
.page-api .str  { color: #9ecbff; }
.page-api .num  { color: #f8c555; }
.page-api .null { color: #888; }
.page-api table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.page-api th {
    text-align: left;
    padding: 10px 12px;
    color: #666;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.page-api td {
    padding: 10px 12px;
    color: #ccc;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: top;
    line-height: 1.5;
}
.page-api td:first-child {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    color: #00d4ff;
    white-space: nowrap;
}
.page-api code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    padding: 1px 5px;
    color: #00d4ff;
}
.page-api .tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
}
.page-api .tab-bar button {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    color: #888;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-family: inherit;
}
.page-api .tab-bar button.active {
    background: rgba(0,0,0,0.4);
    border-color: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
}
.page-api .tab-content { display: none; }
.page-api .tab-content.active { display: block; }
.page-api .tab-content pre { border-radius: 0 8px 8px 8px; margin-top: 0; }
.page-api footer {
    text-align: center;
    margin-top: 60px;
    font-size: 0.8rem;
    color: #999;
}
.page-api footer a {
    color: #00d4ff;
    text-decoration: none;
}
.page-api footer a:hover {
    text-decoration: underline;
}
