/* 全局变量和重置 */
:root {
    --primary-color: #ff0050;
    --primary-hover: #e00046;
    --secondary-color: #00f2fe;
    --success-color: #00c853;
    --warning-color: #ffab00;
    --danger-color: #ff3d00;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 15px 35px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

h1, h2, h3, h4 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-weight: 700;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* 按钮通用样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 28px;
    cursor: pointer;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.3);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 80, 0.4);
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, #ff0050, #ff0080);
}

.btn-danger {
    background: var(--danger-color);
    box-shadow: 0 4px 15px rgba(255, 61, 0, 0.3);
}

.btn-danger:hover {
    background: #e63500;
    box-shadow: 0 6px 20px rgba(255, 61, 0, 0.4);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--danger-color);
}

/* 首页：IP检测卡片 */
.ip-checker {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ip-checker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #00f2fe, #4facfe, #ff0050, #ff0080);
}

.logo {
    margin-bottom: 25px;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #111, #ff0050);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.ip-info {
    background-color: #f8f9fc;
    padding: 12px 24px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.ip-info strong {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 16px;
}

/* 加载动画区域 */
.loading-container {
    margin: 40px 0;
    text-align: center;
}

#loading-text {
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 16px;
    letter-spacing: 0.5px;
}

.loading-progress {
    height: 8px;
    background-color: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 20px;
    max-width: 400px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 检测结果及伪装度指示条 */
.result {
    margin: 10px 0;
}

.result h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-main);
}

.masking-meter {
    margin: 30px auto;
    max-width: 500px;
}

.meter-bar {
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    margin-bottom: 15px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.meter-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

.high { background-color: var(--success-color); }
.medium { background-color: var(--warning-color); }
.low { background-color: var(--danger-color); }

.meter-value {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.meter-value::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: var(--text-main) transparent transparent transparent;
}

.masking-status {
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    margin: 20px auto 30px;
    max-width: 500px;
    border: 1px solid var(--border-color);
}

.masking-status h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.masking-status p {
    color: var(--text-muted);
    font-size: 15px;
}

#result-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
}

.cta-button-small {
    margin: 20px 0 30px;
}

/* 详细检测项列表 */
.check-details {
    margin-top: 40px;
    text-align: left;
}

.check-details h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
    color: var(--text-main);
    position: relative;
    padding-bottom: 15px;
}

.check-details h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.check-item {
    padding: 18px 20px;
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.check-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #d1d8dc;
}

.item-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.check-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 15px;
}

.check-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.check-status {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-good {
    background-color: rgba(0, 200, 83, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.status-bad {
    background-color: rgba(255, 61, 0, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(255, 61, 0, 0.2);
}

.location-info, .locale-info {
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 14px;
}

.location-info {
    background-color: rgba(255, 0, 80, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(255, 0, 80, 0.15);
}

.locale-info {
    background-color: #f1f3f5;
    color: var(--text-main);
    border: 1px solid #e9ecef;
}

.item-hidden {
    opacity: 0;
    transform: translateY(15px);
}

/* 后台管理和登录相关 */
.login-form {
    max-width: 450px;
    margin: 60px auto;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #111, var(--primary-color));
}

.admin-panel {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.admin-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #111, var(--primary-color));
}

.admin-panel .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
}

.admin-panel .header h2 {
    margin-bottom: 0;
}

.admin-info {
    font-size: 15px;
    color: var(--text-muted);
}

.whitelist-manager {
    margin-bottom: 30px;
}

.add-ip-form {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.add-ip-form h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.whitelist-table {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-main);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background-color: #fdfdfd;
}

.back-link {
    margin-top: 30px;
    text-align: center;
}

/* 底部区域 */
.footer {
    text-align: center;
    margin-top: auto;
    padding: 40px 0 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.footer p {
    margin-bottom: 8px;
}

/* 动画和响应式 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 768px) {
    .admin-panel .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .ip-checker, .login-form, .admin-panel {
        padding: 30px 20px;
    }
    .check-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .check-status, .location-info, .locale-info {
        align-self: flex-start;
    }
}