* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    cursor: pointer;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.2);
}

#userInfo {
    color: #fff;
    font-weight: 500;
}

/* 页面区域 */
.section {
    min-height: calc(100vh - 80px);
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

/* 首页Hero区域 */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: #667eea;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
}

/* 产品展示 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
}

/* 表单样式 */
.auth-form {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #667eea;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-success:hover {
    background: #218838;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
}

/* 设备管理 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.devices-table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.devices-table {
    width: 100%;
    border-collapse: collapse;
}

.devices-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.devices-table th,
.devices-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.devices-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-online {
    background-color: #d4edda;
    color: #155724;
}

.status-offline {
    background-color: #f8d7da;
    color: #721c24;
}

.status-maintenance {
    background-color: #fff3cd;
    color: #856404;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* 管理员创建用户模态优化 */
#createUserModal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #23282d;
}
#createUserModal .form-group {
    margin-bottom: 14px;
}
#createUserModal .wp-input,
#createUserModal input[type="text"],
#createUserModal input[type="email"],
#createUserModal input[type="password"] {
    width: 100%;
    max-width: 100%;
}
#createUserModal .form-actions {
    justify-content: flex-end;
}
#createUserModal .form-group.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
#createUserModal .form-group.form-inline label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #23282d;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* 消息提示 */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    text-align: center;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* WordPress风格个人中心样式 */
.wp-profile-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    max-width: 1200px;
}

.wp-profile-sidebar {
    width: 240px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px 0;
}

.wp-profile-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

.wp-avatar {
    margin-bottom: 15px;
}

.wp-avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.wp-profile-header h3 {
    margin: 10px 0 5px;
    font-size: 1.1rem;
    color: #23282d;
}

.wp-profile-email {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.wp-profile-nav {
    margin-top: 20px;
}

.wp-profile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-profile-nav li {
    margin: 0;
}

.wp-nav-item {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.wp-nav-item:hover {
    background: #f5f5f5;
    color: #23282d;
}

.wp-nav-item.active {
    background: #f0f6fc;
    color: #2271b1;
    border-left-color: #2271b1;
    font-weight: 500;
}

.wp-profile-content {
    flex: 1;
    min-width: 0;
}

.wp-tab-content {
    display: none;
}

.wp-tab-content.active {
    display: block;
}

.wp-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.wp-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.wp-card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #23282d;
    font-weight: 500;
}

.wp-card-body {
    padding: 20px;
}

.wp-form-table {
    width: 100%;
    border-collapse: collapse;
}

.wp-form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
    text-align: left;
    font-weight: 500;
    color: #23282d;
    vertical-align: top;
}

.wp-form-table td {
    padding: 15px 0;
}

.wp-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3338;
    background: #fff;
}

.wp-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.description {
    margin: 5px 0 0;
    font-size: 13px;
    color: #646970;
    font-style: italic;
}

.wp-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wp-button-primary {
    background: #2271b1;
    color: white;
}

.wp-button-primary:hover {
    background: #135e96;
}

.wp-button-primary:active {
    background: #0a4b78;
}

.submit {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* 设备列表样式（个人中心） */
#profileDevicesList {
    margin-top: 10px;
}

.profile-device-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.profile-device-item h4 {
    margin: 0 0 10px;
    color: #23282d;
    font-size: 1.1rem;
}

.profile-device-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #646970;
}

.profile-device-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 平台管理表格 */
.wp-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.wp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wp-table thead {
    background: #f6f7f7;
}

.wp-table th, .wp-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
    color: #23282d;
}

.wp-table tbody tr:nth-child(odd) {
    background: #fff;
}

.wp-table tbody tr:hover {
    background: #f0f6fc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .devices-table-container {
        overflow-x: auto;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .wp-profile-container {
        flex-direction: column;
    }

    .wp-profile-sidebar {
        width: 100%;
    }

    .wp-profile-nav ul {
        display: flex;
        overflow-x: auto;
    }

    .wp-profile-nav li {
        flex-shrink: 0;
    }

    .wp-nav-item {
        border-left: none;
        border-bottom: 4px solid transparent;
        white-space: nowrap;
    }

    .wp-nav-item.active {
        border-left: none;
        border-bottom-color: #2271b1;
    }

    .wp-form-table th {
        width: 100%;
        display: block;
        padding-bottom: 5px;
    }

    .wp-form-table td {
        display: block;
        padding-top: 5px;
    }

    .wp-input {
        max-width: 100%;
    }
}

/* 平台管理表格样式 */
.wp-table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.wp-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.wp-table thead {
    background: #f6f7f7;
}

.wp-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #23282d;
    border-bottom: 1px solid #c3c4c7;
}

.wp-table td {
    padding: 12px;
    border-bottom: 1px solid #c3c4c7;
    color: #50575e;
}

.wp-table td:last-child {
    white-space: nowrap;
    min-width: 120px;
}

.wp-table td .wp-button {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.wp-table td .wp-button:last-child {
    margin-right: 0;
}

.wp-table tbody tr:hover {
    background: #f6f7f7;
}

.wp-filter-bar {
    margin-bottom: 20px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.wp-filter-bar label {
    font-weight: 500;
    margin-right: 10px;
    color: #23282d;
}

/* 设备分组板块 */
.grouped-devices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}
.group-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 16px;
    border: 1px solid #eee;
}
.group-card h3 {
    margin: 0 0 10px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}
.group-card .device-actions {
    justify-content: flex-start;
}
.group-meta {
    font-size: 12px;
    color: #666;
}
.device-card {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
}
.device-card h4 {
    margin: 0 0 6px;
    color: #333;
}
.device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #555;
    margin: 6px 0;
}
.device-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.device-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}