/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F0F4F8;
  color: #2C3E50;
  line-height: 1.6;
}

a { color: #5B8DEF; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login Page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #E8F0FE 0%, #F0F4F8 50%, #E8F4FD 100%);
}

.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(91, 141, 239, 0.12), 0 2px 8px rgba(0,0,0,0.04);
  padding: 48px 40px;
  width: 400px;
  max-width: 92vw;
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #5B8DEF, #7C9FFF);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 28px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.login-header p {
  color: #8E9AAF;
  font-size: 14px;
}

.login-form .field {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #5A6A7A;
  margin-bottom: 6px;
}

.login-form input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #E8EDF2;
  border-radius: 12px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: #F8FAFC;
}

.login-form input[type="password"]:focus {
  border-color: #5B8DEF;
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #5B8DEF, #7C9FFF);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 141, 239, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(91, 141, 239, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  background: #FEF2F2;
  color: #DC2626;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-error.show { display: block; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #B8C4D0;
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E8EDF2;
}

.btn-feishu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #3370FF;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  box-shadow: 0 4px 14px rgba(51, 112, 255, 0.3);
}

.btn-feishu:hover {
  background: #2860E0;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(51, 112, 255, 0.4);
}

.btn-feishu:active {
  transform: translateY(0);
}

.btn-feishu:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-feishu svg { width: 20px; height: 20px; }

.pwd-section {
  transition: all 0.3s ease;
  overflow: hidden;
}

.pwd-section.hidden { display: none; }

.login-divider-clickable {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px 0;
  color: #8E9AAF;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  padding: 8px 0;
}

.login-divider-clickable:hover { color: #5B8DEF; }

.login-divider-clickable .arrow { font-size: 10px; transition: transform 0.2s; }

/* ── Dashboard ── */
.dashboard-page {
  min-height: 100vh;
  background: #F0F4F8;
}

.navbar {
  background: #fff;
  border-bottom: 1px solid #E8EDF2;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #5B8DEF, #7C9FFF);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.navbar-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5A6A7A;
}

.navbar-avatar {
  width: 32px;
  height: 32px;
  background: #E8EDF2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #5A6A7A;
}

.btn-logout {
  padding: 8px 16px;
  border: 1px solid #E8EDF2;
  border-radius: 8px;
  background: #fff;
  color: #8E9AAF;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: #DC2626;
  color: #DC2626;
}

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.page-header p {
  color: #8E9AAF;
  font-size: 14px;
}

/* ── Project Grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid #E8EDF2;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(91, 141, 239, 0.12);
  border-color: #D0DDF5;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.project-emoji {
  width: 48px;
  height: 48px;
  background: #F0F4F8;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.project-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-active {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-planning {
  background: #FFF3E0;
  color: #E65100;
}

.status-done {
  background: #E3F2FD;
  color: #1565C0;
}

.project-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-version {
  font-size: 12px;
  color: #B8C4D0;
  margin-bottom: 10px;
}

.project-desc {
  font-size: 14px;
  color: #5A6A7A;
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  padding: 3px 10px;
  background: #F0F4F8;
  border-radius: 6px;
  font-size: 12px;
  color: #5A6A7A;
}

/* ── Add Card ── */
.add-card {
  border: 2px dashed #D0DDF5;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  cursor: default;
}

.add-card:hover {
  transform: none;
  box-shadow: none;
  border-color: #5B8DEF;
  background: rgba(91, 141, 239, 0.02);
}

.add-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #F0F4F8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #B8C4D0;
  margin-bottom: 12px;
}

.add-card-text {
  font-size: 15px;
  color: #B8C4D0;
  font-weight: 500;
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #8E9AAF;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E8EDF2;
  border-top-color: #5B8DEF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .container { padding: 20px 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .login-card { padding: 36px 24px; }
}
