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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

h2 {
    color: #555;
    margin-bottom: 20px;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
}

.btn {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-delete {
    background-color: #dc3545;
    margin-left: 5px;
}

.btn-delete:hover {
    background-color: #c82333;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 10px;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: bold;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.avatar-icon {
    font-size: 24px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.user-role {
    color: #666;
    font-size: 0.9em;
}

.btn-logout {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
}

.user-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.password-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-group label {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.password-group input {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.password-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-submit {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 1.1em;
}

.points-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.points-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.points-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.total-points {
    border-color: #ffd700;
}

.available-points {
    border-color: #32cd32;
}

.used-points {
    border-color: #ff6b6b;
}

.card-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.card-value {
    font-size: 2.2em;
    font-weight: bold;
    color: #333;
}

.card-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.positive {
    color: #32cd32;
}

.negative {
    color: #ff6b6b;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.detail-item {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(252, 182, 159, 0.3);
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(252, 182, 159, 0.4);
}

.detail-full {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.detail-icon {
    font-size: 1.8em;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.detail-content {
    flex: 1;
}

.detail-label {
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.detail-value {
    color: #333;
    font-size: 1.1em;
    font-weight: bold;
}

.highlight {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        padding-top: 60px; /* 为浏览器地址栏预留空间 */
    }
    
    .container {
        padding: 10px;
        transform: scale(0.85);
        transform-origin: top center;
        width: 117.65%; /* 1 / 0.85 ≈ 117.65% */
        margin: 0 auto;
        min-height: 100vh;
        position: relative;
        left: 50%;
        top: 0;
        transform: translateX(-50%) scale(0.85);
    }
    
    .header {
        gap: 15px;
    }
    
    .user-info {
        gap: 12px;
    }
    
    .section-header h2 {
        font-size: 1.2em;
    }
    
    .password-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .points-overview {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .points-card {
        padding: 20px;
        margin-bottom: 12px;
        touch-action: manipulation;
    }
    
    .card-value {
        font-size: 1.8em;
    }
    
    .card-icon {
        font-size: 2em;
    }
    
    .details-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .detail-full {
        grid-column: 1 / -1;
    }
    
    .detail-item {
        padding: 15px;
        gap: 10px;
        touch-action: manipulation;
    }
    
    .detail-icon {
        font-size: 1.4em;
    }
    
    .detail-value {
        font-size: 0.95em;
    }
}

.admin-password-section,
.compact-password-section {
    margin-top: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.compact-password-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.compact-password-form h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.compact-form {
    margin: 0;
}

.compact-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.compact-form-group {
    flex: 1;
    min-width: 120px;
}

.compact-form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.compact-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

@media (max-width: 480px) {
    body {
        overflow-x: hidden;
        padding-top: 80px; /* 为浏览器地址栏预留更多空间 */
    }
    
    .container {
        padding: 8px;
        transform: scale(0.7);
        transform-origin: top center;
        width: 142.86%; /* 1 / 0.7 ≈ 142.86% */
        margin: 0 auto;
        min-height: 100vh;
        position: relative;
        left: 50%;
        top: 0;
        transform: translateX(-50%) scale(0.7);
    }
    
    .header {
        gap: 12px;
    }
    
    h1 {
        font-size: 1.4em;
    }
    
    .section-header h2 {
        font-size: 1em;
    }
    
    .password-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .password-card {
        padding: 15px;
    }
    
    .points-overview {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .points-card {
        padding: 15px;
        margin-bottom: 10px;
        touch-action: manipulation;
    }
    
    .card-value {
        font-size: 1.5em;
    }
    
    .card-icon {
        font-size: 1.7em;
    }
    
    .card-label {
        font-size: 0.75em;
    }
    
    .details-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .detail-full {
        grid-column: 1 / -1;
    }
    
    .detail-item {
        padding: 12px;
        gap: 8px;
        touch-action: manipulation;
    }
    
    .detail-icon {
        font-size: 1.3em;
    }
    
    .detail-value {
        font-size: 0.9em;
    }
    
    .highlight {
        font-size: 1em;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .compact-form-row {
        flex-direction: column;
    }
    
    .compact-form-group {
        min-width: 100%;
        margin-bottom: 6px;
    }
    
    .admin-password-section,
    .compact-password-section {
        padding: 10px;
        margin-top: 15px;
    }
    
    .compact-password-form h3 {
        font-size: 0.9em;
    }
}

.points-display {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.points-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.points-item label {
    font-weight: bold;
    color: #555;
}

.points-item span {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.highlight {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: bold;
}

.admin-panel {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.admin-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.admin-section h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.password-form {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-row .btn {
    align-self: flex-end;
    margin-top: 0;
}

.password-row {
    background-color: #f8f9fa;
}

.password-row td {
    padding: 10px !important;
    border-bottom: 2px solid #e9ecef;
}

.password-form-inline {
    margin: 0;
}

.password-inline-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.password-inline-group label {
    font-weight: bold;
    color: #495057;
    white-space: nowrap;
}

.password-inline-group input {
    min-width: 120px;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .password-inline-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .password-inline-group label {
        margin-bottom: 5px;
    }
}

.users-table {
    border-collapse: collapse;
    margin-top: 20px;
    max-width: 1090px;
    width: 100%;
}

.users-table th,
.users-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
}

.users-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #555;
}

.users-table tr:hover {
    background-color: #f5f5f5;
}

.users-table input {
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    width: 70px !important;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .points-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-panel {
        padding: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .users-table {
        max-width: none;
        width: 100%;
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 6px 3px;
        min-width: 60px;
    }
    
    .users-table input {
        width: 50px !important;
        font-size: 11px;
        padding: 3px;
    }
    
    .users-table .btn {
        font-size: 11px;
        padding: 3px 6px;
        margin: 1px;
    }
}

@media (max-width: 480px) {
    .admin-panel {
        padding: 10px;
    }
    
    .users-table {
        font-size: 11px;
    }
    
    .users-table th,
    .users-table td {
        padding: 4px 2px;
        min-width: 50px;
    }
    
    .users-table input {
        width: 40px !important;
        font-size: 10px;
        padding: 2px;
    }
    
    .users-table .btn {
        font-size: 10px;
        padding: 2px 4px;
        margin: 1px;
    }
    
    .users-table th:nth-child(7),
    .users-table td:nth-child(7),
    .users-table th:nth-child(8),
    .users-table td:nth-child(8),
    .users-table th:nth-child(9),
    .users-table td:nth-child(9),
    .users-table th:nth-child(10),
    .users-table td:nth-child(10) {
        display: none;
    }
}