:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --light-color: #f8f9fa;
    --dark-color: #333;
    --border-color: #e1e8ed;
    --text-light: #666;
    --error-color: #c53030;
    --success-color: #28a745;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark-color);
    line-height: 1.6;
}

/* 有顶部导航栏的页面需要额外的顶部间距 */
body.has-top-nav {
    padding-top: 80px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
    padding: 15px;

}

.auth-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 0;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    padding: 10px 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.nav-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* 确保用户信息区域的所有元素在一行显示并居中 */
.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* 桌面端确保两个按钮在同一行 */
@media (min-width: 769px) {
    .user-info {
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .nav-btn {
        flex-shrink: 0;
        min-width: 70px;
        padding: 8px 12px;
    }
    
    .welcome-text {
        white-space: nowrap;
        max-width: 120px;
    }
    

}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
    min-width: 70px;
    box-sizing: border-box;
}

.nav-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 导航链接样式 - 替代按钮 */
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
    min-width: 45px;
    box-sizing: border-box;
}

.nav-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    position: relative;
    overflow: hidden;
}

.nav-link:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.back-home-btn span:first-child {
    font-size: 12px;
    font-weight: bold;
    margin-right: 2px;
}

/* 移动端返回首页按钮特殊样式 */
@media (max-width: 768px) {
    .back-home-btn span:first-child {
        font-size: 11px;
        margin-right: 1px;
    }
}

.welcome-text {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 0;
    min-width: auto;
}





.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    width: 60px;
}

.logout-btn:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px) scale(1.05);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.logout-link {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    min-width: 45px;
}

.logout-link:hover {
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info span {
    color: #333;
    font-weight: 500;
}

.user-info a, .user-info button {
    color: var(--primary-color);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 15px;
    transition: background 0.3s;
}

.user-info a:hover, .user-info button:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.user-info .phone-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
}

.user-info .phone-link:hover {
    color: var(--secondary-color);
    text-decoration: none;
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
    position: relative;
    transform: translateY(-1px) scale(1.05);
}

.user-info .phone-link:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 1px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.user-info button {
    border: 1px solid var(--primary-color);
    padding: 3px 8px; /* 减小按钮内边距 */
    font-size: 12px; /* 减小字体大小 */
}

.back-button {
    display: inline-block;
    padding: 8px 15px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.back-button:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(-2px);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    padding: 30px 20px 10px;
}

h1, h2 {
    font-weight: normal;
}

p {
    text-align: center;
    color: var(--text-light);
   
    font-size: 1.1em;
}

.form-group {
    margin-bottom: 25px;
}

.code-input-group {
    display: flex;
    gap: 10px;
}

.code-input-group input {
    flex: 1;
}

.code-input-group button {
    width: auto;
    padding: 12px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.code-input-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.code-input-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: #fff !important;
    color: #333 !important;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.result-container {
    display: none;
    padding: 30px 40px;
    border-top: 1px solid #eee;
}

.result-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.name-card {
    background: var(--light-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.name-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.name-card.selected {
    border: 2px solid var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.delete-btn:hover {
    background-color: #cc0000 !important;
}

.name-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.name-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.name-score {
    font-size: 1em;
    color: var(--primary-color);
    font-weight: bold;
}

.name-details, .name-description {
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    margin-bottom: 8px;
    line-height: 1.5;
}

.detail-label {
    font-weight: 500;
    color: #555;
    min-width: 80px;
    font-size: 0.9em;
    flex-shrink: 0;
}

.detail-value {
    color: #333;
    flex: 1;
    font-size: 0.9em;
}

.name-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.loading {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1em;
    padding: 40px;
}

.error-message {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: var(--error-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.back-link {
    text-align: center;
    padding: 20px 40px 40px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.back-link a:hover {
    color: var(--secondary-color);
}

.history-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.8em;
    color: var(--text-light);
}

/* 中等屏幕优化 */
@media (max-width: 1024px) and (min-width: 769px) {
    .auth-container {
        max-width: 550px;
    }
    
    /* 中等屏幕历史记录优化 */
    .detail-label {
        min-width: 70px;
        font-size: 0.88em;
    }
    
    .detail-item {
        gap: 3px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
body:not(.has-top-nav) {
    padding: 10px;
}

body.has-top-nav {
    padding: 80px 10px 10px;
}
    
    .container {
        border-radius: 10px;
    }
    
    .auth-container {
        max-width: 100%;
        padding: 15px 0;
    }
    
    .code-input-group {
        flex-direction: column;
    }
    
    .code-input-group button {
        width: 100%;
    }
    
    /* 移动端历史记录样式优化 */
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .detail-label {
        min-width: auto;
        font-size: 0.85em;
        margin-bottom: 2px;
    }
    
    .detail-value {
        font-size: 0.9em;
        word-break: break-all;
    }
    
    .name-card {
        padding: 15px;
    }
    
    .history-meta {
        font-size: 0.85em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    h1 {
        font-size: 2em;
        padding: 10px 15px 10px;
    }
    
    form, .result-container, .history-container {
        padding: 0 20px 20px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .name-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .name-score {
        margin-top: 10px;
    }
    
    .top-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 8px 15px;
        box-sizing: border-box;
    }
    
    body.has-top-nav {
        padding: 70px 10px 10px;
    }
    
    .nav-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .user-info {
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        gap: 8px;
        flex: 1;
        flex-wrap: nowrap;
    }
    
    .welcome-text {
        text-align: left;
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
        flex-shrink: 0;
        min-width: auto;
        font-size: 11px;
        max-width: 50px;
        padding: 0 1px;
    }
    
    .nav-btn {
        justify-content: center;
        padding: 4px 8px;
        font-size: 11px;
        flex-shrink: 0;
        min-width: 40px;
        max-width: 60px;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    

}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    color:#faf9f9;
    font-size: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
	font-size: 10px;
}

.footer p {
    margin: 0;
    text-align: center;
    font-size: 10px;
}

/* 登录方式单选按钮样式 */
.login-method-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.login-method-group {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    margin-bottom: 0;
    accent-color: var(--primary-color);
}

.radio-option span {
    color: #333;
    font-size: 16px;
}

/* 登录/注册页面样式 */
.auth-switch {
    text-align: center;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}