:root {
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1e293b;
    --sub-text: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --border: #e2e8f0;
    --ip-bg: #f8fafc;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --radius: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* 警告覆盖层 */
.warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.warning-card {
    background: white;
    border-radius: 20px;
    padding: 32px 28px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    text-align: center;
}

.warning-icon {
    width: 56px;
    height: 56px;
    background: #fef3c7;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.warning-icon svg {
    width: 28px;
    height: 28px;
    color: #d97706;
}

.warning-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.warning-message {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 28px;
    text-align: left;
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
}

.warning-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-warning {
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    min-width: 120px;
}

.btn-disagree {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.btn-disagree:hover {
    background: #e2e8f0;
}

.btn-agree {
    background: #6366f1;
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

.btn-agree:hover {
    background: #4f46e5;
}

.denied-message {
    text-align: center;
    color: #475569;
    font-size: 0.95rem;
    margin-top: 6px;
    display: none;
}

/* 主应用 */
.main-app {
    display: none;
    width: 100%;
    max-width: 500px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 30px 28px;
    border: 1px solid var(--border);
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #ede9fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
}

.header-text h1 {
    font-size: 1.3rem;
    font-weight: 650;
    color: var(--text);
}

.header-text p {
    font-size: 0.85rem;
    color: var(--sub-text);
    margin-top: 2px;
}

.ip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ip-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}

.ip-row.loaded {
    border-color: #c7d2fe;
    background: #f5f7ff;
}

.ip-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    min-width: 70px;
}

.ip-label small {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.7rem;
    display: block;
}

.ip-value {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
    flex: 1;
    min-width: 120px;
}

.ip-value.placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.85rem;
    font-family: inherit;
}

.copy-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-outline {
    background: white;
    color: #1e293b;
    border: 1.5px solid #e2e8f0;
}

.divider {
    margin: 16px 0 12px;
    border-top: 1px dashed #e2e8f0;
}

.local-title {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 600;
}

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    opacity: 0;
    transition: 0.35s;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #059669;
}

.toast.error {
    background: #dc2626;
}

@media (max-width: 480px) {
    .card {
        padding: 24px 18px 20px;
    }
}